Event Instance Limit - how does it work?

How to handle the max. event instance in a situation with multiple sheep flocks scattered on a area?

To discribe my situation a little bit:
In the game there is a landside around a city, with multiple shepards and their flocks.
The flocks are moving around, so a single scatterer event would not work.
So I tryed to give every sheep a scatterer event and balance the time of the sound spawn.
However, there are A LOT of sheep on the map and I want to limit the sheep sound event instances to maybe the five nearest sheep to the player.

The problem seems, that when the game starts the five nearest sheeps have sounds and all others don’t.
The sheep sound event is a scatterer inst. on loop.
As I understand it, it’s because of the fact that the max. Instance stealing does not work if the events don’t get stopped, right?
Retriggering/restarting the event seems not a good solution for that…

Any suggestions?

Thanks! :smile:

The way stealing works is when there are the max number of instances of that event currently playing, when a new event instance is created and played it will check with the selected stealing behaviour (in this example, furthest) and stop the instance that matches that behaviour (eg. the event instance furthest from the listener).

I would first suggest trying to set the stealing behaviour to “Virtualize”. The way virtualization works is that it will only allow the nth amount of event instances to produce audio, but the other instances will continue playing. As the listener moves around the game world, event instances that become further away from other virtualized instances will themselves become virtual and those virtualized instances will become “real”. What this essentially means is there will always be 5 sheep sounds playing maximum, but FMOD Studio will automatically mute and unmute instances depending on how close they are to the listener.

2 Likes

Thank you for the good explanation, Richard!
Finally I understand how that works. :smiley: