CLSN (File Format)
The CLSN format in Donkey Kong Country: Tropical Freeze is for static collision, usually used by world geometry.
This file format is almost completely documented Collision materials need experimentation to verify structure + figure out what the different flags do |
Format
Type | Count | Name | Description |
---|---|---|---|
Form Descriptor | 1 | Collision Form Descriptor | Data type is CLSN
|
Chunk Descriptor | 1 | Vertices Chunk Descriptor | Data type is VERT
|
u32 | 1 | Vertex Count | |
vector3 | Vertex Count | Vertex Data | |
Chunk Descriptor | 1 | Collision Materials Chunk Descriptor | Data type is MTRL
|
u32 | 1 | Collision Material Count | |
Collision Material | Collision Material Count | Collision Materials | Collision materials define collision properties. |
Chunk Descriptor | 1 | Triangles Chunk Descriptor | Data type is TRIS
|
u32 | 1 | Triangle Count | |
Collision Triangle | Triangle Count | Triangles Array | |
Chunk Descriptor | 1 | Tree Chunk Descriptor | Data type is TREE
|
u32 | 1 | Leaf Node Count | |
Tree Leaf Node | Leaf Node Count | Leaf Node Array | |
End of file |
Collision Material
Offset | Type | Count | Name | Description |
---|---|---|---|---|
0x0 | u32 | 1 | Unknown | |
0x4 | u32 | 1 | Unknown | |
0x8 | u32 | 1 | Unknown | |
0xC | u32 | 1 | Unknown | |
0x10 | u32 | 1 | Unknown | |
0x14 | End of collision material |
Collision Triangle
Offset | Type | Count | Name | Description |
---|---|---|---|---|
0x0 | u32 | 3 | Vertex Indices | |
0xC | u16 | 1 | Collision Material Index | |
0xE | u16 | 1 | Unknown | Always 0? The game actually does read and store it, so it may not just be padding. |
0x10 | End of triangle |
Tree Leaf Node
Offset | Type | Count | Name | Description |
---|---|---|---|---|
0x0 | vector3 | 2 | Axis-Aligned Bounding Box | Represented by a pair of points where point 1 is min and point 2 is max. |
0x18 | u32 | 1 | Unknown | |
0x1C | u32 | 1 | Unknown | |
0x20 | u32 | 1 | Unknown | |
0x24 | End of leaf node |