utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
439 stars 48 forks source link

Why the artificial event limit? MAX_EVENT_COUNT 256 #152

Open michaelhartung opened 1 year ago

michaelhartung commented 1 year ago

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

CedNaru commented 1 year ago

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 commented 1 year ago

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

michaelhartung commented 1 year ago

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

CedNaru commented 1 year ago

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.

michaelhartung commented 1 year ago

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