<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://trwiki.earvillage.net/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>TRWiki - trs</title>
        <description></description>
        <link>https://trwiki.earvillage.net/</link>
        <lastBuildDate>Wed, 15 Apr 2026 20:34:24 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://trwiki.earvillage.net/lib/exe/fetch.php?media=wiki:dokuwiki-128.png</url>
            <title>TRWiki</title>
            <link>https://trwiki.earvillage.net/</link>
        </image>
        <item>
            <title>CUTSEQ file format (TR4-TR5)</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:cutseq&amp;rev=1510917688&amp;do=diff</link>
            <description>CUTSEQ file format (TR4-TR5)

Original reverse-engineering work by sapper

Overview

The CUTSEQ.BIN file is a file containing information about all the engine-rendered cutscenes (as opposite to FMVs, which are pre-rendered videos). In TR4, this file is compressed and contained in a</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 17 Nov 2017 11:21:28 +0000</pubDate>
        </item>
        <item>
            <title>Entire Level File Formats</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:file_formats&amp;rev=1619733238&amp;do=diff</link>
            <description>Entire Level File Formats

&lt;a id=&quot;level_format_tr1&quot;&gt;&lt;/a&gt;

TR1 Level Format

What follows is the physical .PHD and .TUB file layout, byte for byte.



uint32_t Version; // version (4 bytes)
uint32_t NumImages; // number of texture images (4 bytes)
tr_image8 Images8[NumImages]; // 8-bit (palettized) images (NumImages * 65536 bytes)
uint32_t Unused; // supposed to be the level number but TOM2PC didn&#039;t allow changing it, always 0 (4 bytes)
uint16_t NumRooms; // number of rooms (2 bytes)
tr_room Room…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 29 Apr 2021 21:53:58 +0000</pubDate>
        </item>
        <item>
            <title>FloorData</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:floordata&amp;rev=1589892680&amp;do=diff</link>
            <description>FloorData

Overview

The FloorData is the key part of the level structure, which defines almost everything related to “physical” world  — geometry, interaction and response of a level. While room geometry (see above) may be considered as a “face” of the level, $S_{Offset} = \frac{X_{current} - X_{room}}{1024} \cdot n_{Zsectors} + \frac{Z_{current} - Z_{room}}{1024}$$X_{current}$$Z_{current}$$X_{room}$$Z_{room}$$n_{Zsectors}$$H_{\triangle2}$$H_{\triangle1}$$H_{\triangle1}$$H_{\triangle2}$$\Delta …</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 19 May 2020 12:51:20 +0000</pubDate>
        </item>
        <item>
            <title>The Fundamentals</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:fundamentals&amp;rev=1589890581&amp;do=diff</link>
            <description>The Fundamentals

File Types

Tomb Raider is driven by various sets of files — level files, script files, FMVs, audio tracks and sound files. In TR4 and TR5, there is also specific file type which contains cutscene data — cutseq pack.

The Script Files

The script file structure differs from version to version.&lt;a id=&quot;basic_data_types&quot;&gt;&lt;/a&gt;$F_{real} = P_{whole} + ( P_{frac} \div 65536 )$$F_{real} = P_{whole} + ( P_{frac} \div 255 )$$P_{whole}$$P_{frac}$$n$$n$$X-Z$$Y$$-Y$$Y$$+X$$+Z$&lt;a id=&quot;tr_colou…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 19 May 2020 12:16:21 +0000</pubDate>
        </item>
        <item>
            <title>Engine limitations</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:limits&amp;rev=1565330954&amp;do=diff</link>
            <description>Engine limitations

A limit of “None” means that the field is only limited by its size (8-bit, 16-bit, etc.)

Any other limit means that the engine purposely checks that the value is less or equal than a hard-coded value.

The limits are inclusive.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 09 Aug 2019 06:09:14 +0000</pubDate>
        </item>
        <item>
            <title>Mesh Construction and Animation</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:mesh_construction_animation&amp;rev=1589891432&amp;do=diff</link>
            <description>Mesh Construction and Animation

Overview

The animated mesh objects in the Tomb Raider series are sets of meshes that are moved relative to each other, as defined by Entities[] entries. Each entry describes which meshes to be used (a contiguous set of them referred to in &lt;a id=&quot;tr_meshtree_node&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_animation&quot;&gt;&lt;/a&gt;$\text{NumFrames} = (\text{FrameEnd} - \text{FrameStart}) + 1$&lt;a id=&quot;tr4_animation&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_state_change&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_anim_dispatch&quot;&gt;&lt;/a&gt;&lt;a id=&quot;animcommand-structure…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 19 May 2020 12:30:32 +0000</pubDate>
        </item>
        <item>
            <title>Meshes and Models</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:meshes_models&amp;rev=1612886918&amp;do=diff</link>
            <description>Meshes and Models

Overview

Nearly all of the non-geographic visual elements in TR (as well as a few parts of the landscape) consist of as meshes. A mesh is simply a list of vertices and how they’re arranged. The mesh structure includes a list of vertices as relative coordinates (which allows meshes to easily be placed anywhere in the world geometry), a list of normals (to indicate which side of each face is visible), and lists of Rectangles and Triangles, both textured and coloured. The elemen…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 09 Feb 2021 16:08:38 +0000</pubDate>
        </item>
        <item>
            <title>Miscellany</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:miscellany&amp;rev=1607711216&amp;do=diff</link>
            <description>Miscellany

These are various odds and ends that do not fit into the earlier categories.

Version

Every level file begins with a uint32_t version number. This seems to be used by the engine to guarantee compatibility between various level editor versions and the game engine version. More generally, it can be used to determine what sort of level is being read.&lt;a id=&quot;tr_object_texture_vert&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_object_texture&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_object_texture&quot;&gt;&lt;/a&gt;&lt;a id=&quot;animated_textures&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_ca…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 11 Dec 2020 18:26:56 +0000</pubDate>
        </item>
        <item>
            <title>Mobile version structures</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:mobile&amp;rev=1497502865&amp;do=diff</link>
            <description>Mobile version structures

The mobile (Android, iOS) version, made by Realtech VR, uses some structures. Those were reverse-engineered by Gh0stBlade.

AWB file


struct AWBFile
{
    uint32_t unknown0;
    uint32_t numFiles;
    uint32_t unknown1;
    uint32_t unknown2;
    AWBEntry entries[numFiles];
}</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 15 Jun 2017 05:01:05 +0000</pubDate>
        </item>
        <item>
            <title>Non-Player Character Behaviour</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:npc_behaviour&amp;rev=1510917583&amp;do=diff</link>
            <description>Non-Player Character Behaviour

Overview

All the Tomb Raider game physics and entity behaviour is hardcoded, with each type ID being associated with some specific sort of behaviour (as Lara, as a boat, as a tiger, as a door, as a boulder, as a lock, etc.). That is, each model refer two internal engine routines — &lt;a id=&quot;Boxes&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_box&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr2_box&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_zone&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr2_zone&quot;&gt;&lt;/a&gt;&lt;a id=&quot;pathfinding-algorithm&quot;&gt;&lt;/a&gt;&lt;a id=&quot;ai-objects&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_ai_object&quot;&gt;&lt;/a&gt;…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 17 Nov 2017 11:19:43 +0000</pubDate>
        </item>
        <item>
            <title>PAK file format (TR4-TR5)</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:pak&amp;rev=1486065402&amp;do=diff</link>
            <description>PAK file format (TR4-TR5)

Overview

TR4 and TR5 use a file format with the extension PAK for certain files (mostly pictures). This file format is actually a container for raw binary content, compressed using zlib.

Layout


struct pak_file
{
    uint32_t UncompressedSize; // Uncompressed size of data (4 bytes)
    uint8_t CompressedData[]; // zlib-compressed data (read until EOF)
}</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 02 Feb 2017 19:56:42 +0000</pubDate>
        </item>
        <item>
            <title>TRLE .PRJ file format</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:prjfile&amp;rev=1565331065&amp;do=diff</link>
            <description>TRLE .PRJ file format

Entire format


uint8_t signature[8]; // &quot;PROJFILE&quot;
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) &lt;-- spa…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 09 Aug 2019 06:11:05 +0000</pubDate>
        </item>
        <item>
            <title>PSX versions</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:psx&amp;rev=1504035530&amp;do=diff</link>
            <description>PSX versions

The PSX versions of the game use different formats than the PC ones. Although the level files and the script files tend to stay consistent between platforms (including Dreamcast and others), some files are only present on console.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 29 Aug 2017 19:38:50 +0000</pubDate>
        </item>
        <item>
            <title>Room Geometry</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:room_geometry&amp;rev=1734115249&amp;do=diff</link>
            <description>Room Geometry

Overview

A room in TR2 is simply a rectangular three-dimensional area. A room may be “indoors” or “outdoors,” may or may not be enclosed, may be accessible or inaccessible to Lara, may or may not contain doors or objects.

All rooms have “portals,” called “doors” in some documentation, which are pathways to adjacent rooms. There are two kinds of portals — visibility portals and collisional portals. Visibility portals are for determining how much of a room (if any) is visible from…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 13 Dec 2024 18:40:49 +0000</pubDate>
        </item>
        <item>
            <title>Savegame format</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:savegame&amp;rev=1486226557&amp;do=diff</link>
            <description>Savegame format

This page describes the format used by classic TRs for the savegame.X files.
Although many savegame editors have been released for all TR versions, almost no public documentation about the format itself is available.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sat, 04 Feb 2017 16:42:37 +0000</pubDate>
        </item>
        <item>
            <title>Scripting in TR2/TR3 for PC/PSX</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:scripting_tr2_tr3&amp;rev=1735521811&amp;do=diff</link>
            <description>Scripting in TR2/TR3 for PC/PSX

Overview

The internal gameflow, which levels come in what order, what item(s) Lara has at the beginning of each level, the filenames of the level and cut-scene files, all the visible text (e.g. “Save Game,” “Rusty Key,” etc.), and various other options are controlled by a script file called &lt;a id=&quot;accents&quot;&gt;&lt;/a&gt;$\text{angle in degrees} \cdot 65536 / 360$$\text{blocks} \times 1024$&lt;a id=&quot;item_ids&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr2_ids&quot;&gt;&lt;/a&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 30 Dec 2024 01:23:31 +0000</pubDate>
        </item>
        <item>
            <title>Scripting in TR4 and TR5</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:scripting_tr4_tr5&amp;rev=1619732731&amp;do=diff</link>
            <description>Scripting in TR4 and TR5

In this chapter we will describe full gameflow script specification for TR4/TR5 script file (usually called SCRIPT.DAT) and language file, which contains all the strings used in game for specific language (e.g., ENGLISH.DAT&lt;a id=&quot;tr4_script_header&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_script_levelheader&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_script_levellisting&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_script_leveldata&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_script_opcodes&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_lang_header&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_lang_stringdata&quot;&gt;&lt;/a&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 29 Apr 2021 21:45:31 +0000</pubDate>
        </item>
        <item>
            <title>Music and Sound</title>
            <link>https://trwiki.earvillage.net/doku.php?id=trs:sound&amp;rev=1621633872&amp;do=diff</link>
            <description>Music and Sound

As it was described in the beginning, all sound in TR engines can be separated into two distinctive sections — audio tracks and sounds.

Audio tracks are long separate files which are loaded by streaming, and usually they contain background ambience, music or voiceovers for cutscenes.&lt;a id=&quot;audio_tracks&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr3_cdaudio_entry&quot;&gt;&lt;/a&gt;&lt;a id=&quot;sound_files&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr4_sample&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_sound_source&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr_sound_details&quot;&gt;&lt;/a&gt;&lt;a id=&quot;tr3_sound_details&quot;&gt;&lt;/a&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 21 May 2021 21:51:12 +0000</pubDate>
        </item>
    </channel>
</rss>
