The L3DT design map file (DMF) stores a number of design parameters for the heightfield, including altitude, erosion strength, sea-flooding flags, and so-forth.
The data is preceded by a 11-byte1) header containing the following information:
Field name | Contents | Length | Offset | Purpose |
---|---|---|---|---|
ASCII marker | “L3DT” | 4 | 0 | Tells L3DT and humans that this is an L3DT file. Note string is not null terminated. |
Binary marker | USHORT | 2 | 4 | Tells L3DT what type of map file this is. Must be 200 for DMF. |
Map width | USHORT | 2 | 6 | East-west extent of the map (number of pixels). |
Map height | USHORT | 2 | 8 | North-south extent of the map (number of pixels). |
Wrap flag | BYTE | 1 | 10 | See wrap flag comments for HFF |
The map data itself has 10 bytes per pixel, which are explained below. The pixels are ordered in rows going west-to-east, with south-to-north row-order.
Byte pos | Data type | Description |
---|---|---|
0-1 | short int | Altitude, in metres. |
2 | byte | Peak roughness. |
3 | byte | Fractal roughness. |
4 | byte | Cliffs/terraces strength. |
5 | byte | Erosion strength. |
6 | byte | Auto-lake strength. |
7 | byte | Climate ID number. |
8 | byte | Special type ID. |
9 | byte | Special type parameter. |
These values are used in the design/inflate heightfield algorithm.