L3DT documentation
Large 3D terrain generator

Attributes map file

The L3DT attributes map file (AMF) stores the land type of each pixel in the height map. The 'amf.gz' extension indicates the AMF file has been compressed using the gzip algorithm.

The data is preceded by a 10-byte 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 520 for AMF.
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).

The map data itself has two bytes per pixel, the first being 'land type ID' and the second being 'climate ID'. The pixels are ordered in rows going west-to-east, with south-to-north row-order.

The climate ID value indicates the ID number of the relevant climate within the group climate list (which you can find in the Climates section of the project file). The land type ID indicates the ID number of the land type in that climate (see LandTypeList section of the climate file). You also can get the combined 2-byte values using the export type list option.

Addenda for L3DT v2.8 and later

In L3DT v2.8 and later versions, the AMF file contains an additional list of climate names after the map data. This extra data consist of:

  • A 32-bit integer for the number of climates.
  • Then, for each climate:
    • A 32-bit integer for the climate name length.
    • The climate name, the length of which is given by the preceding integer. The string is not null-terminated.

This additional data is optional, and can be safely omitted or ignored.

l3dt/formats/specs/amf.txt · Last modified: 2017/08/31 05:17 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki