EvilEngine/CSN: Difference between revisions
Content added Content deleted
EnergyDrink (talk | contribs) No edit summary |
EnergyDrink (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
{{AutoAssetInfobox}} |
{{AutoAssetInfobox}} |
||
===Alignment=== |
|||
Header, Raw Data and TimeChunks are all aligned to 2048 bytes.<br> |
|||
Entries in TimeChunks are aligned to 16 bytes? |
|||
==Format== |
==Format== |
||
===Header=== |
|||
The asset data starts with a [[CTOC|main header]], which is also present in the CTOC asset. |
|||
CSN starts with a header, which is also present in the [[CTOC]] asset (without padding bytes). |
|||
====xCutsceneInfo==== |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x00 || uint || '''Magic''' || |
|||
* '''CTSN''' (Xbox/PlayStation 2) (little-endian) |
|||
* '''NSTC''' (GameCube) (big-endian) |
|||
|- |
|||
| 0x04 || uint || '''AssetID''' || AssetID of CSN. |
|||
|- |
|||
| 0x08 || uint || '''NumData''' || Amount of '''xCutsceneData''' entries. |
|||
|- |
|||
| 0x0C || uint || '''NumTime''' || Amount of '''xCutsceneTime''' entries. |
|||
|- |
|||
| 0x10 || uint || '''MaxModel''' || Largest model in bytes (+padding bytes) in xCutsceneData. |
|||
|- |
|||
| 0x14 || uint || '''MaxBufEven''' || Largest timechunk in bytes (+padding bytes), usually the first one. |
|||
|- |
|||
| 0x18 || uint || '''MaxBufOdd''' || Largest timechunk in bytes (+padding bytes). |
|||
|- |
|||
| 0x1C || uint || '''HeaderSize''' || Size of header. |
|||
|- |
|||
| 0x20 || uint || '''VisCount''' || Amount of visibility entries. |
|||
|- |
|||
| 0x24 || uint || '''VisSize''' || Total size of all visibility entries. |
|||
|- |
|||
| 0x28 || uint || '''BreakCount''' || Amount of '''xCutsceneBreak''' entries. |
|||
|- |
|||
| 0x2C || uint || '''pad''' || ''null'' |
|||
|- |
|||
| 0x30 || byte[16] || '''SoundLeft''' || '''Only present in Scooby/BFBB''' |
|||
|- |
|||
| 0x40 || byte[16] || '''SoundRight''' || ''null'' '''(Only present in Scooby/BFBB)''' |
|||
|} |
|||
====xCutsceneData==== |
|||
* If ChunkSize and FileOffset are 0, an external [[MODL]] is used within the HOP. |
|||
* Every model has padding - 0x00 bytes at the end, 2048 byte alignment. |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x00 || uint || '''DataType''' || |
|||
* 1 = [[MODL]] |
|||
* 6 = JDTM '''(Not present in Scooby)''' |
|||
|- |
|||
| 0x04 || [[AssetID]] || '''AssetID''' || AssetID of model. |
|||
|- |
|||
| 0x08 || uint || '''ChunkSize''' || Size of model. |
|||
|- |
|||
| 0x0C || uint || '''FileOffset''' || Offset to model. |
|||
|} |
|||
====xCutsceneTime==== |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x00 || uint || '''TimeChunkOffs''' || Offset to TimeChunk |
|||
|} |
|||
====Visibility==== |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x00 || uint || '''Visibility''' || |
|||
|} |
|||
====xCutsceneBreak==== |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x00 || float || '''Time''' || |
|||
|- |
|||
| 0x04 || int || '''Index''' || |
|||
|} |
|||
=== |
====Padding==== |
||
Padding - 0x00 bytes, 2048 byte alignment. |
|||
This section contains all [[MODL]] and JDTM assets. Its size and offset are defined in the [[CTOC|main header]]. |
|||
===TimeChunk=== |
===TimeChunk=== |
||
Each timechunk has a 0x10 byte header: |
|||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! Offset !! Type !! Variable !! Description |
! Offset !! Type !! Variable !! Description |
||
|- |
|- |
||
| 0x00 || float || '''StartTime''' || |
| 0x00 || float || '''StartTime''' || |
||
|- |
|- |
||
| 0x04 || float || '''EndTime''' || |
| 0x04 || float || '''EndTime''' || |
||
Line 32: | Line 109: | ||
| 0x08 || uint || '''NumData''' || Number of entries. |
| 0x08 || uint || '''NumData''' || Number of entries. |
||
|- |
|- |
||
| 0x0C || uint || '''ChunkIndex''' || TimeChunk index |
| 0x0C || uint || '''ChunkIndex''' || TimeChunk index. |
||
|} |
|} |
||
====xCutsceneData==== |
|||
The entries have the following structure: |
|||
Each entry has this 0x10 byte header: |
|||
=====xCutsceneData===== |
|||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
Line 54: | Line 131: | ||
| 0x0C || uint || '''FileOffset''' || Starting position of data, relative to end of this header. |
| 0x0C || uint || '''FileOffset''' || Starting position of data, relative to end of this header. |
||
|} |
|} |
||
Every entry has padding - 0x00 bytes at the end, 16 byte alignment. |
|||
=====Sound===== |
=====Sound===== |
||
[[Sound_Format|SNDS]] |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
! 0x00 || colspan="3" | [[#xCutsceneData|xCutsceneData Header]] |
|||
|- |
|||
| 0x10 || colspan="3" style="text-align:center" | [[SNDS]] (Scooby/BFBB) |
|||
|} |
|||
=====Animation===== |
=====Animation===== |
||
Line 70: | Line 142: | ||
! Offset !! Type !! Variable !! Description |
! Offset !! Type !! Variable !! Description |
||
|- |
|- |
||
| 0x00 || uint || '''RootIndex''' || |
|||
|- |
|- |
||
| |
| 0x04 || float[3] || '''Translate''' || Starting position? |
||
|- |
|- |
||
| 0x10 || colspan="3" style="text-align:center" | [[ANIM]] |
|||
| 0x14 || float[3] || '''Translate''' || Starting position. |
|||
|- |
|||
| 0x20 || colspan="3" style="text-align:center" | [[ANIM]] |
|||
|} |
|} |
||
=====Camera===== |
=====Camera===== |
||
(BFBB/TSSM/Incredibles only) |
|||
Camera is different in Night of 100 Frights. |
|||
This is BFBB/TSSM/Incredibles only. |
|||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! Offset !! Type !! Variable !! Description |
! Offset !! Type !! Variable !! Description |
||
|- |
|- |
||
| 0x00 || uint || colspan="2" | Amount of frames. |
|||
|- |
|||
| 0x10 || uint32 || colspan="2" | Amount of frames. |
|||
|- |
|- |
||
| |
| 0x04 || colspan="3" style="text-align:center" | [[FLY]] (big-endian on GameCube) |
||
|} |
|} |
||
=====JDTA===== |
=====JDTA===== |
||
Unknown |
|||
{| class="wikitable" |
|||
|- |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
! 0x00 || colspan="3" | [[#xCutsceneData|xCutsceneData Header]] |
|||
|- |
|||
| 0x10 || colspan="3" | Unknown |
|||
|} |
|||
=====MorphTarget===== |
=====MorphTarget===== |
||
Unknown |
|||
{| class="wikitable" |
|||
|- |
|||
====Padding==== |
|||
! Offset !! Type !! Variable !! Description |
|||
Padding - 0x00 bytes, 2048 byte alignment. |
|||
|- |
|||
! 0x00 || colspan="3" | [[#xCutsceneData|xCutsceneData Header]] |
|||
|- |
|||
| 0x10 || colspan="3" | Unknown |
|||
|- |
|||
| colspan="4" style="text-align:center" | [[MPHT]] |
|||
|} |
|||
Revision as of 23:57, 2 September 2022
CSN | |
---|---|
Cutscene | |
Type | Binary |
Games used | Night of 100 Frights Battle for Bikini Bottom |
Format
Header
CSN starts with a header, which is also present in the CTOC asset (without padding bytes).
xCutsceneInfo
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | Magic |
|
0x04 | uint | AssetID | AssetID of CSN. |
0x08 | uint | NumData | Amount of xCutsceneData entries. |
0x0C | uint | NumTime | Amount of xCutsceneTime entries. |
0x10 | uint | MaxModel | Largest model in bytes (+padding bytes) in xCutsceneData. |
0x14 | uint | MaxBufEven | Largest timechunk in bytes (+padding bytes), usually the first one. |
0x18 | uint | MaxBufOdd | Largest timechunk in bytes (+padding bytes). |
0x1C | uint | HeaderSize | Size of header. |
0x20 | uint | VisCount | Amount of visibility entries. |
0x24 | uint | VisSize | Total size of all visibility entries. |
0x28 | uint | BreakCount | Amount of xCutsceneBreak entries. |
0x2C | uint | pad | null |
0x30 | byte[16] | SoundLeft | Only present in Scooby/BFBB |
0x40 | byte[16] | SoundRight | null (Only present in Scooby/BFBB) |
xCutsceneData
- If ChunkSize and FileOffset are 0, an external MODL is used within the HOP.
- Every model has padding - 0x00 bytes at the end, 2048 byte alignment.
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | DataType |
|
0x04 | AssetID | AssetID | AssetID of model. |
0x08 | uint | ChunkSize | Size of model. |
0x0C | uint | FileOffset | Offset to model. |
xCutsceneTime
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | TimeChunkOffs | Offset to TimeChunk |
Visibility
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | Visibility |
xCutsceneBreak
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | float | Time | |
0x04 | int | Index |
Padding
Padding - 0x00 bytes, 2048 byte alignment.
TimeChunk
Each timechunk has a 0x10 byte header:
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | float | StartTime | |
0x04 | float | EndTime | |
0x08 | uint | NumData | Number of entries. |
0x0C | uint | ChunkIndex | TimeChunk index. |
xCutsceneData
Each entry has this 0x10 byte header:
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | DataType |
|
0x04 | AssetID | AssetID | AssetID of entry. |
0x08 | uint | ChunkSize | Size of data, relative to end of this header. |
0x0C | uint | FileOffset | Starting position of data, relative to end of this header. |
Every entry has padding - 0x00 bytes at the end, 16 byte alignment.
Sound
Animation
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | RootIndex | |
0x04 | float[3] | Translate | Starting position? |
0x10 | ANIM |
Camera
(BFBB/TSSM/Incredibles only)
Offset | Type | Variable | Description |
---|---|---|---|
0x00 | uint | Amount of frames. | |
0x04 | FLY (big-endian on GameCube) |
JDTA
Unknown
MorphTarget
Unknown
Padding
Padding - 0x00 bytes, 2048 byte alignment.