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 <
Game folder>\Assets\gamedata.pak, and w
ithin this *.pak file, in
Libs\MaterialEffects
). 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 audio system Trigger to be played is described therein.
Pic2: Collisions.xml
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: A delay can be put into the effect so that the player can hear the sound of the bullet impacting even while still shooting. Also, 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).
Delay in projectiles.xml
Entries in the FXLibs\vegetation.xml
file bypass the table in the MaterialEffects.xml file and result in audio system Triggers based on the name of the vegetation.