Collision Index Data (File Format)

The collision index data structure defines collision geometry and materials. It can be found in the MREA format as well as the DCLN format.

Format
The structure is basically just a sequence of arrays. In Metroid Prime 2, the collision material field was extended from 32 bits to 64 bits, and a new array was added in between the triangle and vertex arrays. Other than that, the format is the same across all games.

Collision Materials
Collision materials are basically properties mapped to every vertex, edge, and triangle in the collision mesh that controls how the game reacts when an object touches it. It controls things like, for example:


 * What sound effect plays when the player walks on the surface
 * Which actors are allowed to pass through the collision
 * Whether the player is allowed to stand on the surface or if it should be treated as a wall

... among some other things. This field is 32 bits in Metroid Prime, and was extended to 64 bits in Metroid Prime 2 and every game after. Prime 2 and 3 share the same property values, whereas Prime 1 and DKCR have unique property sets. In Prime 2 and on, the majority of the fields in the upper 32 bits are only meant for internal use and aren't used by MREA or DCLN collision assets. (These bits exist internally in Prime 1 as well, but they aren't exposed to the collision file format.)

The surface type properties controls what physical material the surface is made of, which changes the sound effect that plays when the player walks/jumps on the surface and in some cases, what particle effect plays on it. In the Metroid Prime series, rather than embedding an enum to set the surface type, each surface type is assigned its own bit. This technically allows for multiple surface types to be set on the same geometry. For sound effect playback, the bit with the largest value takes priority.