Table of Contents

TRLE .PRJ file format

Entire format

uint8_t signature[8]; // "PROJFILE"
uint32_t version; // Version of RoomEdit (49/0x31 for standard TRLE, 51/0x33 for leaked TR5 RoomEdit)
 
uint32_t numRooms;
PRJ_Room rooms[numRooms]; // variable size
 
uint32_t numObjects;
uint32_t maxObjects;
uint32_t unusedObjects[2000];
 
uint32_t numLights;
uint32_t unusedLights[768];
 
uint32_t numTriggers;
uint32_t unusedTriggers[512];
 
uint8_t textureFile[]; // ASCII-encoded string, terminated by a space (0x20) <-- space NOT included in the string, just skip it and continue reading
 
#if TextureFile != "NA"
uint32_t numTextInfo;
PRJ_TextInfo textInfo[numTextInfo];
#endif
 
uint8_t objectFile[]; // ASCII string terminated by a non-included space, as above with textureFile
 
uint32_t numObjectData;
PRJ_ObjectData objectData[numObjectData];
 
uint32_t numAnimTextures;
uint32_t unusedAnimTextures[40];
uint32_t animTextures[256];
PRJ_AnimText animRanges[40];
 
uint8_t terrain[256];
uint8_t bump[256];

Terrain items can be one of the following values:

Bump items can be one of the following values:

Structures

not in order, todo

Texture info

struct PRJ_TextInfo // 8 bytes
{
    uint8_t x;
    uint8_t y;
    uint16_t atlas;
    uint8_t flipX;
    uint8_t xSize;
    uint8_t flipY;
    uint8_t ySize;
}

Animation range

struct PRJ_AnimText // 12 bytes
{
    uint32_t defined;     // 0 = animation range not used, 1 = being used
    uint32_t firstAtlas;   // atlas number of the first atlas in the animation range
    uint32_t lastAtlas;    // atlas number of the last atlas in the animation range
}

32-bit color

struct PRJ_Color4 // 4 bytes
{
    uint32_t red;
    uint32_t green;
    uint32_t blue;
    uint32_t alpha;
}

Camera

struct PRJ_Camera // 40 bytes
{
    uint16_t xPos;
    uint16_t zPos;
    int32_t unknown1;
    int32_t yPos;
    int8_t fov;
    int8_t camID;
    int32_t timer;
    int32_t worldZpos;
    int32_t worldYpos;
    int32_t worldXpos;
    int16_t xRot;
    int16_t yRot;
    int16_t zRot;    // roll
    int16_t speed;   // speed * 655
    int16_t flags;   // the buttons 0-15 in the camera settings
}

Sink

struct PRJ_Sink
{
    int16_t xPos;
    int16_t zPos;
    int16_t xSize;
    int16_t zSize;
    uint16_t yPos;
    uint16_t room;
    uint16_t slot;
    uint16_t timer;
    PRJObjectOrientation orientation;
    int32_t worldZpos;
    int32_t worldYpos;
    int32_t worldXpos;
}