We implemented integration of FMOD Studio with our custom engine and encountered problem with event lookup by path if that event was created during live update session.
Steps to reproduce:
Start the game
Start FMOD Studio and connect to the game using live update
Create new event, assign it to Master bank, add audio track
Copy created event path and try to play it from game using that path
Result:
Event is not played and API returns ERROR 74: The requested event, parameter, bus or vca could not be found.
If instead of the event’s path we copy it’s GUID and try play it from the game the same way it will be played and everything works as expected. Unfortunately, our workflow expects all events to be configured using events’ paths and not being able to use paths during live update sessions makes life a lot harder for our designers.
I want to confirm that behaviour described above is expected or if there is issue in implementation of our integration.
We are using FMOD Studio 2.0.12.
UPD. When events loaded normally, via banks loading, event lookup by path works properly and no issues are encountered.
Hi, I haven’t tried re-building during the game before, this workflow sounds really interesting. Since getting by GUID is working is it possible the strings bank isn’t also being updated?
To make it clear, steps described in original post are the only actions that are performed. We don’t rebuild banks/do not reload banks in game to make this new event playable by GUID. So yes, strings bank is not being updated, and all other banks also stay untouched.
Any and every change you make to your project during a live update session is immediately propagated to your game, and there are no restrictions on the kind of changes you can make.
Which implies that path-to-guid mapping is also auto synced during live update, but it might be just a poor wording and this is not how things actually work.
Sorry, I understand now. Yes, it looks like both paths and GUIDs should be live updated for new created events during the session.
If you create a new event during a live update session, you will need to add appropriate triggers for that event to your game if you want your game to play it. Similarly, if you change an event’s path to something other than what your game currently uses to identify it, or replace an event that your game identifies by GUID, that event will not play until you update your game code to use the new path or GUID.
I’m curious, what happens if you log the event paths of the Master bank?
Live Update does not currently send strings bank updates, hence why you can only find the event by GUID. The usual engine integration workflow involves syncing banks at design time in the editor when placing events, then using Live Update at runtime to tweak and alter how they sound. This is how our Unity / UE4 integrations work.
I’ve recorded your request into our tracker for later investigation however this is not something on our sort term roadmap.
EDIT: I’ve made a note to clarify this point in our documentation.
Hello,
I’m running into this same issue and reloading banks isn’t possible because building the bank is failing. It seems like loading the bank locks the file, which prevents FMod studio from building a new version of it. Should I be making a temporary copy of my banks on disk before loading them to enable this scenario? Curious what the recommended workflow is for the proposed workaround in this thread to function.
Thanks
The cause of the banks being locked when trying to trigger a rebuild is that the Studio system is actively performing an operation on the bank file on disk. This could be caused by any number of operations that require data to be read from a bank, but the most common ongoing reason at runtime would be that a stream is active.
Stopping any ongoing file operations (i.e. in the case of streams, stopping any events that are playing streaming assets) should allow you to rebuild the banks in place, after which you can reload them via the API. However, given that the banks need to be reloaded anyway, you may find it easier to unload the banks in question via the API, trigger a rebuild in Studio, and then load them via the API again.
You could simplify this process by triggering a Studio bank build with studio.project.build() via Studio’s terminal using a TCP/IP connection at runtime instead of from Studio. For a C# example of this, take a look at how EditorUtils handles this in the FMOD for Unity integration, specifically EditorUtils.SendScriptCommand() and EditorUtils.ScriptStream.
This would allow you to build banks from Studio, but you would likely run into a similar file lock issue when trying to copy the updated banks if the existing banks are still in use.
Just following up on this - did you manage to work around the bank file handles still being active with what I mentioned? If not, did you run into any other issues?
At this point I believe the issue is because my music has a stream playing. At some point I will come up with a way to track all the FMOD Studio events I’ve started playing so I can stop them all and then restart them after rebuilding and reloading the bank.
I expect this will work, but I will follow up here if it does not. Thank you for your assistance.