Memory management in Dialogue Audio Tables

Hey there!

I’m designing a system for managing dialogue in a complex game with multiple banks. I just want to confirm if this is a good way to go as I thought:

  • I create one dialogue audiotable per bank (banks are levels of the game more or less, like zones in the map). Let’s say for the first level it will be “forest_dialogue”
  • I put ALL of the dialogue from ALL characters involved in that level from the forest with their correspondent keys in that audiotable
  • I create events for characters for the level. So now we have “peter_dialogue_forest” and “mary_dialogue_forest”. Both using a programmer instrument pointing to the “forest_dialogue” audiotable contained in the forest level bank.
  • Then, in the next level, if peter and mary talk again, I need to create two new events “peter_dialogue_farm” and “mary_dialogue_farm” because these two now have to use the audiotable contained in this new second level “farm_dialogue” for instance.

I guess I can also use a parameter to play one programmer instrument or another from the same event as well. Like use a single “peter_dialogue” with param = 0 for playing forest audiotable programmer instrument, = 1 for playing farm audiotable programmer instrument, etc…

For memory management, it doesn’t matter which event is in which bank or when is it loaded right? memory loading happens when we load bank containing the audiotable. The programmer instrument event only points to that location when called.

Did I get all of this right? Are there any tips or advice I can take to manage this situation?

Thank you!

That mostly seems reasonable to me, except I don’t quite follow the workflow you are suggesting here:

What I’m not sure about is why it would be necessary to have a different programmer instrument for peter’s dialogue in the forest vs the farm- I would assume that whether peter says something in the farm or the forest, it could be said with the same programmer instrument regardless.

Also, you cannot assign instruments to individual banks, do you perhaps mean having referenced events for “peter_dialogue_farm” and “peter_dialogue_forest”, which contain programmer instruments?

Hi Jeff, thanks for reaching back.

Yes, I mean events with programmer instruments associated to each audiotable.

The point of having different programmer instruments on the same event (controlled by parameter to play one or another instrument) or separate events is beacuse I need to load into memory one audiotable for the forest and one for the farm, I can not have the full dialogue in one audiotable for the whole game, as it would take huge amount of memory when the bank containing the table loads into memory in the beginning of the game.

Instead of that, I considered having different audiotables in different banks with dialogues from that specific levels and load them into memory while going forward into the game levels.

I guess there are different ways to proceed with this, just wanted to know if there is any specific recommended workflow for me not to struggle in the future with anything related to keys, programmer instruments, events or memory bank loading. Or whatever I’m missing if I’m missing something here.

Thanks again for your help

Hi Jeff,

Can we get back to this topic real quick so I can close it?

thanks again, appreciate it

Of course, sorry for the delay, this fell between the cracks of more support queue somehow.

Correct, the programmer instrument can be anywhere, it does not need to be in the same bank as the audio table.

Since you do not need to have programmer instruments in the same bank as the audio table, I think having a separate event for “peter_dialogue_farm” and “peter_dialogue_forest” adds unnecessary complexity, and you could just have a “peter_dialog” event and use that to playback the sounds from whichever audio table is loaded, but perhaps I am misunderstanding your setup.

Other considerations for audio tables can be found in the Audio Tables section of our FMOD Studio documentation. Specifically make sure you don’t have audio tables on master banks.

If memory is a concern for your project, we have a number of recommendations to reduce bank size in the Banks section of our FMOD Studio documentation.

Don’t worry about the late reply, I was just checking in here. Thanks for reaching back again with this topic.

So this is my main concern. The question here would be, can you assign more than one audiotable to a single programmer instrument? Because if I have two separate banks for two separate areas, each with it’s separate audiotable for dialogue for Peter in that area, can I call from the event containing the programmer instrument “peter_dialogue” TWO different audiotables depending on where I am in the game?

Programmer Instruments and Audio Tables are completely decoupled, and you do not assign Audio Tables to Programmer Instruments- instead you use a key to lookup an entry from any audio table, and you pass that entry along to a programmer instrument inside a CREATE_PROGRAMMER_SOUND callback.
So yes, you can use a Programmer Instrument’s to play an entry from any loaded audio table, regardless of what bank it is in.