Keen 1-3 Saved game format

From ModdingWiki
Jump to navigation Jump to search
Keen 1-3 Saved game format
Format typeConfiguration
StoringScore
Games

Commander Keen 1-3's saved game files are stored in SAVEDx.CKy. The same format and function is used for all 3 episodes of Keen. The files are 92 bytes long and consist of the following:

Data type Name Description
UINT16LE gotBattery Have battery part? 0=no, 1=yes
UINT16LE gotVacuum Have vacuum cleaner part? 0=no, 1=yes
UINT16LE gotJoystick Have joystick part? 0=no, 1=yes
UINT16LE gotPogo Have pogo stick? 0=no, 1=yes
UINT16LE gotWhiskey Have whiskey part? 0=no, 1=yes
UINT16LE gotKeycardR Have red keycard? 0=no, 1=yes
UINT16LE gotKeycardG Have green keycard? 0=no, 1=yes
UINT16LE gotKeycardB Have blue keycard? 0=no, 1=yes
UINT16LE gotKeycardY Have yellow keycard? 0=no, 1=yes
UINT16LE[16] levelDone 16 values for each level, 0=incomplete, 1=completed. With the 32 levels patch this becomes 32 1-byte entries.
INT16LE numLives Number of lives Keen has left
UINT16LE ammo Number of shots Keen has left
INT32LE score Player score
INT32LE posX Location on world map, in "global" units (256 units = 1 pixel, 4096 units = 1 tile)
INT32LE posY Location on world map, in "global" units (256 units = 1 pixel, 4096 units = 1 tile)
INT32LE viewportX Location of left of visible screen, in "global" units. Usually player location minus nine tiles.
INT32LE viewportY Location of top of visible screen, in "global" units. Usually player location minus three tiles, but variable.
UINT16LE[9] cities In Keen 2, cities saved. 9 2-byte entries, the last seems not to be a valid city, but is kept in memory.

Keycard values are usually set to 0 in saved games, since saving the game is only allowed on the world map and the game takes away all keycards when exiting a level in any way. Because this behavior only changes the keycard values when returning to the world map, loading a saved game that has the keycard values set to 1 will allow the player to enter any level with the keycards still in the inventory.

Notes

  • Keen needs the 'pogo got' value in all 3 episodes of Keen, even though he's never without it and it's never displayed in episodes 2 or 3.

Credits

This file format was reverse engineered by Levellass. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)