Menu

MAP File

Tggtt

MAP File

Description

MAP files store worlds saved by the world editor of the sequel of deadlock.
The known instances are not compressed.

Endianness

Every known MAP file is little endian.

Structure

Header contains a magic number which is the same as Deadlock II save games.

Offset (hex) Size (bytes) Type Name Constant Value
0 10 Constant Length ANSI String magic number "Deadlock 2"

Following the magic number, there is a copyright notice.
The header also contains the following attributes:

Offset (hex) Size (bytes) Type Name
30x0C 1 Integer Number of Territories
30x0E 1 Integer World Width
30x0F 1 Integer World Height
31x00 1 Enumeration World Type

World Type Enumeration

Code (integer) Name
00 Earth-like
01 Tropical
02 Martian
03 Icy
04 Dry
05 Volcanic
06 Alien

Territory Data

Territory data begins 8 bytes after world type value, number of
territories equal to value in 30x0C.

Size (bytes) Type Name
25 Null Terminated String Territory Name
1 Enumeration Territory Type
4 * 36 Structure Tile Data

Territory name is first 25 bytes null terminated string, which is followed by garbage
Following the territory name, the next byte stores the territory type.

Territory Type Enumeration
Code (integer) Name
00 Ocean
01 Plains
02 Forest
03 Swamp
04 Mountains
05 Wasteland

Tile Data Structure

The territory type is followed by 4-byte data on the 36 grid tiles, one
after the other. The tiles start from top-left and are laid sequentially until bottom right, row by row.

Size (bytes) Type Name
1 Enumeration Tile Type
1 Padding Not Important
1 Enumeration Bonus Type
1 Padding Not Important
Tile Type Enumeration
Code (integer) Name
00 Clear
01 Rough
02 Lightly Wooded
03 Densely Wooded
04 Rocky
05 Worthless
0F Wet
Tile Type Enumeration
Code (integer) Name
00 No Bonus
01 Food
02 Energy
03 Wood
04 Iron
05 Steel
06 Green Ore
07 Yellow Alloy
08 Electronic Parts
09 Anti-Matter Pod

Map Data Structure

Right after the territory data, the map block data is stored. Each block in the game world is represented by a 10 byte set.

Size (bytes) Type Name
1 Integer X-Position in world
1 Integer Y-Position in world
1 Integer Territory ID
7 Padding Not Important or unknown

The ID of the territory to whom the tile belongs (starts from 1 for the first territory whose data is stored in the map file and so on).

The next seven bytes are unknown, but when replaced with NULLs have no ill
effect, so they can be considered unimportant, at least for now.

Notes:
  • We have not found values that goes beyond half of its max value, therefore, they could be signed but it was irrelevant;
  • It is unclear about the padding, the first byte of padding after territory ID for Map block structure could be part of the ID itself (it is usually null);

Trivia

  • The header contains "Pre-release version" in it despite appearing on updated final version;
  • The bonus type enumeration has elements that are not valid for natural resources, such as "Steel".

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.