Check out the Nox Archaist Forum!

Sunday, June 12, 2016

Tech Talk: How Does the Game Know Which Tiles Should Be Hidden/Dark? (PART I)

The sunrise/sunset feature recently announced simulates day/night by hiding some of the tiles on the screen, which leaves them dark or empty. Today we will talk about how the graphics engine figures out which tiles should be hidden/dark.

For Review

  • Each tile graphic has a unique ID number "Tile ID" 

New Concepts
  • #1 Each graphics screen the player sees is divided into a grid of 17 tiles wide X 11 tiles deep.
  • #2 To draw the first graphics screen the player sees after launching the game, the graphics engine examines the Tile ID for each position on the grid and draws the graphic corresponding to the Tile ID, in each grid position. 
  • #3 When the player presses a movement key, the graphics engine "scrolls" the tiles in the opposite direction which the player moved and then draws a new row or column of tiles on the screen edge. For example, if the player moves north, the tiles are scrolled down 1 grid row and new tiles are draw in the top grid row, representing the new terrain to the north that is now visible to the player. 
  • #4 Screen scrolling involves copying the values in the memory addresses that control which monitor pixels are turned on. This process is much faster than drawing each tile graphic from scratch, as is done to generate the first graphics screen the player sees after game launch. 
The graphics engine keeps track of which tiles should be hidden/dark and which tiles should be visible via an array identical in size to the array which stores the Tile ID associated with each grid position on the screen. Since this array essentially mirrors the format tile grid, but contains additional information on each tile, we decided to call it a stencil array.

The darkness stencil array contains either the value $00 (visible) or $01 (hidden/dark) for each position on the grid.
 
That is what tells the graphics engine which tiles are hidden/dark. The more complicated aspect is generating the values in the darkness stencil array, where the actual determination is made on which tiles the player will see. That is the job of a subroutine known as the darkness algorithm. 


Sunrise and Sunset

The first thing the darkness algorithm does is stop and consider the time of day. If it is tea time, the darkness algorithm takes a break, orders some virtual tea from disk and the player is unfortunately left staring at a screen that isn't changing. Now you know what's really going on when the disk drive runs endlessly when entering towns and such in tile based RPG games.

Of course that isn't really what happens (except in the U.K. release). Actually, the darkness algorithm determines which of four phases the time on the in-game clock corresponds with: sunrise, day, sunset, night. Each phase of the day corresponds with a specific pattern of tiles which are set to $00 (visible) and $01 (hidden/dark) in the darkness stencil array.
 
Daytime is easy. The entire grid is set to $00s (visible)

Night is mostly $01 (hidden/dark) except for a few tiles right near the player in the center of the screen. We worked out this pattern on a mock tile grid and preset the values for nightime into memory. When it is nighttime, the darkness algorithm copies those values into the darkness stencil array.

Sunrise & Sunset are a bit trickier than night. Each has four phases of darkness in between full day light and full night time. Just like night, we drew the visible/hidden patter for each of those phases on a mock tile grid and stored those values in memory for the darkness algorithm to copy into the darkness stencil array at the appropriate time.

In summary, the game determines which tiles should be dark/hidden, with regard to the time of day, by copying preset values in memory into to the darkness stencil array, which in turn tells the graphics engine which tiles not to draw.


Part II is coming soon, where we'll talk about how the darkness algorithm calculates how terrain/objects like mountains and walls obscure line of sight.
 

Sunday, June 5, 2016

Graphics Contest Update

Hey guys, one of our blog readers had a great suggestion to utilize Creative Commons licensing for graphics submitted to the Nox Archaist contest.

We've updated the contest details to clarify that any work submitted would be licensed under Creative Commons Attribution 4.0 International.

Using Creative Commons helps clarify our original intentions. Basically, the artist retains the rights to their work and can still license it to other people, while at the same time giving us the ability to include their art in Nox Archaist.

Monday, May 23, 2016

Graphics Contest Announcement

Hey Guys,

The 6502 Workshop team has been pounding out code for Nox Archaist and the game is starting to come to life.  One area that we have been kind of winging is tile graphics art.  We would like to offer a chance for members of the retro gaming community to participate in the design of Nox Archaist while hopefully improving the final result and getting the game into your hands more quickly.  

Starting today we are running a tile contest!

The top three submitted tiles will be determined on 7-31-2016 and the winners will receive the benefits below:
  • One custom in-game NPC named and based on input from the winner 
  • Copy of the initial release of Nox Archaist on 5.25” floppy disks
  • Pre-release digital copy of Nox Archaist
  • Printed manual
  • Name mentioned in Nox Archaist game credits
  • Announcement of winners on our blog and in this forum
  • Any other goodies we can come up with 

To participate, just send us one or more tile designs using the criteria provided at the link below. Submissions can be sent via email to contest@6502workshop.com contest@6502workshop.com

Click here for contest details.




Tuesday, May 17, 2016

Nox Archaist featured in Open Apple podcast

Check out the recent Open Apple podcast! They discuss Nox Archaist: at 01:36:00



Stay tuned, we will be announcing new game features soon!

Friday, May 13, 2016

New Features: In-Game Clock and Sunrise/Sunset

We are excited to announce new features in Nox Archaist, a new role playing game we are developing exclusively for the Apple II platform and emulators.

An in-game clock has been implemented in Nox Archaist which allows us to trigger events based on the time of day.  The first events we've built off of this new game clock are automatic sunrise and sunset.

We have a gameplay demo showing sunrise/sunset in Nox Archaist here:



Stay tuned for a Tech Talk posting coming soon that will discuss how hidden tiles (/aka darkness) are generated in Nox Archaist to simulate sunrise, sunset and terrain such as mountains and trees blocking line of sight.



About Nox Archaist
Nox Archaist is a 2D tile based fantasy RPG with a classic Apple II look and feel. We are taking advantage of the full 128k available on the IIe and later models which will help us create features and effects that may not have been seen in vintage 1980s Apple games.


Sunset: 8:30pm






Sunrise 5:30am