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
One map, several grids
Section titled “One map, several grids”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.
Shared header
Section titled “Shared header”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 |
Per-layer values
Section titled “Per-layer values”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 |
Known limits
Section titled “Known limits”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.