Skip to content

Scenario terrain data

Formats

Changed in 0.1.0

Stores a scenario's terrain cells in the Base64-encoded IsoMapPack sections.

Format
Kind
Configuration file
Filename
*.MAP, *.MPR

Scenario map files are INI files, but their terrain cells are stored as binary data. The binary stream is Base64-encoded and split across the numbered assignments of an [IsoMapPack] section. The later revisions use [IsoMapPack2] through [IsoMapPack5] instead.

The loader checks all five sections in revision order. A missing section has no effect. If more than one revision is present, each one that decodes is applied, so a later section may replace terrain loaded by an earlier one. The current map writer clears all five sections and writes only [IsoMapPack5].

SectionCompressionCell data
[IsoMapPack]LCWTile type, sub-tile and height for the original 128 by 128 cell grid
[IsoMapPack2]LCWSparse cell records terminated by CELL_NONE
[IsoMapPack3]NoneSparse cell records terminated by CELL_NONE
[IsoMapPack4]LZOSparse cell records terminated by CELL_NONE
[IsoMapPack5]LZOVersion 4 fields plus the cell’s ice-growth flag

An IsoMapPack5 cell record carries the cell coordinate, isometric tile type, sub-tile, height and ice-growth flag. LZO divides that record stream into blocks of at most 8 KiB; each block begins with the compressed and uncompressed byte counts. The final CELL_NONE coordinate is not followed by the rest of a cell record.

IsoMapPack5 accepts at most the LZO block storage required for one record per map cell and the terminating CELL_NONE. A section that reaches beyond that bound is reported and not applied; the initial fill or terrain from an earlier pack revision remains. The readers for revisions 1 through 4 each accept up to 512,000 Base64-decoded bytes.

Source files

Linked at revision 59fae722af8c.

History

  1. Changed0.1.0In development

    Size IsoMapPack5 decoding from its terrain payload