Bank Loading System Question

Hello,
I’m currently learning and experimenting with loading and unloading banks on a per-level basis
My goal is to have the master load at the very start of the game and unloaded once the game is exited. The other banks (music and SFX) that are tied to a specific stage will also be loaded as the stage starts and unloaded when the stage ends. I have read some forums regarding selective bank loadings, including the https://qa.fmod.com/t/bank-management-best-practices/16887 . But I still have some questions left.

Question:

  • At the very start of the game, I load the Master.bank and Master.strings banks at the beginning of the Studio Bank Loader component and never destroy/unload them. Does the bank remain loaded even though I have changed levels/scenes until I specifically order it to be unloaded, or do I need to set the Studio Bank Loader component to load the master banks again per level?

  • Does loading and unloading separate banks before a scene loads or a second after the scene loads have a latency effect on the audio playback (sounds being played late)?

  • If a music event is being stopped but the bank where the music is contained has been unloaded a second before, does the music end abruptly, or does it end smoothly (assuming the music event has an ADSR automation)?

  • Any tips for better optimization or anything regarding this system design?

Thank you in advance :smiley:

Hello sorry to bump this post, but can anybody help? Thank you

Apologies for the delay.

This is correct, FMOD doesn’t know about scenes and will only unload the banks if explicitly told to, or when the game exits.

This could have a noticeable effect if you want a sound to start before it has finished loading. The sound will still play but only once it is ready.

If a bank is unloaded before an event is stopped, the assets are being ripped away from the event and it will stop abruptly.

It can be easy to over compartmentalize projects, especially as they grow in size.

Streaming assets don’t get ‘loaded’ until they are being used, and even then they are streamed from the disk. So if your music all uses streaming assets, you could have a music bank which is always loaded but using very few resources.

There are two parts to loading banks, the meta data and the sample data, you can get access to the events of a bank by loading the meta data but the sample data must be loaded to create and instance of the event, if it isn’t loaded at that point FMOD will load the sample data for just that event.

You also have the option for loading sample data for events individually: https://www.fmod.com/docs/2.03/api/studio-guide.html#sample-data-loading.

Generally you just want to give the game some time to be able to load events before they are required to play. Once the sample data of a non-streaming event is loaded, creating and starting the event is very quick.

Thank you for your reply, sorry for the bump too

Is there any way or command that can help me with this? One thing I have thought is to just let the music bank all initialized at the start of the game and never be unloaded until the game closes

And I was wondering if parameter changes and values will still be brought (not reset) across, even though the banks are being loaded and unloaded, as long as the master banks are loaded. Because I assume that the master banks are the one that holds the parameter values of all events in FMOD

There are two types of parameters: global and local. Global parameters are referenced from the Master Bank, whereas local parameters are separate between instances of objects.

ie. Global Parameters will persist as long as the Master Bank remains loaded.
Local Parameters only persist for the current instance of event/snapshot/bus.

I see, then, so it’s better to use global for parameters that are consistently used throughout the game. Thank you.

Is there a command or code in FMOD that can ensure the event plays out before the bank is unloaded?

Unfortunately we do not have anything like that. You could use Studio::EventDescription::loadSampleData to increment the ‘loadSampleData’ count for a specific Event Description, just be sure to call Studio::EventDescription::unloadSampleData when you’re done.

It is also possible to add events to multiple banks, if you have certain events that may overlap between scenes then by adding them to both of those scenes banks you would ensure that the event would be loaded to play out nicely.

1 Like

Sorry for the late reply. But thank you for the help, I have completed the bank loading system and now is working perfectly fine with the help of the explanation. Thank you so much!

1 Like