Check out the Nox Archaist Forum!

Tuesday, April 5, 2016

New Feature: Fields of Green

Return to Nox Archaist Kickstarter Page

Across the landscape of the world in Nox Archaist both short and tall grass can be found in abundance. Tall grass hides the lower half of mob icons and player icons from view.

The player and mobs think they are pretty clever (the player is probably right). When standing in tall grass they go into stealth mode and stop waving their weapons around.

Tech Talk:

For Review
  • Each tile graphics has a unique ID number. 

New Concepts
  • Each tile is 14 pixels wide x 16 pixels. (in assembly language terminology, 2 screen bytes x 16 lines) 
The tech topic for this post is drawing tiles.

Each tile in the game has it's own shape table which stores the hexadecimal data used by the Apple II hardware to turn on the pixels on the hi-res graphics screen. The shape tables are stored on disk and loaded into auxiliary memory when the game boots. 

There is a subroutine called DRAW.TILE at the core of graphics engine which will draw any shape table at any location on the view screen's tile grid (currently !17 tiles wide X !11 tiles deep). The tile grid location and the shape table to use are passed as parameters.

Since the shape tables are 14x16, as noted above, DRAW.TILE is designed to draw 14x16 shapes. It does this using a loop. Like all loops, it has a stop value that triggers the end of the loop.
How does this relate to tall grass and the lower half of the tile being hidden? 
If the player is standing on a map location with the tile ID for tall grass, a parameter is passed to DRAW.TILE which tells the routine to use a different stop value, thus triggering an end to the loop after only the top half of the shape is drawn.

No comments:

Post a Comment