Skip to content

DZR and DZS File Format (Overview)

Brandondorf9999 edited this page Mar 29, 2015 · 6 revisions

Header Format

The .dzs and .dzr format is composed of a header and then multiple chunks with differing data. The file header is only 4 bytes long and identifies how many chunks there are. The next section of the file is the chunk headers which have the format as follows:

FileHeader - (0x4/4 Bytes in Length)

  • 0x0: NumChunks (UInt32)

ChunkHeader - (0xC/12 Bytes in Length)

  • 0x0: Tag - ASCII (4 bytes)
  • 0x4: ElementCount (UInt32)
  • 0x8: Offset (From start of File) (UInt32)

Known List of Chunks:

  • 2DMA - Onscreen Mini-Map Properties
  • ACTR - Actor Info
  • AROB - Camera waypoint, like RARO
  • CAMR - Sets a camera behavior for certain events and points to a RARO or AROB entry if needed
  • Colo - Part of Environment Lighting
  • DMAP - Dungeon Map Properties
  • EnvR - Part of Environment Lighting
  • Evnt - Worldspace Events
  • FILI - Room Properties
  • FLOR - Floor definitions for multi-floor worldspaces
  • LGHT - Interior Lightsource
  • LBNK - Padding?
  • MECO - Assigns rooms to an entry in MEMA
  • MEMA - Gives a room the amount of free memory specified by the entry indexed in MECO
  • MULT - Room model X/Z translation
  • PATH - Waypoint series definition
  • PLYR - Player Spawn Points
  • Pale - Part of Environment Lighting
  • PPNT - Path Waypoint Coordinates
  • RARO - Camera Reference Point for Event_List.dat - Identical in structure to AROB
  • RCAM - Sets camera behavior
  • RPAT - Waypoint Series Definition
  • RPPN - Path Waypoint Coordinates
  • RTBL - Defines what rooms are loaded from the room the player is currently in
  • SCLS - Exit List
  • SCOB - Environmental Actors (ie: Light)
  • SHIP - King of Red Lions spawn points.
  • SOND - Ambient Sound Settings
  • STAG - Worldspace Properties
  • TGDR - Doors
  • TGOB - Another Actor info (eg: Dragon Roost Cavern staircase)
  • TRES - Treasure Chests
  • Virt - Part of Environment Lighting
  • LGTV - Assumed to be an interior light source; shares the same structure as LGHT

Chunk Formats

###STAG Room Properties (0x14/20 Bytes in Length)

  • 0x00 float depthMin;
  • 0x04 float depthMax;
  • 0x08 int16 keyCounterDisplay; //has different values. For different settings?
  • 0x0A int16 loadedParticleBank; //particle bank to load for the worldspace. Method of IDing a certain particle bank is currently unknown.
  • 0x0C int16 itemUsageAndMinimap; //items Link can use, what color the mini-map's background is
  • 0x0E int8 padding;
  • 0x0F int8 unknown1;
  • 0x10 int8 unknown2; //RGB data? Nothing seems to change when these are changed
  • 0x11 int8 unknown3;
  • 0x12 int16 drawRange;

###RTBL Unfinished. See the RTBL Wiki Entry for the most up to date information.

###SCLS Exit List (0xC/12 Bytes in Length)

  • 0x0: Folder of Destination Map in ASCII (0x8/8 bytes) (ie: "kaze")
  • 0x8: Spawn Point # (byte)
  • 0x9: Room Number (in hex?) (byte)
  • 0xA: Exit Type (door, upwards teleport, etc.)
  • 0xB: Padding? 0xFF

###ACTR Actor definitions (0x20/32 Bytes in Length)

  • 0x00: string Name //0x8/8 bytes total space
  • 0x08: int8 unknown1;
  • 0x09: int8 rpatIndex;
  • 0x0A: int8 unknown2;
  • 0x0B: int8 behaviorType;
  • 0x0C: float xPos
  • 0x10: float yPos
  • 0x14: float zPos
  • 0x18: float xRot
  • 0x1A: float yRot
  • 0x1C: float zRot
  • 0x1E: int16 enemyNumber; //Purpose unknown. Enemies are given a number here based on their position in the actor list

PLYR Chunks and TRES (Treasure) Chunks appear to be similar.

###EVNT Event Format - (0x18/24 Bytes in Length)

  • 0x0: Unknown (byte) - Mostly 0xFF
  • 0x1: Event Name (see /stage/dat/event_list.dat) (0xF/15 Bytes long)
  • 0x10: Unknown (byte)
  • 0x11: Unknown (byte)
  • 0x12: Unknown (byte)
  • 0x13: Unknown (byte)
  • 0x14: Room Number (byte) - Matches in file names, (ie: Room44.arc) - not always set
  • 0x15: Unknown (3 bytes) - Padding? Often 0xFFFFFF

###RARO and AROB### These two chunks share identical layouts. They seem to call identical functions within Windwaker's executable. They look to be identical other than in name.

Usage: RARO is apparently used by the Event_List.dat as a Camera Reference Point. Camera moves to the position specified for events.

Event Format - (0x14/20 Bytes in Length)

  • 0x0: Pos X (float)
  • 0x4: Pos Y (float)
  • 0x8: Poz Z (float)
  • 0xC: Unknown (0x8/8 bytes) - Always "00 00 80 00 00 00 FF FF";

###LGHT### This chunk appears to be indoor lighting (to affect shading on character model). Chunk length is assumed due to not enough test cases to be entirely assured. 95% likelyhood this is correct.

Light Format - (0x1C/28 Bytes in Length (assumed))

  • 0x0: Pos X (float)
  • 0x4: Pos Y (float)
  • 0x8: Poz Z (float)
  • 0xC: Scale/Intensity (float)
  • 0x10: Scale/Intensity (float)
  • 0x14: Scale/Intensity (float)
  • 0x18: R (byte)
  • 0x19: G (byte)
  • 0x1A: B (byte)
  • 0x1B: Unknown (byte) - Presumably padding, 0x00.

###MULT### This is used by the Stage to translate rooms. Only used on two maps in the game that I'm aware of.

Mult Format - (0xC/12 Bytes in Length)

  • 0x0: Translation X (float)
  • 0x4: Translation Z (float)
  • 0x8: Rotation on Y axis (short)
  • 0xA: Room number (byte)
  • 0xB: Unknown (byte)

###RPPN### Some form of waypoints for pathing.

Rppn Format - (0x10/16 Bytes in Length)

  • 0x0: Unknown (4 bytes in length)
  • 0x4: Pos X (float)
  • 0x8: Pos Y (float)
  • 0xC: Pos Z (float)

###SHIP### Spawn points for the King of Red Lions

Ship Format - (0x10/16 bytes in Length)

  • 0x0: Pos X (float)
  • 0x4: Pos Y (float)
  • 0x8: Pos Z (float)
  • 0xC: Unknown

###EnvR, Colo, Pale, Virt### All of these chunks have to do with environmental lighting. They have their own Wiki articles [here](https://github.com/pho/WindViewer/wiki/DZS-Format:-EnvR,-Colo,-Pale,-and-Virt-Chunks-(Elaborated) which I am too lazy to reformat into this list.

###TRES### Treasure! Well, treasure chests. That's basically the same thing right?

Tres Format - (1C/28 Bytes in Length)

  • 0x0: Name in ASCII. Usually "takara". (0x8 bytes + null terminator = 0x9 total)
  • 0x9: Chest Type (big key, common wooden, etc.) - (Short)
  • 0xB: X Pos (float)
  • 0xF: Y Pos (float)
  • 0x13: Z Pos (float)
  • 0x17: Unknown (short)
  • 0x19: Rotation on Y Axis (short)
  • 0x1B: Chest Contents (Rupees, Hookshot, Power bracelets, etc.) (Byte)

###2DMA### Theoretically related to the Minimap. Some Stages have entries which are all zeros. Looks like a lot of single-byte values. Thoughts: Maybe its minimap offset/rotation? Doesn't seem to be tied to #rooms. M_NewD2_Stage has two entries, others tested (Kaze_Stage, Orich_Stage) have one. Maybe it's related to Tingle Tuner and the gameboy? Maybe it's related to the in-game sea-chart map and not the minimap? Either way, looks like you can shove it full of zeros and the game likes that so...

2DMa Format - (0x10/16 Bytes in Length)

  • 0x0: Unknown (0x4 Bytes)
  • 0x4: Unknown (0x8 Bytes?)
  • 0xC: Unknown (0x4 Bytes)

###MEMA### Unknown. May be related to the function: "GetMemoryMap"

MEMA Format - (0x4 bytes length)

  • 0x0: Unknown

###MECO### Unknown. May be related to the function: "GetMemoryConfig"

MECO Format - (0x2 bytes in Length)

  • 0x0: Index (?) Ordered from 00 to Num-of-entries
  • 0x1: ???

##RCAM & CAMR## Seems to correspond to camera behavior. ASCII name of behaviors match up with strings inside the executable. Both RCAM and CAMR have identical layouts and call the same code within the executable.

RCam Format - (0x14/20 Bytes in Length)

  • 0x0: CameraType (ASCII String) (0x10/16 Bytes)
  • 0x16: Null Terminator (4 bytes, pattern: 00 FF FF FF)

Possible CameraType Values (Untested): Field, Dungeon, Plain, DungeonDown, DungeonUp, DungeonCorner, Jump, DungeonWide, Room, FieldCushion, OverLook, Corridor, Subject, DungeonPassage, Cliff, Cliff2, MajTower, Boss01, Boss02, Gamoss, MiniIsland, Amoss, Cafe, P_Ganon1, P_Ganon2, WindBoss, P_Ganon3, G_BedRoom, G_Roof, G_BedRoom2, Boss04, WindHall, BigBird, DStairs.

Clone this wiki locally