+==========================================================================================+ |DDiCI level format: | +==========================================================================================+ This is the level format for Dangerous Dave in Copyright Infringement (DDiCI) upon which the Commander Keen (And indeed many ID Software games before 1992) are based. +------------------------------------------------------------------------------------------+ |LEVELXX.DD2: | +------------------------------------------------------------------------------------------+ Level format is basically three sections; the header, which is a fixed size, followed by the tile and sprite planes, which are of equal size. The level is word-based, meaning that each 'tile' in a level is represented by two bytes. Most of the header is (Or was.) used by TED v1.5 to load the level and its associated graphics and is not used by Keen per se. These can be left blank and nobody will care, since the original TED is long gone. ------------------------------------------------------------------------------- FILE STRUCUTURE: HEADER TILE PLANE SPRITE PLANE ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- DDICI LEVEL FORMAT: ------------------------------------------------ 0 2 Lev height Height of the level in tiles 2 2 Level width Width of level is tiles 4 2 Numplanes Number of planes in level (2) 6 4 Blank Blank 10 4 Ted var 2 TED 1.5 varaibles (Ignored by Keen) 14 2 Planesize Level planesize; = 2(h * w) rounded to the next highest multiple of 16 bytes (So a level of 10x10 = 100 has a PS of 112) 20 16 Ted var 6 TED 1.5 variables, the first 1 byte long the rest 3 bytes. Notice that the first byte of each of the last 5 variables is the same. (For Keen 1 for example it is $FF) 36 2P Tile plane The tiles in the level, [Planesize] entries of two-byte words, with the 'padding' words being set at $00 $00 Thus the size of this block is 2 * [Planesize] The level is filled in from top-left to bottom- right, moving right across a row and down a row after reaching a row's end. ~2P 2P Sprite data Same as the tile data, but for sprites ------------------------------------------------ -------------------------------------------------------------------------------