[FEATURE REQUEST] WebAssembly Build #879
|
As the title suggest, i'll also try and then post progress: Regards. |
Replies: 11 comments 6 replies
|
Hey, I've looked into it and there is nothing I can do, unless you throw glfw away. Also there is gopherjs which compiles go to js, but I'm unsure it will work, since there are still c bindings. If you got a better idea/plan feel free to suggest, and I'll look into it: The easiest approach(I think) would be like I said, skipping glfw and writing directly in goGL. Regards nice cock |
|
I'm moving forward, probably just on the easy parts The general Plan is
FileSystem and Controllers are likely the easiest but I need some help So I'm having some issues with Go Generics FileSystem
This is my first time getting deep into go so any guidence would be appreciated |
|
Hi, any news on this? |
|
I was able to get the filesystem out of the way but audio and drawing is more complicated Now that ikemen go is using the latest beep audio should be less of an issue I don't remember looking into controllers but I probably need someone to point me into the write direction Here was my pull request #1639 |
|
Hi all, following up on this item we got Ikemen GO running fully in the browser & there's a live demo below: https://mathmati.github.io/fiiight/ It's the current develop engine (05b7d98) compiled with GOOS=js GOARCH=wasm, no server side, runs entirely client-side: New js-tagged backend files alongside the SDL ones: WebGL2 renderer (ported from the GLES 3.2 backend), WebAudio sink wrapping the same final-mix interface as the SDL speaker, keyboard + Gamepad API input with save-file-compatible key names, and a canvas window whose SwapBuffers blocks on requestAnimationFrame so the loop yields every frame. Known gaps: netplay (raw TCP/UDP doesn't exist in browsers - a WebRTC DataChannel transport is the plan) and module music (.xm/.mod/.it/.s3m); 3D-model shadows are disabled (WebGL2 has no geometry shaders). Background videos, streamed music and MIDI (via a bundled soundfont) all work. If there's interest in taking this upstream I'm happy to open a PR and adapt to whatever structure you prefer. Roster note: the bundle includes Takezo and Genpaku by @donswelt (KGenjuro) as they were fully original, hand-drawn, and their small animated intro stories helped test a few things in the port (storyboards, MIDI music, video). I've included them with a note and accreditation in the bundle manifest but please KGenjuro let me know if you're happy with them staying in, or would rather I removed them. I wanted some demo characters beyond the Kung Fu Man cast, but it's hard finding IP-safe things for a clean baseline repo, if others have open characters from original IP that could be included, let me know. For transparency we are using Claude Code as well while working on this. |
|
Hi, @mathmati, I went through the port, the seam document, build scripts and browser-side code. I also tested it on my laptop and in Brave on my phone, and it seems to be working just fine. I'm personally in favor of upstreaming it, if you're also willing to help maintain the upstreamed WASM code, look into browser-specific bugs or regressions that come up after it's merged and finish the work on netplay integration (can be done post merge). Before preparing the PR, please join our Discord so we can discuss it with the other active devs and collect any additional feedback or objections: I don't want to promise the merge on behalf of everyone before that discussion, but my general direction would be:
We could update our release pipeline to build an Ikemen_GO-nightly-Web.zip artifact containing the static host directory and official screenpack bundle. Users would be able to unzip it, replace or regenerate content.zip, and host it on any suitable static server. The pipeline could also deploy an official nightly showcase under ikemen-engine.github.io/play/. The Claude Code note is fine, and thanks for being transparent about it. It doesn't change the normal review requirements. The important part is that the submitted code is understood, testable and maintainable by its contributors. edit: discussion started here: https://discord.com/channels/233345562261323776/233363722934943744/1526174334627090452 |
|
Thanks. There were no objections to upstreaming the Web port in the Discord discussion. Review and merging may take some time since we are currently preparing the 1.0 release. This will probably end up in a release after 1.0, but there is no need to wait before opening the PR. The main issue I noticed after a quick look through the diff is the workaround under I'm also not sure we need the smoke tests in their current form since that's something extra to maintain. Once this is upstreamed, we plan to have a working showcase built from |
|
Thanks, on these:
Checking these and seem ok so I'll push them to the branch. No issue on timing - I'll get the PR up & you can decide when to do it, I'm happy to have it working and maybe I'll find a few other improvements before it gets incorporated. |
|
we're currently discussing dropping Windows 7 support and moving to Go 1.23. More and more of our dependencies are dropping support for older Go versions (for example beep author made us a favor to maintain 1.20 branch just for us), so we'd have to make this move sooner or later anyway. We'll test whether the build works on Windows 7 with VxKex, and if it does, we’ll most likely bump the Go version. So no need to worry about those dependencies for now - feel free to prepare the PR using Go 1.23. |
|
Thanks, good to know. The browser version should still work for Windows 7 users - looking the last supported browser was Chrome 109 & it seems to support WASM etc. Would need a test run but would hopefully mean they can still play in-browser with no install. I think the only thing we'd gain with 1.23 is being able to add FLAC back to the browser build and as it stands it should fail gracefully (i.e. just be silent) so maybe I just leave it for now unless FLAC is more common than it seems to be. |
|
@mathmati @K4thos hey guys! I have a sample project you can take a look at if you need help setting up the netcode for it: |
Hi all, following up on this item we got Ikemen GO running fully in the browser & there's a live demo below:
https://mathmati.github.io/fiiight/
It's the current develop engine (05b7d98) compiled with GOOS=js GOARCH=wasm, no server side, runs entirely client-side:
New js-tagged backend files alongside the SDL ones: WebGL2 renderer (ported from the GLES 3.2 backend), WebAudio sink wrapping the same final-mix interface as the SDL speaker, keyboard + Gamepad API input with save-file-compatible key names, and a canvas window whose SwapBuffers blocks on requestAnimationFrame so the loop yields every frame.
Game content ships as a single zip mounted on an in-memory Node-style fs shim (what wasm…