Z Level Index Format
Jump to navigation
Jump to search
LEVELS.DAT selects the files and initial settings for each level of Z.
File format
The file consists of 240-byte (0xf0) records with no global header. The inspected CD file has 51 records; record 0 is a test level. Numbers are little-endian. Names are fixed-width NUL-terminated byte strings.
| Offset | Data type | Name | Description |
|---|---|---|---|
| 0x00 | char[20] | name | Display name. |
| 0x14 | char[13] | map | MAP filename. |
| 0x21 | char[13] | robots | Robot database filename. |
| 0x2e | char[13] | cpuPlayer | CPU/territory filename. |
| 0x3b | char[13] | wal2 | Filename; parser name retained, purpose not fully documented. |
| 0x48 | char[13] | wal1 | Filename; parser name retained. |
| 0x55 | BYTE[12] | roster | Starting roster copied by rosterInit. |
| 0x61 | char[13] | objects | Object filename. |
| 0x6e | UINT8 | selector | Selects a 26-byte executable table entry; also used in music selection. |
| 0x6f | char[13] | mult | Multiplier filename. |
| 0x7c | UINT32LE | value7c | Used by fort-position setup; complete meaning unresolved. |
| 0x80 | UINT32LE | value80 | Used by fort-position setup; complete meaning unresolved. |
| 0x84 | char[13] | buildings | Building filename. |
| 0x91 | char[13] | bridges | Bridge filename. |
| 0x9e | BYTE[82] | remainder | Not decoded by parseLevels; preserve. |
Notes
The convenience parser reads 14 bytes for objects. The original loader copies 13; byte 0x6e is separately used as a selector. Do not overwrite that byte when changing the filename.
Source code
From re-z, the open-source browser port:
- src/formats/levels.js – record parser
- src/game/level.js – filename copies and rosterInit
- src/game/sound.js – selector use
- 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!)