fmod-gdextension
fmod-gdextension copied to clipboard
Upgrade to Godot 4.0 (GDExtension)

This ticket is to track anything we might need to consider when upgrading to 4.0. A few initial thoughts:
- surely, we want to keep the 3.x compability - perhaps we might want to introduce a complete new repository for this (as 3.x is built on gdnative, while the 4.x version should utilise the GDExtension system)
- by using GDExtension, we might be able to finally tackle https://github.com/utopia-rise/fmod-gdnative/issues/50 as with gdnative this is rather difficult (due to its inflexibility)
- we might want to try to "just update" this repository first to 4.x to see what happens or what breaks and document it as some form of "PoC PR"
- how are we going to maintain both 3.x and 4.x in parallel? We might need to consider some sort of cherrypick mechanism like Godot has (they do it via labels and cherry-pick squash commits onto their branches)
Any feedback or ideas welcome how we can ideally introduce FMOD support for Godot 4!
TODOs
- [x] initial upgrade from GDNative -> GDExtension https://github.com/utopia-rise/fmod-gdnative/pull/123
- [ ] re-introduce passing GUT tests (insert PR link)
- [ ] run GUT tests as part of CI builds (insert PR link)
- [ ] re-introduce support for MacOS (exports currently broken, insert PR link)
- [ ] re-introduce support for Linux (insert PR link)
- [ ] re-introduce support for Android (insert PR link)
- [ ] re-introduce support for iOS (insert PR link)
- [ ] 🍒 cherry-pick https://github.com/utopia-rise/fmod-gdnative/pull/136 onto
godot-4.x - [ ] 🍒 cherry-pick https://github.com/utopia-rise/fmod-gdnative/pull/140 onto
godot-4.x - [ ] 🍒 cherry-pick https://github.com/utopia-rise/fmod-gdnative/pull/145 onto
godot-4.x - [ ] 🍒 cherry-pick https://github.com/utopia-rise/fmod-gdnative/pull/142 onto
godot-4.x - [ ] extend documentation with how to build the GDExtension (insert PR link)
- [ ] change architecture for Godot 4 -> https://github.com/utopia-rise/fmod-gdnative/issues/138
- [x] rename current
masterbranch togodot-3.xand makegodot-4.xthe new default branch (only after everything else is done!) - [x] rename repository to
godot-fmod
Hello ! This ticket is definitely a good idea.
I think we should stay with this repo for now, as we rely on godot-cpp.
I would do what we do on godot Kotlin repository: stay with master bind to current official version, and create a 4.0-adaptation branch to work and PR from for 4.0 work.
When we want to add a feature to both 3.x and 4.0, we would first do it on master, and then rebase the 4.0-adaptation branch.
By doing this way, we will keep a linear history.
@piiertho I will have a dabble at this as well, simply because I am planning to upgrade my game to Godot 4 and this plugin is the biggest blocker at the moment (Dialogic 2 is currently actively migrated to Godot 4 already)
In case you are curious what I am building with FMOD (all ingame sounds + NPC voices come from this plugin)
Started off with something very basic: https://github.com/utopia-rise/fmod-gdnative/compare/godot-4.0-adaption
Looks like includes need adjustments for sure:
fmod-gdnative\src\godot_fmod.h(4): fatal error C1083: Cannot open include file: 'Godot.hpp': No such file or directory
This tutorial suggests that now includes look more like this:
#include <classes/control.hpp>
#include <classes/global_constants.hpp>
#include <classes/viewport.hpp>
#include <core/binder_common.hpp>
Also, gdscript syntax changed completely. I am also not sure yet how we are going to "ship" the addon, as it seems to be in the format of something along the lines of fmod.gdextension with some *.dll files on the side. Can we just use it as an addon? Will this work? or do *.gdextension files need to go into the root directory of any Godot project?
I'll have a play!
Made already some decent progress on https://github.com/utopia-rise/fmod-gdnative/pull/123 but there is still some way to go (see TODOs). Eventually, once the PR gets merged into the godot-4.x branch we might want to consider asking some non-technical questions:
- when should we do the "official switch" to the Godot 4 branch as the default one? (so the current
masterbecomesgodot-3.xand is probably just maintenance then?) - should we consider renaming this repository once we do the switch?
fmod-gdnativemakes sense for Godot 3 but something likefmod-gdextensionmight be a better name for Godot 4 once we do the swap
Another name idea for this repo could be simply godot-fmod
I had a poke at the godot-4.x branch recently and found an issue with exported projects where calls to Fmod.load_file_as_sound (possibly load_file_as_music too) cause an access violation. With those components removed, the demo project does export and play the other sounds from banks correctly.
Has there been much update to this? Really hoping that a stable godot 4.x fmod plugin makes it's way to the asset store eventually. Once you've seen what fmod can do, it's tricky going back to godot's default audio system.