Thursday, March 12, 2015

Tharify - Essentially Done

Today during a study hall, I hammered out the rest of Tharify: the command-line interface and the detharification routine. With the command interface in place, I actually got to test the tharification that I finished writing yesterday. It worked almost perfectly, except for these fairly apparent bugs:

  • I had forgotten to actually add the converted GalaxyLevel to the GalaxyLevels collection. This resulted in a blank GameMaps and a crash when opening with Abiathar.
  • FleexCore2's Vorticons level loader was completely broken. (I had ported it, more or less, from the original FleexCore, but apparently never tested.) At first, loading any file resulted in a zero-by-zero level because I never set the seek needle back to the start of the stream after decompressing. After fixing that, I found that the plane size was miscalculated, resulting in all sprites being shifted over.
  • The adjustments I made a while ago to the GalaxyLevels loader (allowing a level's header to start at zero in the GameMaps) caused the " FLEEXY " signature to be interpreted as a level header when there is no level 0. 
  • The Keen sprite/icon rendered as a blank tile because of an off-by-one error in the sprite to infoplane tileset conversion code.
I fixed all of them fairly easily, except the third. I added some special cases to the Galaxy levels loader to heuristically detect whether there is a real level at offset zero when the map header file has a zero value for the first entry.

Keen 1, tharified, and opened in Abiathar
The first background tile renders as the first actual tile because Abiathar always renders the first foreground tile as fully transparent. When tile zero is actually present, the background tile representation of it shows through. The second background tile says "not a link" and is used to suppress absolute-to-relative link correction.

When running the first Tharify command, the /outconf switch can be used to save the configuration to a small file for easy detharifying or retharifying. The presence of the /conf switch in either mode (/thar or /vort) causes the operation parameters to be loaded from the file rather that sought on the command line.

I'll do some more testing, of course, but Tharify is pretty much ready for this Keen Day. (Two days away!)

No comments:

Post a Comment