Silence instrument Random chance vs in game random chance

So when you have sound effects that should have a random chance of not triggering at all, should you use a multi instrument with silence percent set or do it ingame code, e.g

if (random_chance(0.3)) { play_event(sound_id)); }

Is there a perf penalty to relying on fmod silence instrument to do the work? Say 100 oneshot sounds per frame or so?

Hi,

Thank you for sharing the information.

For 100 one-shots per frame, the performance impact of this is generally minimal since FMOD is optimized for such tasks.

If you are handling an extreme amount of sounds(e.g. Thousands of sounds per frame), using your own game logic to randomize the playback will have a better performance as it doesn’t need to create an event instance or run any internal logic when the sound is skipped. Please note that you won’t be able to adjust the chance via live update though.

You could monitor performance with FMOD Studio | profiler 12. Profiling to see how much overhead it introduces compared to your in-game code.

For more information about dealing with large amount of sounds at once, you could also have a look at FMOD Engine | 5. White Papers | Virtual Voices.

Hope this helps, let me know if you have any questions.

1 Like