Jump to content

Official Audio Support?


Recommended Posts

Although I sort of figured out how to add audio to the game, right now there isn't much audio support officially. They include things like building audio bank using the same masterbus guid, playing audio event on the right bank, and some other issues with loading audio files.

There are some things that I have figured it out by my own. I used Unity to extract the guid of master bus of the audio bank so that the modded audio bank is compatible with the game's audio bank. I have made a workaround script to load the audio banks into the game and redirect the audio events to the correct bank. I have also extracted the guid of VCAs so that audio events are affected by the correct audio slider. All of these are possible right now, although they are not beginner friendly, as it requires a lot of manual editing of files to override the guid. I hope there is an official support for audio loading.

Another issue, which I can't figure out, is that if you reload the game using Ctrl+R and you loaded modded audio banks, for some reason it crashes(not LUA crash, but straight up crash and dumping the memory). It also seems inconsistent at times. I have no idea what triggered it. There is probably some issues with the engine, which I can't fix since it is compiled from C++. Otherwise it doesn't seem to affect the game. I hope this gets fixed, as it is very annoying and defeats the purpose of fast reloading the game.

Link to comment
Share on other sites

  • Developer

Official mod support for audio won't be forthcoming at this time.  Regarding the crash, I imagine something about having multiple audio banks loaded is crashing FMOD.  I apologize as I realize that's not very helpful, but I'm not too familiar with the FMOD internals myself.  If you manage to release a copy of your audio mod, I could try loading it in the debugger to see if the crash is reproduceable.

 

Link to comment
Share on other sites

This is the mod that I tried to test the audio on:

https://github.com/RageLeague/DemocraticRace/tree/dev

The audio part is not published on the main branch. The branch with the audio is called "dev". It is (mostly) stable.

When you load up the mod, you can go to the settings and click the option called "[Debug] Enable Audio For the Next Game", and it will cause the next load of the game to load the audio bank as well. This is done to prevent the audio getting loaded each time and crash the game when I restart.

Also fair warning, this mod replaces a lot of the base game's function.

Link to comment
Share on other sites

  • Developer

I managed to reproduce the crash in the debugger, but unfortunately the callstack is indeed deep in the FMOD DLL and we don't have the source code to give any more hints  Sometimes it crashes when unloading banks, and sometimes it happens when loading the regular game bank after a reset.  I imagine the modded banks/loading multiple banks are violating some unspoken FMOD assumption about how they should be structured.  Sorry I couldn't be of more help.

 

Link to comment
Share on other sites

On 6/24/2021 at 11:32 AM, rooks said:

I managed to reproduce the crash in the debugger, but unfortunately the callstack is indeed deep in the FMOD DLL and we don't have the source code to give any more hints  Sometimes it crashes when unloading banks, and sometimes it happens when loading the regular game bank after a reset.  I imagine the modded banks/loading multiple banks are violating some unspoken FMOD assumption about how they should be structured.  Sorry I couldn't be of more help.

 

Maybe it's something wrong with my bank in particular. I did edit the metadata manually. Can you perhaps make a simple modded audio using a bank created following this? https://fmod.com/resources/documentation-studio?version=2.00&page=supporting-downloadable-and-user-generated-content.html

This is a bit interesting.

I tried to do the reset thing to try and reload the bank. I added a debug print "Load bank?" to determine where I am loading the bank file, and this appears in my log when the game first start up.

Spoiler

15:04.12-Lua: [profile path]\mods/DemocraticRace/modinit.lua(224,1)    Load bank?
15:04.12-General: Loaded 'DEMOCRATICRACE:assets/audio/Master.bank' [0000000000200400] with 1 vcas, 4 groups, 1 events, 0 strings.

When I use Ctrl+R and reset the game, this shows up:

Spoiler

15:04.22-Lua: [profile path]\mods/DemocraticRace/modinit.lua(224,1)    Load bank?
15:04.22-General: FMOD error! (70) The specified bank has already been loaded.
15:04.22-Lua: scripts/audiosystem.lua(534,1)    failed to load    DEMOCRATICRACE:assets/audio/Master.bank

Which makes me believe that when the game reset, the banks may not be properly unloaded.

It's only this bank in particular, though, and not the string bank, which is very confusing.

Link to comment
Share on other sites

Okay, I tested my bank file by loading the game's bank and my custom bank using Unity. It crashes Unity when it is unloaded, with a bunch of complicated error in FMOD. So I'm just going to assume that there is something wrong with my bank file. Probably a side effect of manually editing the guid of the master bank to match the game's one.

Maybe we can try the official way from FMOD of supporting user generated content, which is documented here: https://fmod.com/resources/documentation-studio?version=2.00&page=supporting-downloadable-and-user-generated-content.html.

According to the instructions above, we either need the FMOD project file(NOT the bank file, because the process is one way), or a packaged copy of the project if you want to limit some aspects of editing. To create a packaged copy, go to "File > Package Project..." and follow the dialog there.

@rooks Can we get either the original project file or a packaged project file, depending on what you want the players to access? Thanks.

Link to comment
Share on other sites

  • Developer

I'll see if I can look into this next week.  I don't actually have any of the audio files checked out on my machine (because it's biiiig!), so I'll check with the audio folks to see if they can package something up and we can go from there.

 

Link to comment
Share on other sites

  • Developer

Just an update -- it's being worked on by our audio guru, but takes a bit of time as he has to go through the project and individually prune relevant content.  Will keep you all posted.

Link to comment
Share on other sites

  • Developer

Hi all, here is an fmod project hopefully suitable for modding.  I'm told it's got some example events for aid, but no audio data.  There may be a bit of back and forth as we iron out the kinks but it's a starting point.  If anyone has luck with it (or not), we'd be happy to hear about it.

GL_moddableFmod.zip

Link to comment
Share on other sites

On 8/5/2021 at 8:43 AM, rooks said:

Hi all, here is an fmod project hopefully suitable for modding.  I'm told it's got some example events for aid, but no audio data.  There may be a bit of back and forth as we iron out the kinks but it's a starting point.  If anyone has luck with it (or not), we'd be happy to hear about it.

GL_moddableFmod.zip 2.04 MB · 1 download

Thanks.

I just tested it, and it seems to be able to add new banks without the game crashing on restart. Seems like a success.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...