Skip to content
Contribute

GRID · terrain layers

Binary grid family with a shared 20-byte header. Each layer has its own cell size and bit depth.

Documented edition: Imperivm HD · Partial documentation

The map uses separate layers for terrain, height, lighting, transitions, decoration and passability. They share a header but are not interchangeable.

The visible signature in the first four file bytes is DIRG. GRID names the format family; writing literal GRID as the signature would produce different bytes.

LE means little-endian. Layer data follows the 20-byte header. Width and height are logical dimensions, not directly the number of cell columns and rows.

Byte position Type Field
0 4 bytes ASCII signature DIRG
4 uint32 LE cell_size: cell dimension
8 uint32 LE bits_per_cell: bits per cell
12 uint32 LE width: logical width
16 uint32 LE height: logical height

For dimensions divisible by cell_size, divide width and height by that value to obtain cell columns and rows. These values belong to each variant; changing the header’s bit depth does not automatically convert its data.

The passability variant uses one bit per 16-unit cell. Entity footprint .pass files share that header and variant, even though their dimensions and use differ.

File cell_size bits_per_cell
Terrain.terrain.grid 64 8
Terrain.height.grid 32 8
Terrain.light.grid 32 8
Terrain.trans.grid 64 4
Terrain.decor.grid 64 16
Terrain.pass.grid 16 1

The header alone does not fully explain terrain, height, lighting or decoration values. This entry also does not specify every layer’s packing, alignment or bit-order details.

Do not infer height ranges, lighting units, index meanings or supported map sizes from the cell type alone.

Suggest a better description

Write how you would explain this entry. Your proposal will be held in a private inbox for review.

0 / 4000

Proposals are not published automatically. Do not include personal information in your description.