Skip to content

.PLD (Resident Evil 3)

Patrice Mandin edited this page Aug 23, 2021 · 4 revisions

Table of Contents

Games

The .PLD and .PLW file format are used by Resident Evil 3. It contains data related to player model, and follows same structure as .EMD files. The difference is the number of sections, and the extra .TIM file.

Structure

The values are stored in Little-Endian order.

Directory

See .EMD file, directory.

File/section 0, animation steps

This section starts with this header, a certain number of records composed of count and offsets.

pld_anim_header_t pld_anim_header[];

Following this array, you'll find another array of 2-bytes elements. Each value (animation frame number?) is an index in pld_sec2_data array in the skeleton section.

unsigned char pld_anim_skel_t[];    /* Number of frame to display for flags */
unsigned char unknown;              /* flag? */

Then you'll finally find the 'unsigned long' byte length of the section.

unsigned long length;

File/section 1, skeleton

This section starts with a header:

typedef struct {
    unsigned short relpos_offset;/* Relative offset to pld_sec2_relpos[] array */
    unsigned short length; /* Relative offset to emd_sec2_data[] array, which is also length of relpos+armature+mesh numbers  */
    unsigned short count; /* Number of objects in relpos,data2,mesh arrays? */
    unsigned short size; /* Size of each element in pld_sec2_data[] array */
} pld_sec2_header_t;

If offset is more than 8, there are some extra stuff, namely data1,data2 and mesh arrays.

typedef struct {
    unsigned short mesh_count; /* Number of meshes linked to this one */
    unsigned short offset; /* Relative offset to mesh numbers (pld_sec2_mesh[] array) */
} pld_sec2_armature_t;

pld_sec2_relpos_t pld_sec2_relpos[count];
pld_sec2_armature_t pld_sec2_armature[count];
unsigned char pld_sec2_mesh[count]; /* Mesh number on which to apply relative position */

Finally an array of elements which have a size of 76 bytes each.

typedef struct {
	short x_speed;  	/* speed at which moving the model */
	short y_speed;
	short z_speed;

	short y_offset;  	/* distance from reference point */

	char angles[68];	/* angle for each bone/model around x,y,z axis */
				/* Note: they are stored as 12 bits value, so you need to split bytes */
} pld_sec2_data_t;

pld_sec2_data_t pld_sec2_data[];

The 12bits values for angles are stored in the usual little endian order, you just need to split the bytes to get all needed bits. Here is some reference (for each skeleton mesh, you have 3 angles, x,y,z to apply on it):

XX	--XX	bits 7-0 of x angle for mesh # 0		
YX	-X--	bits 3-0: bits 11-8 of x angle for mesh # 0
	---Y	bits 7-4: bits 3-0 of y angle for mesh # 0
YY	-YY-	bits 11-4 of y angle for mesh # 0		
ZZ	--ZZ	bits 7-0 of z angle for mesh # 0
XZ	-Z--	bits 3-0: bits 11-8 of z angle for mesh # 0
	---X	bits 7-4: bits 3-0 of x angle for mesh # 1
XX	-XX-	bits 11-4 of x angle for mesh # 1
YY	--YY	bits 7-0 of y angle for mesh # 1
ZY	-Y--	bits 3-0: bits 11-8 of y angle for mesh # 1
	---Z	bits 7-4: bits 3-0 of z angle for mesh # 1	
ZZ	-ZZ-	bits 11-4 of z angle for mesh # 1
and so on ...
12 bits values mean the complete cycle is done with values from 0 to 4095.

File/section 2, meshes

See .EMD file, section 7.

File/section 3

Unknown.

File/section 4, texture

Embedded .TIM file.