Hello.
I want to use stealing to improve performance, as I can have up to 100 events playing simultaneously for a single event. I want to limit this to a few, but only the closest events. But for some reason, none of the stealing options except virtualize work (virtualize isn’t suitable because it’s too heavy anyway).
Below I compare two modes: Furthest (the same as None because it doesn’t trigger events based on distance) and Virtualize. As you can see from the screenshots, Virtualize consumes ~4% more CPU resources on dsp and ~1.3% on studio, which is very significant (i using Unity engine)
For example, if I want a maximum of three events playing simultaneously, only three random (or the first ones triggered) events are played, and distance doesn’t affect this at all. The event is played using the FMOD Studio Event Emitter based on Object Enabled/Object Disabled events (meaning all 100 events are enabled roughly simultaneously). The event uses a Loop, meaning it will never turn off on its own—could this be a problem? If so, what are the solutions?
Event effects: Reverb, FMOD Spatializer
Furthest only stops the furthest audible instance whenever a closer instance starts playing:
- Furthest: Stop the event instance that is the furthest away from the listener, regardless of its volume.
It doesn’t retrigger Event Instances as the Listener moves, that’s what the “Virtualize” mode is for, and it’s more expensive because it has to constantly reevaluate which instances should be playing based on distance to the Listener.
Since you are using Studio Event Emitters, you can try enabling Stop Events Outside Max Distance, which will improve the “Virtualize” mode’s performance by stopping/starting the events themselves based on distance to listener. This isn’t “true” virtualization since events will be starting/stopping and won’t be keeping their timeline position up to date while silent- as they would if you only used “Virtualize”.
If that still isn’t sufficient, you may need to reconsider your implementation to reduce the number of playing instances and reduce CPU utilization. Some examples of things you can optimize:
- Rather than playing all Events all the time with
Object Start and relying on virtualization, switch them to use Collision Enter so that they only start playing when the player enters their immediate vicinity.
- Rather than having one reverb instance per Event Instance, pipe all of your Event Instances to a reverb return. Reverb is a medium overhead effect, and 100 of them are going to add up to a lot of unnecessary processing.