In CRYENGINE the environment is very interactive - things move, collisions occur and things break. Furthermore, when two materials touch a Sound is often generated.
The interaction between two materials is described in a file called MaterialEffects.xml (located in the \Game\Libs\MaterialEffects
folder). Opening this file with spreadsheet software will show a matrix, with surface types in the first column/row.
From this file the ENGINE looks up actions to be taken on any given interaction and each entry in the table contains text pointing to a description of the effect to be taken. The effects are described in the FXLibs subfolder.
The example below shows how the description is composed for collisions.
Example: When an Entity with an assigned surface type of mat_wood collides with the surface_type mat_metal the corresponding cell in the spreadsheet contains the text: collisions:wood_metal. This text indicates that the effect is called wood_metal - this is situated in the FXLibs\collisions.xml
file and the ATL Trigger to be played is described therein.
In some cases the material of an object is not enough to describe its Sound probabilities. For example, a barrel (made out of sheet metal) dropped to the ground sounds very different from a sheet metal roof being hit by something.
Therefore, the first column of the table described above may contain special names used by archetype classes. The image below lists various names for the barrel object class and describes the different interaction Sounds.
Destructibles also have a special mapping:
A separate file called FXLibs\projectiles.xml
is used to reference bullet effects. NOTE: That a delay can be put into the effect so that the player can hear the sound of the bullet impacting even while still shooting.
NOTE: Also that a bullet hitting a special object, such as a barrel will create a Sound according to the object's assigned material (for example, sheet metal).
Entries in the FXLibs\vegetation.xml
file bypass the table in the MaterialEffects.xml file and result in ATL Triggers based on the name of the vegetation.