Difference between revisions of "Sonic Heroes/Collision Format"
From Sonic Retro
Igorseabra4 (talk | contribs) (Created page with "{{SCHG SH}} Level collision in Sonic Heroes is defined in big endian .cl files located in dvdroot/collisions in the PC version. These files are not RenderWare collision files...") |
Igorseabra4 (talk | contribs) m |
||
Line 30: | Line 30: | ||
int16 // vertex2 index | int16 // vertex2 index | ||
int16 // vertex3 index | int16 // vertex3 index | ||
− | int16 // adjacent triangle 1 index | + | int16 // adjacent triangle 1 index |
− | int16 // adjacent triangle 2 index | + | int16 // adjacent triangle 2 index |
− | int16 // adjacent triangle 3 index | + | int16 // adjacent triangle 3 index |
float32 // unknown; usually 0 or very close to | float32 // unknown; usually 0 or very close to | ||
float32 // unknown; very close to -1 but never exactly | float32 // unknown; very close to -1 but never exactly | ||
Line 62: | Line 62: | ||
*00 01 00 00 - Death boundary | *00 01 00 00 - Death boundary | ||
*00 08 00 00 - Wall (sides of platforms) | *00 08 00 00 - Wall (sides of platforms) | ||
+ | |||
+ | Remember this is still a Sonic game, so these types of surfaces probably help the physics engine decide what to do, but of course you can walk on walls given you have enough speed. Same applies to vertical floors being the same as walls (all of Test Level's collision model is type 00 00 00 00). | ||
{{SCHGuides}} | {{SCHGuides}} | ||
[[Category:Sonic Community Hacking Guide]] | [[Category:Sonic Community Hacking Guide]] |
Revision as of 21:59, 14 March 2017
SCHG: Sonic Heroes |
---|
Main Article |
Mechanic Editing |
DOL Editing |
Model Editing |
Collision Format Model Format |
Level Editing |
Camera Editing |
Particle Editing |
Particle Editing |
Sound Editing |
Music List |
SCHG How-Tos |
Custom Object Material Effect Tutorial |
Level collision in Sonic Heroes is defined in big endian .cl files located in dvdroot/collisions in the PC version. These files are not RenderWare collision files and are the same between different versions of the game. s*.cl files contain normal level collision, s*_xx.cl files contain collision for death boundaries and s*_wt.cl files contain water boundaries. The s*.cl file is required for the level to load but the others are not, and also they can be placed in levels which did not originally have them.
Format is only partly known.
File Format
// HEADER (0x28 bytes) uint32 // total number of bytes in file int32 // second section offset int32 // triangle section offset int32 // vertex section offset float32[3] // X, Y, Z center of model (collision sphere) float32 // radius of sphere int16 // unknown // 0x01 for xx/wt, 0x0C or Ox0D for stages int16 // number of triangles (numTriangles) int16 // number of vertices (numVertices) int16 // number of second section entries // FIRST SECTION // This section is unknown. It comes right after the header. It appears to be indexes of triangles in an order; maybe tristrips? // SECOND SECTION // This section is unknown. Each entry is 0x20 bytes long and the amount of entries is set in the header. // TRIANGLE SECTION // Triangle entry (0x20 bytes, repeats numTriangles times): int16 // vertex1 index int16 // vertex2 index int16 // vertex3 index int16 // adjacent triangle 1 index int16 // adjacent triangle 2 index int16 // adjacent triangle 3 index float32 // unknown; usually 0 or very close to float32 // unknown; very close to -1 but never exactly float32 // unknown; between -1 and 1 int8[4] // col flags int8[4] // col flags (2) // adjacent triangle 1: vertex1 of current triangle is vertex3 of adjacent; vertex2 of current triangle is vertex2 of adjacent // adjacent triangle 2: vertex2 of current triangle is vertex1 of adjacent; vertex3 of current triangle is vertex3 of adjacent // adjacent triangle 3: vertex1 of current triangle is vertex1 of adjacent; vertex3 of current triangle is vertex2 of adjacent // adjacent triangle index is FF FF if it doesn't exist // VERTEX SECTION // Vertex entry (0xC bytes, repeats numVertices times): float32[3] // X, Y, Z position
Collision Flags
These are probably set at bit level, each byte with a different meaning, but here they are presented as 4 bytes. They are guesses and the list might be wrong and incomplete.
- 00 00 00 00 - Floor (normal)
- 00 00 00 01 - Floor (grass offroad)
- 00 00 00 02 - Water boundary
- 00 00 00 10 - Floor (sand)
- 00 00 00 20 - Floor (grass road)
- 00 00 00 80 - Floor (rock)
- 00 00 01 00 - Wall (normal)
- 00 00 01 80 - Wall (rock)
- 00 00 80 00 - Wall (invisible barrier)
- 00 01 00 00 - Death boundary
- 00 08 00 00 - Wall (sides of platforms)
Remember this is still a Sonic game, so these types of surfaces probably help the physics engine decide what to do, but of course you can walk on walls given you have enough speed. Same applies to vertical floors being the same as walls (all of Test Level's collision model is type 00 00 00 00).