Z Building Format

From ModdingWiki
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:

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!)