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

🚧 [WIP] FMOD web support (HTML5)

Open bitbrain opened this issue 2 years ago • 34 comments

Screenshot 2024-04-06 133323


Closes #50

This PR aims to add support for web support via wasm.

Todo

  • [x] update SConstruct to consider web as a platform
  • [x] make scons platform=web pass & build libGodotFmod.web.template_debug.wasm32.wasm correctly
  • [ ] Update documentation for how to build for web (requires Emscripten)
  • [x] Update Github Action to build for web
  • [x] Solve issue around bank file scanning (specifically file callback logic https://github.com/utopia-rise/fmod-gdextension/blob/master/src/callback/file_callbacks.cpp)
  • [ ] Solve Uncaught TypeError: Module.FMOD_JS_MixerFastpathFunction is not a function onmessage when trying to play sounds

Known issues

  • on Firefox, the GDExtension just hangs and crashes the browser. This is a known bug with wasm: https://github.com/webcompat/web-bugs/issues/127798

bitbrain avatar Apr 06 '24 12:04 bitbrain

This builds fine and GDExtension seems to load in Chrome (Firefox still does not work), but then it fails due to memory issues in the browser:

Screenshot 2024-04-11 062838 Screenshot 2024-04-11 063207

bitbrain avatar Apr 11 '24 05:04 bitbrain

Firefix also doesnt work for my SQLite plugin so I assume the issue with Firefox not working is on the side of godot-cpp itself.

2shady4u avatar Apr 11 '24 05:04 2shady4u

Hey I've been trying to take a stab at this recently to see if I can help and learn a bit more about C++. What version of emscripten and FMOD are you compiling with? From what I understand, w32 is the recommended format to work with now, why are you using the bitcode binaries instead?

EDIT: This thread on the FMOD forums seems to indicate that statically linking to the wasm binary like the build currently does will cause linking errors, I'm seeing the same ones right now. We may need to include the binaries instead like we do for the other platforms.

pmdevita avatar Aug 10 '24 19:08 pmdevita

Hello ! I worked on a little game project using FMOD with Godot using utopia's addon. If you need a tester for this PR with a small game using fmod to make a web export don't hesitate reaching out !

JalikMetagram avatar Aug 20 '24 15:08 JalikMetagram

Hey! wanted to checkup on progress of this/if it's still being worked on. If not, I'd be glad to pick up the torch and get this finished up at least on the code side of things.

Evelyn-Hill avatar Sep 14 '24 19:09 Evelyn-Hill

Feel free to try your hands on it. It hasn't been touched in months.

CedNaru avatar Sep 14 '24 20:09 CedNaru

I originally raised the PR for this but have not worked on it ever since due to hitting blockers. If anyhbody can figure out how to make it work that would be brilliant.

bitbrain avatar Sep 18 '24 14:09 bitbrain

I originally raised the PR for this but have not worked on it ever since due to hitting blockers. If anyhbody can figure out how to make it work that would be brilliant.

Could I ask what issues you ran into other than the Memory stuff listed above? I'm going to take a crack at it soon.

Evelyn-Hill avatar Sep 18 '24 14:09 Evelyn-Hill

I use GoDot and FMOD and I would pay someone to finish this

BigOrangeBoy avatar Sep 23 '24 00:09 BigOrangeBoy