EvilEngine/CSN: Difference between revisions

Add JDTM, MorphTarget and other small fixes
m (3 more hashes)
(Add JDTM, MorphTarget and other small fixes)
 
Line 10:
{{AutoAssetInfobox}}
 
==Format: Header==
Because cutscenes can be quite big in size, they are loaded in chunks into RAM and therefore are 0x800aligned bytesto aligned2048/800h byte boundary.
 
==Format==
Because cutscenes can be quite big in size, they are loaded in chunks into RAM and therefore are 0x800 bytes aligned.
 
===Header===
CSN starts with a header, which is also present in the [[CTOC]] asset (without padding bytes).
 
Line 24 ⟶ 22:
|-
| 0x00 || u32 || '''Magic''' ||
* '''CTSN''' (Xbox/PlayStation 2), (little-endian)
* '''NSTC''' (GameCube), (big-endian)
|-
| 0x04 || [[AssetID]] || '''AssetID''' || AssetID of CSN.
Line 31 ⟶ 29:
| 0x08 || u32 || '''NumData''' || Amount of '''xCutsceneData''' entries.
|-
| 0x0C || u32 || '''NumTime''' || Amount of '''xCutsceneTime''' entries. Last offset is end of file and not counted into this.
|-
| 0x10 || u32 || '''MaxModel''' || Largest model in bytes (+padding) in xCutsceneData[[#Models|Models]].
|-
| 0x14 || u32 || '''MaxBufEven''' || Largest timechunk with an even ChunkIndex in bytes (+padding), usually the first one.
|-
| 0x18 || u32 || '''MaxBufOdd''' || Largest timechunk with an odd ChunkIndex in bytes (+padding).
|-
| 0x1C || u32 || '''HeaderSize''' || Size of header.
|-
| 0x20 || u32 || '''VisCount''' || Amount of '''visibilityVisibility''' entries.
|-
| 0x24 || u32 || '''VisSize''' || Total size of all visibility entries, measured in 4-byte steps. To determine the number of entries within the 2D array (columns), divide this by '''visibilityVisCount''' entries.
|-
| 0x28 || u32 || '''BreakCount''' || Amount of '''xCutsceneBreak''' entries.
Line 76 ⟶ 74:
|}
 
====xCutsceneData[]====
If ChunkSize and FileOffset are 0, an external [[MODL]] is used within the HOP.
{| class="wikitable"
Line 83 ⟶ 81:
|-
| 0x00 || u32 || '''DataType''' ||
* 1 = [[MODL]]Renderware Model
* 6 = JDTM (JDeltaModel) '''(Not present in Scooby)'''
|-
Line 98 ⟶ 96:
! Offset !! Type !! Variable !! Description
|-
| 0x00 || u32[] || '''TimeChunkOffs''' || OffsetOffsets to TimeChunkTimeChunks
|}
 
Line 106 ⟶ 104:
! Offset !! Type !! Variable !! Description
|-
| 0x00 || u32[VisCount][VisSize/VisCount] || '''Visibility''' ||
|}
 
====xCutsceneBreak[]====
{| class="wikitable"
|-
Line 120 ⟶ 118:
 
 
===TimeChunk=Models==
Following the header section, the subsequent content comprises Renderware clump and JDTM models.
 
===HeaderJDTM===
{| class="wikitable"
|-
! Offset !! Type !! Variable !! Description
|-
| 0x00 || char[4] || Magic || "JDTM" in ASCII
|-
| 0x04 || u32 || amountTargets || Amount of JDeltaTarget entries
|-
| 0x08 || '''JDeltaTarget[amountTargets]''' || targets || Array of JDeltaTarget's
|}
 
 
{| class="wikitable"
|+ JDeltaTarget
|-
! Offset !! Type !! Variable !! Description
|-
| 0x00 || s32 || '''skipSize''' || Total size of this structure
|-
| 0x04 || s32 || '''numRuns''' || Amount of JDeltaRun entries.
|-
| 0x08 || s32 || '''numVerts''' || Amount of vertices.
|-
| 0x0C || f32 || '''scale''' ||
|-
| 0x10 || '''JDeltaRun[numRuns]''' || '''runs''' ||
|-
! colspan="4" | 00h padding bytes (16-byte boundary)
|-
| || f32[numVerts][3] or s16[numVerts][3] || Vertices || If scale is 0, this array consists of 3 float values. If scale is > 0, this array consists of 3 signed short integers (aligned to 4-byte boundary).
|}
 
{| class="wikitable"
|+ JDeltaRun
|-
! Offset !! Type !! Variable !! Description
|-
| 0x00 || s32 || '''VertIdx''' ||
|-
| 0x04 || s32 || '''VertCt''' ||
|}
 
 
==Format: TimeChunk==
Each timechunk has a 0x10 byte header:
{| class="wikitable"
Line 134 ⟶ 179:
| 0x0C || u32 || '''ChunkIndex''' || Zero-based TimeChunk index.
|}
 
 
====xCutsceneData====
EachEvery entry hasis this16-byte 0x10aligned byteand has this header:
{| class="wikitable"
|-
Line 154 ⟶ 200:
| 0x0C || u32 || '''FileOffset''' || Starting position of data, relative to end of this header.
|}
 
Entries are 16 bytes aligned.
 
=====Sound=====
Line 184 ⟶ 228:
| 0x10 || u32 || '''Amount''' frames
|-
| 0x14 || f32[amountFrames][2] ||
* First float: Time
* Second float: Focal length?
|-
| 0x14 + (8*amount framesamountFrames) || [[ANIM]] ||
|}
 
Line 207 ⟶ 251:
| 0x00 || char[4] || "JDTA" in ASCII
|-
| 0x04 || u32 || '''Amount''' of timestime entries (and rows in 2D array).
|-
| 0x08 || u32 || '''Amount''' of columns in 2D array.
Line 213 ⟶ 257:
| 0x0C || f32[] || '''Array''' of time floats.
|-
| 0x0C + (4*amount times) || f32[][] || '''2D-Array''' withfor every time floatsframe with unknown values inside.
|}
 
=====MorphTarget=====
{| class="wikitable"
Unknown
! Offset !! Type !! Variable !! Description
 
|-
| 0x00 || u32 || amountFrames ||
|-
! 0x04 || xCutsceneMphFrame[] || || Aligned to 16-byte boundary
|-
| 0x00 || f32 || '''Time''' ||
|-
| 0x04 || u32 || '''Flags''' ||
|-
! colspan="4" |
|-
| colspan="4" style="text-align:center" | [[EvilEngine/MPHT|MPHT]]
|}
 
==AssetID List==
2,079

edits