User:Gamma/DZR and DZS
DZR and DZS files contain The Wind Waker's entity data. This includes actors (such as NPCs and enemies), exits, lighting, waypoints, paths, and several other things. DZR files are specific to individual rooms of a worldspace, while DZS files contain entity data that applies to all of the rooms within a worldspace. However, they share the same format.
Header Format
The integer at 0x00 in a DZR or DZS file is a count of all of the chunks contained within the file. Starting at 0x04 are the chunk headers, which are described here:
Size: 0x0C bytes
Offset | Field Description |
---|---|
0x00 | string chunkType |
0x04 | int chunkElementCount |
0x08 | int chunkElementsOffset |
Each chunk has a chunk type that describes what the chunk does and how its chunk elements are formatted. The first chunk element is located at chunkElementsOffset within the file.
Chunk Element Formats
It is not common that different chunks share exactly the same element format, though there are cases where they are similar. This section will describe the data layout of each of the chunks' elements.
2DMA
(To-do)
ACTR
The ACTR chunk deals with actors within a map, such as enemies, NPCs, pots, grass, flowers, and switches.
Size: 0x20 bytes
Offset | Field Description |
---|---|
0x00 | string name |
0x08 | byte param1 |
0x09 | byte param2 |
0x0A | byte param3 |
0x0B | byte param4 |
0x0C | float xPosition |
0x10 | float yPosition |
0x14 | float zPosition |
0x18 | short xRotation |
0x1A | short yRotation |
0x1C | short killFlag |
0x2E | short enemyNumber |
name is the identifier that the game uses to know what the actor that should be loaded is. The four parameter bytes can be for different variables depending on the actor; they could be behaviors, switch IDs, path IDs, and more. killflag is a flag that is set when the actor is killed; this may only be applicable to enemies. enemyNumber is a short value that increments with every enemy in the actor chunk. It is sometimes set to null (0xFF) even for enemies, so the purpose of this value isn't known.