Check out the Nox Archaist Forum!

Sunday, March 27, 2016

New Feature: Swimming

Players can wade into the surf and swim in deeper water. However, swim at your own risk!

While we want the player to have some ability to enter water, we expect ships to be very relevant in Nox Archaist.

On a side note, the ability to enter water came about as a result of experimenting with water animation. A glitch in the animation resulted in the player icon gradually sinking and disappearing completely!

Tech Talk:

We will try include a Tech Talk section with each future post to dive into the technical aspects of how the feature was implemented.

About the swimming feature...

Nox Archaist has a robust architecture for creating unique features relating to movement. All tile graphics shapes (i.e. water, grass, mountains, etc). have a unique ID number. For example, grass tiles are currently assigned the hexadecimal number $34. Mountains are assigned $00. 

There are currently 4 water tiles, each which represents a different depth ($88, $89, $8A, $8B). For example, the water tiles closest to land with the small white lines symbolizing cresting waves are the most shallow water, which we refer to as "surf".

When the player moves, a collision check is done to determine if the destination location has a tile ID which is impassible, such as mountain tile $00. 

Given this awareness that the game has of the tile IDs on the view screen, we can also trigger special effects when the player stands on or attempts to move to a tile of a particular type.

With these concepts in mind the implementation of swimming included the following:
  • How do we let the player go swimming?  By not telling the collision control system to block water tile IDs. By default all tile IDs are passable until we tell it otherwise.   
  • If tile ID = any water tile ID, then load the wading or swimming version of player icon (tile ID $99, $9A) into the player icon buffer.