Thursday, October 12, 2017

Keen Modding Live - Galaxy level handling

Keen Vorticons and Galaxy are very different, so much so that even though Keen Modding Live mostly just has to keep track of files, it needs to treat Vorticons and Galaxy levels differently. In the episodes table, there's a column for "genre," currently set to either a V or a G.

When uploading a new level, the client specifies the episode ID, and the genre determines which files are expected. For Vorticons, that's easy - it only takes one. For Galaxy, it needs both GameMaps and MapHead files, but the player infrastructure expects a single level-specific package. Therefore, when a Galaxy level is uploaded, the system checks that the MapHead is the right length, concatenates the GameMaps onto the end of the uploaded MapHead file, uses that as the package, and generates a JSON manifest explaining to Emscripten DOSBox where the GameMaps begins. Dreams handing isn't currently implemented, but it'll basically be just the same plus a MapDict.

It would be convenient if the system accepted Abiathar single-level (ASLEV) files; then people wouldn't have to worry about keeping the level in slot 1 in the GameMaps. That would require quite a bit of work, though, since ASLEVs are LZW-compressed and that takes a lot of bit twiddling, which doesn't look particularly fun to do in PHP. Perhaps a desktop client (.NET, which can then load FleexCore2) could implement that client-side.

No comments:

Post a Comment