Menu

zmap_file_format

DaMarkov

Description of the ZMAP file fomat version 1

File header

Offset Type Size in bytes Name Description
0 char(4) 4 magicnumber Should be "ZMAP" in ASCII
4 unsigned char 1 version Should be 1 for version 1
5 int 4 CRC32 CRC32 checksum of the map. This checksum is calculated from byte 73 (enf of file header) to the beginning of the footer
9 unsigned char(64) 64 SHA512 SHA512 hash of the map. The hash is calculated over the same bytes as the CRC32

Map header

Offset Type Size in bytes Name Description
73 unsigned char 1 name_length Length of the name of the map
74 char(name_length) name_length name Name of the map in ASCII. The length is given by the previous field. Remark: the maxium length is 255 characters
74+name_length unsigned char 1 planet_type Planet type of the map. 0 for desert, 1 for volcanic, 2 for arctic, 3 for jungle, 4 for city. Other value are prohibited
75+name_length unsigned char 1 player_count Number of players for the map
76+name_length unsigned char 1 zone_count Number of zones the map has. (Maximum is 255)
77+name_length WORD 2 object_count Number of object th map has. (Maximum is 65535)
79+name_length WORD 2 width Width of th map measured in number of tiles NOT pixels
81+name_length WORD 2 height Height of th map measured in number of tiles NOT pixels

Map data

Offset Type Size in bytes Name Description
83+name_length WORD(width x height) 2 x width x height tiles Tile data of the map stored from the top left of the map to the top right. Row by Row from left to right
(WORD, WORD, unsigned char, unsigned char)(zone_count) (2+2+1+1) x zone_count zones Zone data. Each consists of (in this order): X coordinate (measured in tiles NOT pixels), Y coordinate (measured in tiles NOT pixels), width-1 (in tiles), height-1 (in tiles). Note that not the width is stored but width-1. I.e. if the byte is zero this means the zone has a width of 1 tile (=16 pixels). Storing zones that have width=0 is not possible
t.b.a. (t.b.a) x object_count objects Object data.

Zone data

t.b.a.

Object data

t.b.a.

Additional data

Offset Type Size in bytes Name Description
unsiged char 1 trigger_count t.b.a.
t.b.a (t.b.a.) x trigger_count triggers t.b.a.
unsigned int 4 Lua_script_length t.b.a.
char(Lua_script_length) Lua_script_length Lua_script t.b.a.
unsigned int 4 assets_size t.b.a.
unsigned char(assets_size) assets_size assets t.b.a.

### Assets ###

t.b.a.

Offset Type Size in bytes Name Description
unsigned char 1 username_length t.b.a.
unsigned char(username_length) username_length username t.b.a.
unsigned char(32) 32 public_key t.b.a.
unsigned char(64) 64 signature t.b.a.

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.