3 ms·
I've been working on making a base or skeleton game engine for when I participate in Itch.io game jams that compiles from C++ to web assembly using Emscripten.
by phaedrus 3y ago
I've been working on making a base or skeleton game engine for when I participate in Itch.io game jams that compiles from C++ to web assembly using Emscripten. It's exactly as you say no one wants to download and run an unknown binary blob; this severely limits how many people will try your game.
I'm alternately impressed that I can port C++ in this way at all, and sad at the state of the tooling still after so long. When something goes wrong with the web assembly version of the project, I can't debug it from first principles. This could be because, as an embedded and C++ programmer, I'm unfamiliar with Javascript debugging tools, but it's still unfortunate I can't single step through at the C++ source code level when debugging the web assembly build. I just want gdb for web assembly.
I've also run into silly/stupid bugs like keyboard input not working only in fullscreen, except if you leave it on overnight in which case 1 out of N tries the keyboard input comes back. I spent days trying to debug this, only to have someone on a forum answer it in about 2 seconds that it's because a Firefox change now causes keyboard input to be captured by the awesome bar during fullscreen (which of course you can't see). I could have tried this for a million years to figure out what was wrong and not had that insight. It doesn't bode well for my game engine project if things are this fragile; no other C++ compilation target is this janky.
- pengaru 3y agoI experienced similar frustration using Emscripten to ~port a simple C+SDL2+GLES2 game to wasm. While it mostly worked, it wasn't a very polished environment and how well it worked depended greatly on which browser was used. And even in the best case there were still annoyances surrounding things like fullscreen handling. It all echoed of 90s-era web development when we had to test every browser and kludge browser-specific exceptions due to incompatibilities. It's been over a decade since I cared about web stuff, so maybe this is just the way it still is in general and not just emscripten/wasm support. Whatever the reason, it didn't inspire much confidence to rely on this pipeline for delivering native+web games to the masses in a single implementation.