Daggerfall Mod:BLOCKS.BSA/Dungeon Block Records

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

Dungeon Block Records contain the block data for dungeons. Each Dungeon Block Record describes one dungeon block, which fits into a two-dimensional grid with the other blocks of the dungeon. There are two connecting passages in each of the four cardinal directions, so there are eight paths leading out of each block. The architecture of the block, the doors, various action scripts and light sources, etc are all described here.

Each Dungeon Block Record begins with a letter and is followed by a 7-digit decimal integer. The name of Dungeon Block Records all terminate with the string ".RDB". E.g., "N0000019.RDB". These files are referenced in the dungeon records of MAPS.BSA.

General Format[edit]

Dungeon Block Record coarse structure
RdbHeader
ModelReferenceList
ModelDataList
ObjectSection

RdbHeader[edit]

Each Dungeon Block Record begins with a 20 byte long Header structure.

Offset Type Name Description
0-3 UInt32 Unknown1 Unknown Purpose.
4-7 UInt32 Width The width of the dungeon.
8-11 UInt32 Height The height of the dungeon.
12-15 UInt32 ObjectRootOffset The offset from the beginning of the Dungeon Block Record to the ObjectRoot section.
16-19 UInt32 Unknown2 Unknown Purpose.

ModelReferenceList[edit]

Following the Header structure, is a contiguous list of 750 ModelReference structures. This list must always be 750 elements long. Unused elements are filled with 0xff. Each element of the ModelReferenceList refers to an ARCH3D.BSA record via the ModelId field.

ModelReference structure
Offset Type Name Description
0-4 7-bit ASCII string ModelId The RecordId of the ARCH3D.BSA record, as a five character string. This is not null-terminated.
5-7 7-bit ASCII string Description A short string describing the object. This is not null-terminated.

ModelDataList[edit]

Next is a contiguous list of 750 records, each 4 bytes long. They seem to correspond to the elements of the ModelReferenceList. The format of these bytes is unknown. Unused records are filled with 0x00.

ObjectSection[edit]

The ObjectSection is a variably sized section containing a fixed-size header, a list of offsets to the Object structures, the Object structures, and any additional data such as Action structures.

ObjectSection coarse structure
ObjectHeader
ObjectRootList
ObjectList

ObjectHeader[edit]

ObjectHeader structure
Offset Type Name Description
0-3 UInt32 UnknownOffset An offset from the beginning of the RDB file to a linked list of unknown purpose and format.
4-7 UInt32 Unknown1 Unknown Purpose.
8-11 UInt32 Unknown2 Unknown Purpose.
12-15 UInt32 Unknown3 Unknown Purpose.
16-19 UInt32 FileSize The length of the Dungeon Block Record, in bytes.
20-51 UInt8[ 32 ] Unknown4 Seem to always be 0xFF
52-55 7-bit ASCII string Dagr Seem to always be the string "DAGR", except in records N0000021.RDB, N0000041.RDB, N0000070.RDB, W0000006.RDB, S0000021.RDB, S0000141.RDB, S0000202.RDB, and S0000203.RDB.
56-511 UInt8[ 456 ] Unknown5 Seem to be 0xFF

ObjectRootList[edit]

This section is a contiguous list of Int32 values, RdbHeader.Width * RdbHeader.Height elements in count. Each entry is an offset to an Object structure. All offsets are relative from the beginning of the Dungeon Block Record. Negative values indicate no record is present. The meaning of the grid layout is unknown.

ObjectList[edit]

Following the ObjectRootList is a contiguous list of Object structures, in no particular order. Each Object structure is a node of a doubly linked list. Use the Object Roots Section to find the heads of the lists, and iterate using the Next and Previous fields of each head, to load the Object structures.

Object structure
Offset Type Name Description
0-3 Int32 Next The offset from the beginning of the Dungeon Block Record to the next Object structure. A negative value indicates there are no more items.
0-7 Int32 Previous The offset from the beginning of the Dungeon Block Record to the previous Object structure. A negative value indicates there are no previous items.
8-19 Point Position The Object's position in the scene.
20 ObjectType Type The specific type of the Object. See ObjectType enumeration below.
21-24 UInt32 Offset The offset from the beginning of the Dungeon Block Record to the Object's Type-specific data.

ObjectType[edit]

Each specific type must be decoded differently (see tables below), based on the Type field, according to the ObjectType enumeration below. The location of this data is reported by the Offset field.

ObjectType enumeration
Value Name Function
0x01 Model A 3D model
0x02 LightSource A light source
0x03 Flat A Flat (including markers, junk, and monsters)

Type-Specific Structures[edit]

At the location specified by the Object's Offset field, the object's type-specific data is found. Each of the three types must be decoded differently, but each is of a fixed size. The format is reported by the Object's Type field.

Model[edit]
Model structure
Offset Type Name Description
0-11 Point Rotation The rotation angles about each axis, in Daggerfall Angles.
12-13 UInt16 ModelIndex A valid ModelReferenceList index which this Model describes.
14-17 UInt32 TriggerFlag_StartingLock Sets the door's lock level and Trigger flag in a range from 0-240. 0 means no lock. 240 means magically locked and can only be unlocked by an Action.
18 UInt8 SoundIndex ID of sound to play when action is executed. Also used for spell and text index.
19-22 Int32 ActionOffset Offset from the beginning of the Dungeon Block Record to an ActionRecord, which contains additional information about how this object behaves. Negative values indicate no such ActionRecord exists for this object.
LightSource[edit]
LightSource structure
Offset Type Name Description
0-3 UInt32 Unknown1 Unknown Purpose.
4-7 UInt32 Unknown2 Unknown Purpose.
8-9 UInt16 Unknown3 Unknown Purpose.

These values presumably control the color, intensity, and possibly range of the emitted light.

Flat[edit]
Flat structure
Offset Type Name Description
0-1 Texture Texture The texture to use for the flat/NPC.
2-3 Gender Gender The gender of the flat/NPC. See Gender enumeration below.
4-5 UInt16 FactionId The faction of the flat/NPC. For vaild FactionIDs see here.
6-10 UInt8[ 5 ] Unknown Unknown Purpose.
Gender enumeration
Value Function
0x1200 Male
0x3200 Female

ActionList[edit]

Models may reference an Action structure via their ActionOffset field. The target object (and the target object of its action, etc.) is activated simultaneously with the source object. In this way targets can be chained together for several simultaneous effects.

Action structure
0-4 UInt8[ 5 ] Data See ActionData structure below.
5-8 Int32 TargetOffset The offset from the beginning of the RDB file to the Object structure describing this action's target, or a negative value if there is no target.
9 ActionType Type Affects how the Data field is interpreted. See enumeration below.

ActionType[edit]

Observed ActionType values
Value Function
0x00 None
0x01 Translation
0x02 Unknown Purpose
0x04 Unknown Purpose
0x08 Rotation
0x09 Translation with Rotation
0x0b Unknown Purpose
0x0c Unknown Purpose
0x0e Teleport to the linked flat
0x10 Unknown Purpose
0x11 Unknown Purpose
0x12 Unknown Purpose
0x14 Unknown Purpose
0x15 Unknown Purpose
0x16 Unknown Purpose
0x17 Unknown Purpose
0x18 Unknown Purpose
0x19 Unknown Purpose
0x1c Unknown Purpose
0x1e Appears to be general "activate/use".
0x1f Unknown Purpose
0x20 Unknown Purpose
0x32 Unknown Purpose
0x63 Unknown Purpose
0x64 Unknown Purpose

ActionData[edit]

Rotation and Translation actions format the Action.Data field in this way:

ActionData structure
Offset Type Name Description
0 Axis Axis The specific axis about which the object should rotate. Values range from 1 to 99, but see Axis enumeration below for most common values.
1-2 UInt16 Duration Determines how long the object takes to reach its destination.
3-4 UInt16 Magnitude The amount to move along/around the specified axis.

Axis[edit]

Axis enumeration
Value Function
0x01 Negative X
0x02 Positive X
0x03 Negative Y
0x04 Positive Y
0x05 Negative Z
0x06 Positive Z

Rotations rotate about the Axis while translations move along them.

Doors do not appear to use the Action Record. It is not known whether teleporting walls use it. Switches, levers, and moving platforms appear to use it.

For example, in Privateer's Hold there is a switch next to a platform with a throne on it. Flipping the switch invokes the switch's action, which rotates it into the flipped position. That action targets the platform, which makes it rise. The platform's action targets the throne, which also rises. All these are performed simultaneously.