How to set up audio collisions

According to the (legacy) docs, I need to fill in materialeffects.xml and create a collisions.xml detailing what audio to play when two materials hit each other. I have done this but no audio plays. Does anyone know where the code is that listens for the collisions and then queries the xml to decide what audio to play? I see FootstepComponent uses the MaterialEffects class to do this but I don’t see anywhere else in code that does. Surely it must be implemented somewhere?

ActionGame.cpp, in OnCollisionLogged_MaterialFX() at line 2389 it calls ExecuteEffect() which would go on to create audio for the collision but the code never gets there due to pEntitySrc always being null.

Hi @rjlwest, I recommend checking out how the StarterGame has set up everything under dev/StarterGame/libs/MaterialEffects because you need most of that stuff. After you have those set up in your game project you should be able to create two entities, add rigid body physics components, collider components, mesh components and assign materials that have some surface type that is listed in materialeffects.xml (PROTIP: open this with Microsoft Office XML Handler or Excel not a text editor).

After that you should be able to have one of those entities fall onto the other and produce the audio sound for those two surfaces listed in collisions.xml

Also, I recommend using the following cvars to enable in game visualization of what the material effects system is doing (more info in legacy docs here)

s_drawaudiodebug wb
<- draws text labels for audio objects in 3d space, audio object ids in hud

mfx_debug 1 <-- draw collisions

mfx_debugvisual
2 <- draws mfx info like audio event, particle fx, decal,
material and a vector where the effect is

It wouldn’t be possible for me to play the starter level due to my development environment. I would also be in the same position, I have materials set up, I have materialeffects.xml edited and a separate collisins.xml specifying audio events, but nothing is happening. I was hoping to find the area of code responsible for querying the materialeffects.xml so I can see exactly why it isn’t working.