Z Building Format
Jump to navigation
Jump to search
Buildings for each Z level are stored in a separate data file.
File format
The 2800-byte file holds 35 records of 80 bytes (0x50), loaded to static address 0x17c0d8. The renderer and radar use the following fields.
| Offset | Data type | Name | Description |
|---|---|---|---|
| 0 | UINT16LE | x | Building position. |
| 2 | UINT16LE | y | Building position. |
| 4 | UINT8 | type | 0xff means unused; type 8 has production-related handling. |
| 5 | BYTE[75] | other | Additional building state; no complete disk-field schema is documented here. |
Notes
Initialization modifies the records and installs runtime state. A pointer observed after level setup is not necessarily an offset in the disk file.
Source code
From re-z, the open-source browser port:
- src/game/level.js – loading and initialization
- src/game/screen-panel.js – building radar iteration
- src/game/subsys/draw.js – building consumers
- docs/re/NOTES.md – reverse-engineering notes and evidence status
Credits
This file format was reverse engineered by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)