I’m only finally getting around to really understanding and utilising the power of virtual channels – a truly awesome system.
There’s one thing that’s got me confused though: the relationship between maxplaybacks and virtual channels.
It makes sense that I need to have an event instance playing to track a virtual channel. The result of this is that maxplaybacks is really the maximum number of events that are tracked, not the number of events we hear.
Is there a filter so that we can filter the number we hear without losing the ability to track events using virtual channels?
We have a scenario where there are lots of enemies shooting at us with rocket like projectiles. We want to track a sound event on each projectile so that when hear the projectiles as they pass the player. It quickly gets very loud and cluttered because we’re hearing so many of the projectiles at once.
If I set the max playbacks to a low number, I can effectively control how many I want to hear to get the desired result – however, this also reduces the number of events being tracked, which results in many projectiles not having any sound at all.
Is there a way I can say "track 20 projectiles but play only the 5 that are closest to the player/listening point"? Thus forcing only 5 events to be heard and pushing all the others into virtual channels.
- mattconnolly asked 6 years ago
Firstly, virtual channels and Max playbacks are totally unrelated, every sound playing in the system is subject to channel virtualization. That is determined by audibility calculations which include volume level, attenuation and occulsion. Virtual channels are part of the low level FMOD Ex system and are not affected by any designer stuff.
Virtual events is a popular request. While we don’t currently support managing the virtualization internally, you can acheive that relatively easily using the API. The ‘Just Fail If Quietest’ max playback behaviour was created for this very purpose. If the programmer polls getEvent each tick, then the real/virtual events will swap in and out when needed rather than only at creation. One thing to be aware of is that the event will start again when it swaps in. This is fine for looping sounds but for more complex sounds it can sound strange, or if there is frequent swapping. For most events this can be worked around on the programmer side as well using Channel::setPosition to set it where it was when it swapped out.
The main issue here is that maxplabacks serves a double purpose, it is used for both resource management as well as limiting the number of sounds to make the mix sound better. We are planning on addressing this issue in the near future.
- Guest answered 6 years ago
Setting maxplaybacks = 5 results in only 5 of 20 rockets having a sound.
If they all arrive at the same time, then I hear 5 which is fine but only in the case where they all arrive together.
When they arrive at different times, it’s really obvious that 15 of them are missing sounds.
Sounds like your programmers are only kicking off the sound when the rocket is created. If you have a looping sound (which the rocket sound probably is?) and fewer max playbacks than max instances of that object in the game, then your programmer needs to keep trying to re-trigger the loop.
Or, go back to 20 max instances and fiddle with priorities until you get something you’re (reasonably) happy with.
Thanks for your input, audiodev!!
Yes, these are looping sounds, and they are played once on the projectile object when its created.
I thought the whole point of virtual channels was so that you could leave them playing and let the virtual channel system figure out which ones will be heard. This works really really well with static environmental sounds, provided maxplaybacks is enough for each instance playing in the world.
Can we have the ability to limit the number of events that are heard independently of the number of events that are being tracked as virtual events. ie: two properties:
- MaxPlaybacks – the number of events that can play at a time, limited only by the number of virtual channels available. This number includes both real and virtual event instances.
- MaxRealEvents – limit the playback to of real (audible) instances of this event to this number (sorted by distance, I suppose) and all other events will be virtualised.
I think Virtual Events is a very popular request indeed
FWIW, we implemented a Virtual Events system here in our SoundManager layer that sits above FMOD. It really didn’t take more than a couple days to implement and a couple more to debug and add features.
Hi Arianne, welcome to the FMOD Forum!
[quote:279lshpp]This was posted in 2010. Has this issue been addressed yet?[/quote:279lshpp]
Yes and no, the FMOD Designer API has not changed, but when designing the new FMOD Studio API we took this feedback into consideration and included virtual event management from the start.
- Guest answered 4 years ago
By the way, I tried putting the events in a category with a maxplaybacks on the category, but that has the same effect as reducing the maxplaybacks on the event: other events cease to be tracked/virtualised resulting in missing sounds.
Sounds like you should do two things.
First, look at the Max Playbacks Behavior. Having a Max Playbacks of 5 but chosing "steal quietest" may work nicely for you.
Secondly, look at the priority of your rocket event. You may want to lower the priotity (which means making the Priority number higher :P). A lower priority for the rocket will mean that far away rocket channels will be virtualized by nearer, higher priority sounds like footseps, guns, etc.
Please login first to submit.