I wrote a blog post about my slightly unusual way to add modding support to my game, using Zig and WASM. I’ve been sitting on this blog post for a while. Figured it was finally time to finish it up.
Feedback is welcome!
I wrote a blog post about my slightly unusual way to add modding support to my game, using Zig and WASM. I’ve been sitting on this blog post for a while. Figured it was finally time to finish it up.
Feedback is welcome!
This is the way ![]()
I was expecting that this wasm-micro-runtime is interpreting, but apparently it can do either AOT or JIT (GitHub - bytecodealliance/wasm-micro-runtime: WebAssembly Micro Runtime (WAMR) · GitHub). Really cool!
That’s a great use of WebAssembly beyond the browser. Basically the c++ game engine becomes the kernel/runtime. The WebAsm becomes the scripting intermediate language calling/called by the engine. Potentially you could use any language that can target WebAsm for the mod/scripting part. Thanks for sharing the details of how each component interact. Kudos for a cool project.
Yep, I’ve actually done minimal mod tests using Odin, C3 and Jai, just for fun, and I’ve done it all on live stream. You can find the relevant streams here:
Odin (and a bit of C3): https://www.youtube.com/watch?v=cCdbhAWj9Ig
C3: https://www.youtube.com/watch?v=x_Bv5l2qpxI
Jai: https://www.youtube.com/watch?v=v4tZ4az2n98
I’ve only done the dll part though for those languages, but transitioning to WASM should be much the same as for Zig. Not saying I would be providing official support for any of those languages, but trying different ones is fun ![]()
EDIT: Changed the links to code tags, as this reply becomes quite obnoxious when all of the YT links expand into embedded players.