Can't figure out how to make multiple pawns make multiple sounds at the same time.


I have multiple pawns attacking a structure. I want to have each one of them making a banging noise. So if twenty pawns were all attacking the structure I should here 20 bangs at the same time. I’m not. I only ever here one at a time.

I cast to each pawn that is attacking from game mode so it seems to me I should be hearing multiple sounds. I have a sound queue that has a random sound selector in it.

I just made a very simple custom event to spawn the sound queue at the location:

Can someone give me a clue as to what I am doing wrong?



Add a “Print Text” node to that event to make sure it actually gets called multiple times.
Also, I see you added attenuation settings so it’s possible that the sound gets played too far from the main camera.

Agreed about adding a print log to make sure the event is getting called like you expect. Also, to debug this we’d need to look at your attenuation settings as well as the sound cue you’re using.

I’d also avoid using SpawnSoundAtLocation for this use-case since I’m assuming these are short-duration sounds and you’re not using the returned audio component. Instead, prefer to use PlaySoundAtLocation instead. AudioComponents are scene components and have extra performance baggage.

I just noticed your volume multiplier is set to 5. We clamp volume at the output but you should avoid adding volume multipliers this high (or in general, greater than 1.0) since it makes reasoning about gain-stages in complex projects (significantly) more difficult. For example, if you have a Sound Class scaling volume by 3, a sound mix scaling that by 2, then you are setting this by 5, your total volume scale will be 30! Obviously the output will get clamped (i think to 4), will likely result in clipping (which is very bad). Even if its not clipping due to the clamp and added platform headroom (and maybe headroom in the asset itself), it’ll still mess up your mix logic. For example, if you remove the sound mix above (i.e. remove a factor of 2), your output will still be 15, which when clamped to 4, means you won’t hear ANY change in your output even though you removed a sound mix. Imagine this in a real project with dozens of dynamic mixes, hundreds of sounds, and a dozen sound classes, and you’ve set yourself up for a major headache.

Wow Kelvin thanks for all of that great information.

I did run with breakpoints to make sure I was getting the multiple sounds, but I like your idea.

I’m fairly certain my attenuation is good because I actually developed it for some ambient sounds. I move right up on the pawns making the sounds so I can hear them.

I will definitely fix those multipliers so they align with best practices.

I hope to try this stuff today after I upgrade to 4.13.