Back to the Index


File Format Description

Map Format | Tile Format

Map File Format v1.1

I've marked changes to the last release of this doc with red color.



Header
Size (bytes) Name Description
4 size The size of the header in bytes (= 0x0134)
4 magic "MAP" as NULL terminated string
1 version Version number (0x01 at the moment)
1 sub version Release number (0x01 at the moment)
1 trans_index Index of the transparent color
1 padding - reserved -
4 width Width of the map (in tiles)
4 height Height of the map (in tiles)
255 path Absolute path of the tile file used
32 name Name (without extension) of the tile file used
1 padding - reserved -

The header is followed by width * height cells.
The data starts at offset 0x0134.

Cell
Size (bytes) Name Description
2 base Index of the base tile
2 fringe Index of the fringe tile
2 object Index of the object tile
2 roof Index of the roof tile
1 walkability Walkability information
1 walkspecial Special walk attributes
2 padding - reserved -
4 flags Flags, currently 16 used by MapMaker
4 special Additional information


Walkability and Walkspecial constants
#define WLK_FREE	0x00		// All of the tile is walkable
#define WLK_FULL	0x01		// The tile is un- walkable
#define WLK_LOWER	0x02		// The lower half is walkable
#define	WLK_UPPER	0x03		// The upper half is walkable
#define WLK_LEFTUP	0x04		// The Upper- Left half is walkable
#define WLK_RGHTDWN	0x05		// The Lower- Right half is walkable
#define WLK_LEFTDWN	0x06		// The Lower- Left half is walkable
#define WLK_RGHTUP	0x07		// The Upper- Right half is walkable


#define WLK_NORTH	0x10		// Can be passed south -> north
#define WLK_SOUTH	0x20		// Can be passed north -> south
#define WLK_EAST	0x40		// Can be passed west  -> east
#define WLK_WEST	0x80		// Can be passed east  -> west
#define WLK_ALWAYS  	0xf0		// Can be passed in every direction


Tile File Format

Tile Header
Size (bytes) Name Description
2 count Number of tiles stored
2 width Width of the tiles
2 height Height of the tiles
768 palette Palette used for the tiles.

The header is followed by count * (width*height) bytes, containing the raw tile data.


© 1997 Lennart Steinke<lennart_steinke@bigfoot.com>