Thursday, February 20, 2014

FMod - Shock Tile

On Keen Day, I'd like to unleash a flood of amazing Keen-related technology on the general PCKF population. Obviously, Abiathar will be the main attraction, but FleexCore (Abiathar's base) has gone through a lot of updates since its initial release. Since that's only a resource for programmers, it probably only qualifies as a "warm up" to the Keen season.

Today, I started a quick little console program called Shock Tile, to be released the day after Keen Day. It won't take three weeks to write; I actually got essentially all of it done in my study halls just this day. Its purpose is to help squeeze more tiles into a Galaxy mod by compacting the tileset, removing unused tiles, and of course updating levels and tileinfo accordingly.

It works in a few stages:
  1. Read the script file. This is a little text file, ST.TXT, that gives the names of the six (or seven for Keen Dreams) resource files that Shock Tile can affect.
  2. Open the files. Before doing so, ensures that they actually exist and gives a helpful error message if not.
  3. Scan the levels. Found tiles are shoved into a map from the original ID to the new ID, which are sequential in order of discovery. Tileinfo animation offsets are also adjusted during this stage.
  4. Shock the levels. The levels are again looped through, replacing the data with the new IDs.
  5. Shock the graphics. Tile images are re-ordered based on that map and unused images are erased.
  6. Shock the tileinfo. Property entries are re-ordered based on that map and entries past the end of used tiles are set to blank.
I'm currently experiencing issues with tile mapping; it likes to put other tiles into ID 0, which is the "blank" entry and should not be changed.

No comments:

Post a Comment