I’m wondering if assigning an event in two different banks and having both banks load will cause the same event to be loaded twice, hence an increase in memory usage? Thank you.
No, you don’t have to worry about this.
The FMOD Engine only never keeps more than one copy of an event’s metadata and sampledata in memory at a time, even if that event is assigned to multiple banks and those banks are all loaded into memory. The FMOD also does not unload an event’s data from memory until all of the banks to which that event is assigned are unloaded. You can therefore assign an event to as many banks as you want without it increasing that event’s CPU and memory consumption; and as long as at least one of those banks remains loaded, the event’s data will remain loaded into memory.
Of course, assigning an event to multiple banks does mean that a copy of that event’s sampledata and metadata will be stored in each bank, so assigning an event to multiple banks will increase the total size of your banks on disk. Whether this increase in your game’s size on disk is worth the improved ease of loading depends on your game project’s unique requirements.
Hello,
Thank you for the response!!![]()
I have another question, if you don’t mind. Is there a way or an API command to check if certain instances are loaded in the bank? Right now, I’m running into a problem where our music event didn’t play even though the library is loaded. After checking the player log, it seems it got called right before the bank finishes loading. Already enabled “Preload samples” on the bank, but it still doesn’t play. The log prints this as the error “Audio event event:/Music/Boss/*****/Main is not yet created!”
Note: the **** is a redacted name
As described in our documentation on this topic, the loading state of a bank may be polled by calling Studio::Bank::getSampleLoadingState, and the loading state of an event may be polled by calling Studio::EventDescription::getSampleLoadingState. Alternatively, you can call Studio::System::flushSampleLoading, which will block until all sample loading and unloading has completed.
Thank you for the reply, I will try using these API commands to make the checking system.