Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
trs:cutseq [2017/02/02 19:56] – ↷ Page moved from opentomb:trs:cutseq to trs:cutseq stohrendorftrs:cutseq [2017/11/17 11:21] (current) stohrendorf
Line 1: Line 1:
 +{{indexmenu_n>12}}
 +
 ====== CUTSEQ file format (TR4-TR5) ====== ====== CUTSEQ file format (TR4-TR5) ======
 +
 +//Original reverse-engineering work by sapper//
  
 ===== Overview ===== ===== 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 [[opentomb:trs:pak|PAK file]], and the resulting file is called ''%%CUTSEQ.PAK%%''. In TR5, like many other things (e.g. level files), the file is not compressed, and is called ''%%CUTSEQ.BIN%%''.+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 [[trs:pak|PAK file]], and the resulting file is called ''%%CUTSEQ.PAK%%''. In TR5, like many other things (e.g. level files), the file is not compressed, and is called ''%%CUTSEQ.BIN%%''.
  
 ===== Layout ===== ===== Layout =====
  
 <code cpp> <code cpp>
-struct cutseq+struct Cutseq 
 +
 +    uint8_t header[8]; // "(C) DEL!", for Derek Leigh-Gilchrist 
 +    CutsceneHeader cutscenes[N]; // N = 30 for TR4, 44 for TR5, 4 for Times Demo 
 +    uint8_t padding[]; // Empty space between header and data 
 +    uint8_t cutsceneData[]; 
 +
 + 
 +struct CutsceneHeader // 8 bytes 
 +
 +    uint32_t offset; // Offset relative to start of file 
 +    uint32_t size; // Size in bytes 
 +
 + 
 +struct CutsceneData 
 +
 +    uint16_t numActors; // Actor 1 is always Lara (slot ID 0) 
 +    uint16_t numFrames; 
 +    int32_t originX; // Origin coordinates are in TR world coordinates 
 +    int32_t originY; // Negative Y is up 
 +    int32_t originZ; 
 +    int32_t audioTrackIndex; // -1 means no audio track 
 +    uint32_t cameraDataOffset; 
 +    ActorSlotHeader actors[numActors]; 
 +    CameraData cameraData; 
 +    uint8_t padding[]; 
 +    uint8_t actorData[]; 
 +    uint8_t padding[]; 
 +
 + 
 +struct ActorSlotHeader // 8 bytes 
 +
 +    uint32_t dataOffset; 
 +    uint16_t slotNumber; // TR model slot ID number 
 +    uint16_t numNodes; // Same as number of meshes in model 
 +
 + 
 +struct CameraData 
 +
 +    PositionHeader targetHeader; 
 +    PositionHeader cameraHeader; 
 +    PackedCoord targetPosition; 
 +    PackedCoord cameraPosition; 
 +
 + 
 +struct ActorData 
 +
 +    MeshHeader meshes[NumNodes]; 
 +    MeshData meshData[NumNodes]; 
 +
 + 
 +struct MeshData 
 +
 +    PackedCoord positionData; 
 +    PackedCoord rotationData; 
 +
 + 
 +struct PositionHeader // 14 bytes 
 +
 +     int16_t startX; 
 +     int16_t startY; 
 +     int16_t startZ; 
 +    uint16_t axisBitsizes; // X = bits 14-11, Y = 9-6, Z = 4-1 
 +    uint16_t numValuesX; 
 +    uint16_t numValuesY; 
 +    uint16_t numValuesZ; 
 +
 + 
 +struct RotationHeader // 14 bytes 
 +
 +    // 1024 = 360 degrees 
 +    int16_t startX; 
 +    int16_t startY; 
 +    int16_t startZ; 
 +    uint16_t axisBitsizes; // X = bits 14-11, Y = 9-6, Z = 4-1 
 +    uint16_t numValuesX; 
 +    uint16_t numValuesY; 
 +    uint16_t numValuesZ; 
 +
 + 
 +struct PackedCoord // (variable length)
 { {
-            uint8_t DEL[8]; // "(C) DEL!", for Derek Leigh-Gilchrist +    dynamic xAxis; // todo: explain better 
-    cutscene_header Cutscenes[N]; // N = 30 for TR4, 44 for TR5, 4 for Times Demo +    dynamic yAxis; // core design, why did you make this 
-            uint8_t Padding[]; // Empty space between header and data +    dynamic zAxis;
-            uint8_t CutsceneData[]; +
-     +
-    struct cutscene_header // 8 bytes +
-    { +
-        uint32_t Offset; // Offset relative to start of file +
-        uint32_t Size; // Size in bytes +
-    } +
-     +
-    struct cutscene_data +
-    { +
-                 uint16_t NumActors; // Actor 1 is always Lara (slot ID 0) +
-                 uint16_t NumFrames; +
-                  int32_t OriginX; // Origin coordinates are in TR world coordinates +
-                  int32_t OriginY; // Negative Y is up +
-                  int32_t OriginZ; +
-                  int32_t AudioTrackIndex; // -1 means no audio track +
-                 uint32_t CameraDataOffset; +
-        actor_slot_header Actors[NumActors]; +
-              camera_data CameraData; +
-                  uint8_t Padding[]; +
-                  uint8_t ActorData[]; +
-                  uint8_t Padding[]; +
-    } +
-     +
-    struct actor_slot_header // 8 bytes +
-    { +
-        uint32_t DataOffset; +
-        uint16_t SlotNumber; // TR model slot ID number +
-        uint16_t NumNodes; // Same as number of meshes in model +
-    } +
-     +
-    struct camera_data +
-    { +
-        position_header TargetHeader; +
-        position_header CameraHeader; +
-           packed_coord TargetPosition; +
-           packed_coord CameraPosition; +
-    } +
-     +
-    struct actor_data +
-    { +
-        mesh_header Meshes[NumNodes]; +
-          mesh_data MeshData[NumNodes]; +
-    } +
-     +
-    struct mesh_data +
-    { +
-        packed_coord PositionData; +
-        packed_coord RotationData; +
-    } +
-     +
-    struct position_header // 14 bytes +
-    { +
-         int16_t StartX; +
-         int16_t StartY; +
-         int16_t StartZ; +
-        uint16_t AxisBitsizes; // X = bits 14-11, Y = 9-6, Z = 4-1 +
-        uint16_t NumValuesX; +
-        uint16_t NumValuesY; +
-        uint16_t NumValuesZ; +
-    } +
-     +
-    struct rotation_header // 14 bytes +
-    { +
-         // 1024 = 360 degrees +
-         int16_t StartX; +
-         int16_t StartY; +
-         int16_t StartZ; +
-        uint16_t AxisBitsizes; // X = bits 14-11, Y = 9-6, Z = 4-1 +
-        uint16_t NumValuesX; +
-        uint16_t NumValuesY; +
-        uint16_t NumValuesZ; +
-    } +
-     +
-    struct packed_coord // (variable length) +
-    { +
-        dynamic Xaxis; // todo: explain better +
-        dynamic Yaxis; // core design, why did you make this +
-        dynamic Zaxis; +
-    }+
 } }
 </code> </code>
trs/cutseq.1486065395.txt.gz · Last modified: 2017/02/02 19:56 by stohrendorf
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0