fmod-gdextension icon indicating copy to clipboard operation
fmod-gdextension copied to clipboard

Why the artificial event limit? MAX_EVENT_COUNT 256

Open michaelhartung opened this issue 1 year ago • 5 comments

Hi,

Is there a specific reason why this integration limits the number of events a bank can hold to 256?

It took me a bit to track down why my banks where not loading all of the contained events :).

I could have probably found the reason earlier if the log in the CHECK_SIZE macro would have actually showed up in Godots Output Log, but it didn't because Godot 3.5 doesn't like getting hammered with log messages.

image

Some more context, I'm working on a narative game and we will have some ~3500 vo events alone.

Ideally we would have liked to use FMOD programmer instruments but this feature doesn't seem supported by this integration. For now I just created a bunch of smaller banks to work around this limit, but before I fork and adjust this myself I wanted to understand why this limit exists in the first place :).

Many thanks in advance, Michael

michaelhartung avatar Apr 06 '23 12:04 michaelhartung

Hi, The upper limit can be increased. It's just that I need to provide FMOD with an array of a fixed size when querying the events, so I picked 256 as a base size, assuming that the total numbers of events would be split into smaller banks anyway.

So yeah, just to be clear, the max number doesn't have to be 256, but I still need to set an upper limit (and obviously I won't allocate a 4GB array for that).

CedNaru avatar Apr 10 '23 14:04 CedNaru

Btw, what is the programmer instruments feature you are talking about ?

CedNaru avatar Apr 10 '23 14:04 CedNaru

Thanks for the response!

Programmer instruments are special "instruments" that you can add to an event, that allow you to load audio files "into events" at runtime and have them play "through" that event (including the group mixer, fx, etc.).

Their main usage is for voice over (localisation) and to avoid having to create/manage gigantic banks for that. They require certain callbacks that don't seem to be available by this implementation.

[1] https://www.fmod.com/docs/2.02/studio/glossary.html#programmer-instrument [2] https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_programmer_sound_properties [3] https://www.fmod.com/docs/2.02/api/studio-guide.html#dialogue-and-localization

michaelhartung avatar Apr 11 '23 06:04 michaelhartung

I see, I'll add this on the list of features to add to that plugin. But from now, works for this plugin shift to Godot 4.x so I don't really plan to add this to the Godot 3.x version. I can raise the event limit for Godot 3.x if you wish, but it's unlikely that I add programmer instruments for it.

CedNaru avatar Apr 11 '23 12:04 CedNaru

Thank you!

In case you don't want the raised limit to make into your repo I can just do a fork for the project I'm working on and adjust to our needs (and maybe tackle the programmer instrument support if time permits).

And just in case you're not aware, there is a fairly complete FMOD implementation for Godot 4 available:

https://github.com/alessandrofama/fmod-for-godot

michaelhartung avatar Apr 11 '23 16:04 michaelhartung