The .RDT file format is used to stored the description of a room in Resident Evil 3. It should contain the camera position (to correctly display 3D objects), the background images and sprites used to draw the scene, description of when to change camera, position of enemies when entering room, and so on...
Structure
The structure is the same as the one for Resident Evil 2 .RDT. However there are some differences, listed below.
Offset 6 (*.SCA)
The header is 16 bytes.
typedef struct {
unsigned long Amount;
unsigned long unknown0[3];
} rdt_offset6_t;
Immediately following is an array of elements which contain attributes for each collision. Subtract 1 from Amount for the real total.
typedef struct {
signed short int X1;
signed short int Z1;
signed short int X2;
signed short int Z2;
unsigned short unknown[4];
} rdt_offset6elt_t;
rdt_offset6elt_t Collision[Amount-1];
Offset 16, initialization script
This is the initialization script for the room. It starts with an array of unsigned short, giving offset to each function of the script. Thus, the first offset listed / 2 gives you the number of functions in the script. Then follows the script, in bytecode-style.
0x00-0x0f
Byte
Instruction
Length
Description
0x00
Nop
1
0x01
Return
2
Exit current function
0x02
Sleep 1
1
Sleep for 1 game tick.
0x03
EVT_CHAIN
2
0x04
EVT_EXEC
4
Execute an instruction when a precise event occurs.
typedef struct {
unsigned char opcode; /* 0x04 */
unsigned char event;
unsigned short instruction; /* Most likely a function call, 0x19xx */
} script_evt_exec_t;
Note: it's either If/Endif, or If/Else; there is no If/Else/Endif sequence.
0x08
EndIf
2
0x09
Sleep
1
0x0a
Sleeping
3
Sleep for N game ticks
typedef struct {
unsigned char opcode; /* 0x0a */
unsigned char ticks; /* Number of game ticks to sleep */
unsigned char unknown;
} script_sleep_t;
0x0b
SleepW
1
0x0c
SleepingW
1
0x0d
For
6
typedef struct {
unsigned char opcode; /* 0x0d */
unsigned char dummy;
unsigned short block_length;
unsigned short count; /* Number of times to execute the loop */
} script_for_t;
This structure is followed by one or several conditions for the while (condition) instruction. Any condition evaluated to false will end the while () block.
This structure is followed by one or several conditions for the do { } while (condition) instruction. Any condition evaluated to false will end the while () block.
typedef struct {
unsigned char opcode; /* 0x63 */
unsigned char event_type;
unsigned char event_flag;
unsigned char unknown0[3];
short x,y,w,h;
short unknown1[3]; /* unknown1[1] can be result of calling a function */
} script_aot_set_t;