Map File

The map of each level is divided into tiles, 16x16 pixel each. Tiles are grouped into categories, which are listed in a category index file.

Category Index File Format

The category index file is an ASCII file, mapping a particular category index to a tile index file. Empty lines or lines starting with a # are ignored.

# The categories file.
xx file
xx file
...
xx
The category index as hex-code (00 - ff ). Thus, there are 256 possible categories.
file
The name of the tile index file.

For version 1 of the map format, the category 00 (background) is reserved for background tiles. All these tiles will be blitted like the tiles in all other categories, but the game's collision detection will handle them as "transparent". For version 2 (or higher), the category 00 shall not be used for compatibility reasons.

The category ff (transparent) is reserved for tiles, that will be handled like background tiles, but blitted half transparent. It also shall not be used for version 2 (or higher).

Tile Index File Format

The tile index file is an ASCII file, mapping a particular tile index to an image file. Empty lines or lines starting with a # are ignored.

# The tiles file for one category.
xx file
xx file
...
xx
The tile index as hex-code (00 - ff ). Thus, each category can contain 256 tiles.
file
The name of the image file for the tile.

Map File Format

Each map is stored as binary file. Meanwhile, there are two versions of the map file format. which will be described in the following subsections, where each character represents one octet in the file.

Version 1

vxxyylcttt...cttt...
v
The file version (must be 0x01 ).
xx
A big-endian 16 bit unsigned integer defining the number of tiles in the x axis.
yy
A big-endian 16 bit unsigned integer defining the number of tiles in the y axis.
l
The number of layers (must be greater or equal than 0x01 ).
c
The tile category of the current layer.
ttt...
The indices of the tiles, starting from the upper left corner to the lower right corner line by line. Each layer must contain exactly xx * yy t -octets.

Version 2

vxxyylcBabttt...cBabttt...
v
The file version (must be 0x02 ).
xx
A big-endian 16 bit unsigned integer defining the number of tiles in the x axis.
yy
A big-endian 16 bit unsigned integer defining the number of tiles in the y axis.
l
The number of layers (must be greater or equal than 0x01 ).
c
The tile category of the current layer.
B
0x01 if the current layer shall be handled as background (and thus is ignored for the collision handling), else 0x00 .
a
The alpha value of the current layer, reaching from 0x00 (fully transparent) to 0xff (fully opaque).
b
The brightness of the current layer, reaching from 0x00 (all non-background pixels are black) over 0x80 (normal brightness level) to 0xff (all non-background pixels are white).
ttt...
The indices of the tiles, starting from the upper left corner to the lower right corner line by line. Each layer must contain exactly xx * yy t -octets.