Legacy Reference

Adding Collision Sounds to Levels

You can add physics-based collision sounds to your level using the materialeffects.xml spreadsheet file located in the \dev\SamplesProject\libs\materialeffects\ folder. This file requires Microsoft Excel for editing, but you can preview it using any software that opens this file format.

The following figure shows a portion of a sample materialeffects.xml spreadsheet file for collisions with a rubber material. As you can see, most of the effects for rubber material use the collisions_rubber_default sound effect when rubber collides with various other surface types.

To change the collision sound effect for a spreadsheet entry (such as for rubber_default for example) in the materialeffects.xml file, you edit the collisions.xml file.

To change a collision sound effect

  1. Open the collisions.xml file in the \dev\SamplesProject\libs\MaterialEffects\FXLibs\ folder for editing.

  2. Specify which audio trigger plays when an effect is triggered by adding the appropriate code between the START and END markers for a material.

    The following code example specifies that when the rubber_default effect is triggered, the Play_cannonball_wall_impact audio trigger is executed.

    <Effect name="rubber_default"> <Audio trigger="Play_cannonball_wall_impact" /> </Effect>

The following shows a sample collisions.xml file.

<FXlib type="collision"> <!-- START mat_rubber START --> <Effect name="rubber_impact"> <Audio trigger="Play_cannonball_wall_impact" /> </Effect> <!-- END mat_rubber END --> . . . </FXLIB>


Sounds that end when an object impacts something, such as for bullet projectiles, use the bulletimpacts.xml file to define their effect instead.