I’m just wondering what the best way to setup ambient one shots is? As in looping events which trigger sounds from a multi instrument at random intervals.
My event is setup with an action sheet and a multi, inside the multi there’s a silence instrument with a random time and another multi for the ambient one shots, e.g fence wind rattle or wood creaks etc
In our game most of the audio lives in prefabs and sometimes there can be dozens of the same prefab next to each other like the fences. I obviously want to limit the instances for performance reasons but I’m getting some undesirable results. I’ve experimented with the spawn stealing settings but I never get the result I want, especially if there’s many objects of the same type next to each other, I’ll run past a row of fences and the spawn stealing tries to steal from the furthest (the delay at the start of the event never reaches the sound) or the max distance stops the instance so I never get a consistently moving ambience.
I’d expect to have a soundscape with randomly triggered ambient sounds from all directions, not just the closest emitters to me and also the feeling of running into the sounds instead of them triggering while I walk past and then always hearing them behind me.
We’ve got StopEventsOutsideMaxDistance checked maybe that’d causing issues but it’s better for performance.
If you could offer some best practises when dealing with ambient one shots it’d be much appreciated!
There’s no one “best” way to do this. There are many different ways in which it could be done, and since every game has different requirements, different ways are suited to different games.
That being said, one of the most popular ways is to use a scatterer instrument. At random (but customizable) intervals, a scatterer selects an entry from its playlist, and spawns an instance of that entry. Each such spawned instance is assigned a random position offset within a certain range of the parent event instance, which means that a single scatterer event instance can spawn sounds over a wide area around that event instance.
That being said, while scatterer instruments are powerful, they are also more complex than other instrument types and may take some getting used to, so I reccomend you thoroughly read our documentation on them before using them in your game.
I can’t be totally sure from your description, but I suspect you’re experimenting with event- and bus-level instance limiting. Are you aware that the FMOD Engine’s voice virtualization system always automatically handles this type of resource management for you, with no need to touch the event- and bus-level max instance properties, and that its impact on your game’s audio output is usually so subtle as to be unnoticeable?
While the virtual voice system is complex, its most basic behavior is easy to grasp: If a channel/voice’s volume would be attenuated all the way to silence, that channel/voice is automatically “virtualized.” A virtualized voice isn’t processed and isn’t included in the mix, and so it consumes no resources. Virtual voices’ volume properties are still tracked, however, and if they ever return to audible volume levels, they automatically become non-virtual again and resume playing.
The great thing about the virtual voice system is that, because it virtualizes voices when they’re inaudibly quiet, you should never actually hear voices popping in and out - and yet you never have to worry about the resource cost of all those silent voices, nor about silenced voices failing to start again when they should resume being audible.
(That being said, if you play an extremely large number of voices that are loud enough to be audible, you will overwhelm the maximum number of non-virtual voices that your game can play, and the virtual voice system will be forced to virtualize some of the loud-enough-to-be-audible voices as well. Even in that case, however, it will virtualize the quietest voices first, to make the effect as subtle as possible.)