File format
The binary map file format is very compact. It is block based so you can quickly and easily load the file. The header and table are fixed parts. Following them, are the object datas. Some objects may also have subdata appended to them. The file length should be divisible by 4.



Info: 'Object' represents a layer, image, geom. object or tileset. Tilesets are always at the beginning of a map file. The background-object follows the tileset-objects. All other objects follow the background object.

Header
The header contains the main information of a map file. The header is not encrypted. The CRC32-checksum is calculated from offset [8]. SHA1-fingerprint contains the password-hashvalue.

OffsetBytesDescription
03'UMF' signature (Universal Map File)
31bit 0-5 = version
1=Version 1.0-1.1
2=Version 1.2-1.3
3=Version 1.4+

bit 6 = created with PROversion (0=no, 1=yes)
bit 7 = encrypted (0=no, 1=yes)
44CRC32-checksum
820SHA1-fingerprint (only PROversion)
282block count
302layer count
322image count
342geom. objects
362tileset count
382animation count
402basedata count
422datalayer count
442metadata count
462variables count (v1.4+)
482default values count (v1.4+)
5014*reserved*


block size 64 bytes


Table
The map file contains blocks. A block can store either objectdata, basedata, metadata, datalayer, etc. Every block can have a different size. The table contains the size information for each block.

OffsetBytesDescription
04size block 1
44size block 2
...4size block n


Tileset
Tileset-definitions follow the table-block. The tileset can only contain animation as subdata.

OffsetBytesDescription
01constant 100
11mask color R
21mask color G
31mask color B
42frame width
62frame height
82Y-factor
102animation count
122frame count
1412image file


block size 26 bytes


Animation
The animation block follows the tileset-definitions.

OffsetBytesDescription
01constant 101
12frame count (1...)
32start frame (1...)
51mode (1=paused, 2=forward, 3=backward)
61default tile value (v1.2+)
74*reserved* (msecs time in program)
112*reserved* (current frame in program)
...2animation frame
...2animation time
...



block size 13+x bytes


Default data values (v1.2+)
This table contain default values from each tile of one tileset. This block follow tileset-definitions.

OffsetByteDescription
01constant 105
12frame count
31*reserved*
4xstandard value 1 byte pro frame


block size 4+x bytes


Background
Each map has a background object. It is always stored after the tileset-definitions. It can have metadata as subdata.

OffsetBytesDescription
01constant 0
11visible (0=no, 1=yes)
212image file
141parallax x
151parallax y
164position x
204position y
244map width
284map height
321fill mode (0=without, 1=color, 2=image, 3=masked image)
331fill color R
341fill color G
351fill color B


block size 36 bytes


Layer (rectangular)
This layer can contain basedata, metadata or the datalayer as subdata.

OffsetBytesDescription
01constant 1
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244layer width
284layer height
322tileset number
341masked (0=no, 1=yes)
351endless layer repeat (0=no, 1=yes) v1.4+


block size 35 bytes
block size 36 bytes (v1.4+)


Layer (isometric 1)
This layer can contain basedata, metadata or the datalayer as subdata.

OffsetBytesDescription
01constant 2
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244layer width
284layer height
322tileset number


block size 34 bytes


Layer (isometric 2)
This layer can contain basedata, metadata or the datalayer as subdata.

OffsetBytesDescription
01constant 3
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244layer width
284layer height
322tileset number
341tile shift (0=no, 1=yes)


block size 35 bytes


Layer (hexagonal 1)
This layer can contain basedata, metadata or the datalayer as subdata.

OffsetBytesDescription
01constant 4
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244layer width
284layer height
322tileset number
341tile shift (0=no, 1=yes)


block size 35 bytes


Layer (hexagonal 2)
This layer can contain basedata, metadata or the datalayer as subdata.

OffsetBytesDescription
01constant 5
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244layer width
284layer height
322tileset number
341tile shift (0=no, 1=yes)


block size 35 bytes


Layer (clone)
This layer does not contain basedata or the datalayer. It can only contain metadada as subdata. Each layer has its own layer number. The first layer is number 1.

OffsetBytesDescription
01constant 6
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
242layer number


block size 26 bytes


Basedata
This data contain main tile-informations from a layer. I use this data to draw a layer. Basedata can only follow layer-objects (but not clone). You can find the data format here.

OffsetBytesDescription
01constant 102
11depth (4, 8, 12 or 16)
24data length in bytes
62*reserved*
8xdata...
...



block size 8+x bytes


Datalayer
This data contain invisible tile-informations from a layer. The datalayer can only follow layer-objects (but not clone). You can find the data format here.

OffsetBytesDescription
01constant 103
11depth (1, 2, 4 or 8)
24data length in bytes
62*reserved*
8xdata...
...



block size 8+x bytes


Metadata
This data contain invisible informations from a object. Metadata can follow all objects (except tileset).

OffsetBytesDescription
01constant 104
11data format (0=binary, 1=ascii)
24data length in bytes
62*reserved*
8xdata...
...



block size 8+x bytes


Variables (v1.4+)
This data contain invisible informations from a object. Variables can follow all objects (except tileset).

OffsetByteDescription
01constant 106
11*reserved*
22variables in this block
44data length in byte
8xdata (description):
1) string length A for name (1 byte)
2) string length B for value (1 byte)
3) string name with size A
4) string value with size B
...



block size 8+x bytes


Object (image)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata.

OffsetBytesDescription
01constant 7
11visible (0=nein, 1=ja)
212name
141parallax x
151parallax y
164position x
204position y
242tileset number
262animation number/tile number
282animation start frame
301animation mode (0=default, 1=paused, 2=forward, 3=backward)
311masked (0=no, 1=yes)


block size 32 bytes


Object (block)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata. Each layer has its own layer number. The first layer is number 1.

OffsetBytesDescription
01constant 8
11visible (0=no, 1=yes)
212name
141adjustment x
151adjustment y
164tile position x
204tile position y
242tileset number
262animation number/tile number
282animation start frame
301animation mode (0=default, 1=paused, 2=forward, 3=backward)
311masked (0=no, 1=yes)
322layer number


block size 34 bytes


Object (point)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata.

OffsetBytesDescription
01constant 9
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y


block size 24 bytes


Object (line)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata.

OffsetBytesDescription
01constant 10
11visible (0=no, 1=yes)
212name
141parallax X
151parallax Y
164start position x
204start position y
244end position x
284end position y


block size 32 bytes


Object (rect)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata.

OffsetBytesDescription
01constant 11
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244width
284height


block size 32 bytes


Object (oval)
This object does not contain basedata or the datalayer. It can only contain metadada as subdata.

OffsetBytesDescription
01constant 12
11visible (0=no, 1=yes)
212name
141parallax x
151parallax y
164position x
204position y
244radius x
284radius y


block size 32 bytes