Terrain records
LIB/PART000.DAT
One 46-byte record per terrain tile: how units may enter it and which tile it becomes in each weather.
Status: the layout is read from the data and checked against the tile pixels and against how the game moves units and draws weather. The weather array is the best-tested part; most other words in the record are still unknown.
0.
data
9408.
Native mobile construction reads capability bits 0x0002/0x0004/0x0010 to admit road/rail/fortification on current base and overlay records. Other bits remain unnamed; see "Native construction capabilities".
databehaviour
8 in exactly one record, 0 in the rest.
data
datarenderbehaviour
| bit | mask | name | meaning |
|---|---|---|---|
| 0 | 0x000001 | road | Road. |
| 1 | 0x000002 | path | Path. |
| 2 | 0x000004 | ditch | Ditch; also the fortification overlay PART0093. |
| 3 | 0x000008 | rail | Rail. |
| 4 | 0x000010 | minor obstacle | Rocks, scrub, mounds, small pipes and posts. Wheeled vehicles, ships and trains cannot enter. |
| 5 | 0x000020 | major obstacle | Pipelines and machinery. Only light ground vehicles and aircraft can enter. |
| 6 | 0x000040 | hill | Hill. |
| 7 | 0x000080 | mountain | Mountain. |
| 8 | 0x000100 | slope | Slope. |
| 9 | 0x000200 | grassland | Grassland. |
| 10 | 0x000400 | forest | Forest. |
| 11 | 0x000800 | hazard | Pipes, pools, spills, lava, shafts, bore holes and geysers, plus the animation placeholder tiles. Only aircraft can enter. |
| 12 | 0x001000 | water basin | Water basin. |
| 13 | 0x002000 | mud | Mud. |
| 14 | 0x004000 | snow | Snow-covered open ground. |
| 15 | 0x008000 | rock in water | Rock in water. |
| 16 | 0x010000 | shallow water | Shallow water. |
| 17 | 0x020000 | medium water | Medium water. |
| 18 | 0x040000 | deep water | Deep water. |
| 19 | 0x080000 | ice | Ice. |
| 20 | 0x100000 | building | Building. |
| 21 | 0x200000 | building (enterable) | Building a unit can enter. |
| 22 | 0x400000 | building entrance | Building entrance. |
| 23–31 | unused | Never set in any record. |
1323: index-shaped, not a flag.
Never self-references.
data
999.
Also index-shaped.
data
data
8, non-zero in 40 records.
data
264.
The high byte at +0x13 has a recovered aircraft-movement use: if it equals 1, the mover has the plane flag, and runtime unit state byte +0x14 is below 2, the visible-range builder assigns blocked cost 20000. Exactly 38 records carry high byte 1; they cluster around hill, mountain, rock and tall-structure art. This supports a height/air-obstacle interpretation, but the low byte and the unit-state scale remain unnamed.
databehaviour
Confirmed by tile pixels and by a weather change in a played mission. See "Weather mapping".
databehaviourrender
data
data
Example: a mud tile and its weather
Terrain tile PART0131 is record 131, so its 46 bytes start at 131 x 46 = 0x178a in PART000.DAT. Each line is one field: its offset in the record, its bytes as stored, and the value they decode to.
0x00 00 00 reserved_head = 0
0x02 10 00 unknown_word_02 = 16
0x04 00 00 unknown_word_04 = 0
0x06 00 20 00 00 entry_mask = 0x00002000: mud
0x0a 00 00 unknown_word_0a = 0
0x0c 00 00 unknown_word_0c = 0
0x0e 00 00 unknown_word_0e = 0
0x10 00 00 unknown_word_10 = 0
0x12 00 00 unknown_word_12 = 0
0x14 83 00 1e 03 30 03 4f 02 be 02 weathermapping = 131, 798, 816, 591, 702
0x1e 00 00 unknown_word_1e = 0
0x20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 reserved_tail = 0
weathermapping lists the tile drawn in each of the five weather states, in order: sunny 131 (this tile itself), light rain 798, heavy rain 816, light snow 591 and heavy snow 702. The first four are mud as well (entry_mask 0x2000). The heavy snow tile 702 has entry_mask 0x4000, the snow class, so the same ground changes class when the snow arrives.
Still to investigate
Every field marked unknown or partial above, and every bit that is set without a name or named without ever being set.
- unknown_word_02◐Non-zero in 527 records, 41 distinct values up to
9408. TerrainRecord - unknown_word_04○
8in exactly one record,0in the rest. TerrainRecord - unknown_word_0a○Non-zero in only 40 records but 41 distinct values up to
1323: index-shaped, not a flag. TerrainRecord - unknown_word_0c○Non-zero in 159 records, 60 distinct values up to
999. TerrainRecord - unknown_word_0e○Non-zero in 2 records. TerrainRecord
- unknown_word_10○8 distinct values, max
8, non-zero in 40 records. TerrainRecord - unknown_word_12◐Non-zero in 218 records, 11 distinct values up to
264. TerrainRecord - unknown_word_1e○Non-zero in 3 records only. TerrainRecord