I posted a fairly minimal pull request showing the basic changes needed: Īfter that, the other major change is networking. Emscripten's GLFW3 wrapper covers nearly all of Craft's usage.
Then update the cmake build file to build with the Emscripten.cmake module, and you're almost done. The initial requirement is to refactor the main loop, from while(1) to emscripten_set_main_loop, a common step for most all emscripten ports. I briefly tried porting a few other open source block-style engines without success, but Craft being written in plain C with only a few libraries is relatively straightforward. It was surprisingly easy to port from Michael Fogleman's Craft ( ).
Hey thanks for finding my project! I haven't posted about it much, so its cool to see it being noticed.įor those curious, is my first project with WebAssembly/emscripten. Would anyone know more about how hard porting something like this would be? Obstacles in Minetest that I can identify would be the heavy use of the filesystem, the use of UDP sockets and memory sharing between threads. The non-JIT version of Lua is compatible as well. Then again, seeing different languages and noticing their similarities can be educational in itself.įinally, I've been wondering how hard it would be to port something like Minetest to Emscripten. The Lua language isn't used much currently in the education environment, which is mostly focused around Scratch, Python and sometimes Javascript.
For example, this is a mod to spread flowers and mushrooms around the map. Modifications like the examples in Teachcraft can also be built in Lua. It has a C++ core based on the Irrlicht 3D engine, but many of the game mechanics are implemented in Lua. It's surprisingly complete, and could also have great uses in (programming) education. To this end, I've been toying around a bit with an open source Minecraft clone called Minetest lately. One obstacle for schools to get started with this however, is buying all the Minecraft licenses. There have been some efforts over the years, but this looks really complete. Looks like a great guide to get started with coding with Minecraft.