Minetest for the Web
minetest.dustlabs.io
minetest.dustlabs.io
There's an updated launcher. It's not finished yet, but it is nicer for exploring single-player community-made games: https://minetest.dustlabs.io/ez/
I'm not actively working on this, as I have concluded it is not (yet) possible to create a good web experience. There are problems with storage, network, keyboard side effects (e.g. Ctrl, W), concurrency, and performance that need to be addressed by browser vendors. I highly recommend installing the native Minetest!
You can intercept and cancel the standard browser events and therefore prevent closing the tab for example with Strg W.
Storage option on the web for more data is indexedDB. It is quite fast and stable by now.
What kind of network issues do you have?
But general performance I would not suspect to go drastically up anytime soon, since you already use wasm. (Unless you find some emscripten flags, that speed up things, but this is not my area)
For storage, a bare minimum Minetest world needs 1GB, grow-able to multiple gigabytes. I don't think IndexedDB is meant for that.
The network issues are specific to Firefox. Multiple threads in Minetest do network I/O. In Chrome this works fine, but on Firefox only the main thread can do I/O, and so network requests are proxied to the main thread (this is done transparently by Firefox, using a mutex internal to firefox). Unfortunately this arrangement leads to a deadlock given the particular way it is used.
It actually is. My app also uses way over 1 GB after a while with no issues. The global limit is just tied to the users avaiable free space.
"The maximum browser storage space is dynamic — it is based on your hard drive size. The global limit is calculated as 50% of free disk space."
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_A...
"The network issues are specific to Firefox"
And honestly, I would not care too much and just make it clear, that it does not yet run stable in firefox and recommend chromium. (With a link to the technical limitations of what you just wrote, so you do not get yelled at so much by the firefox only crowd, who otherwise assume you did it out of evil neglect)
I regretted the huge amount of work I did to cater to firefox limitations. Its market share is just too low and chromium works also on linux.
(I use FF for browsing myself though)
This port uses a proxy for networking, as the main game uses UDP-based networking [2]. Perhaps it would be possible to upstream basic WebSocket/WebRTC packet-wrapping support to the servers in the main Minetest project?
I am also curious about the storage issues.
[1]: https://source.chromium.org/chromium/chromium/src/+/main:chr...
I definitely did overwrite it in my app, but I just checked and remembered, that you also have to be in full screen mode.
[1]: https://caniuse.com/mdn-api_keyboard
[2]: https://developer.mozilla.org/en-US/docs/Web/API/Keyboard_AP...
Do you think the browser issues are being addressed already or will be addressed soon? or do you think it's a low priority for them? I would think enabling complex WASM apps would be a priority (especially for Google/Chrome) but you never know.
The UX issues do seem to be stubbornly persistent though. I ran into the same issues long ago porting games with NaCl and asm.js. I'm not sure what is preventing progress there.
For what it's worth, when porting NetCraft I did make an effort to isolate, fix and upstream various UX fixes to Emscripten:
https://github.com/satoshinm/emglfwbugs
with _some_ success; the developers of Emscripten are happy to accept pull requests. But I agree there's a lot of papercuts, and tracking down each of the usability nits could essentially be a full-time job...
For the keybinding problem, I've found using backquote/tilde key for escape can sufficiently workaround the un-interceptable escape key. It also works well on mobile browsers without escape keys.
But the problems with multi-gigabyte world storage, multi-threaded networking, SharedArrayBuffer, may require more invasive architectural changes. At this point, maybe a rewrite focused on web support from the beginning would easier than a port? But _a lot_ of work was put into Minetest over the years, it is great having the library of mods already developed for Minetest, available on the web. Although the same could be said for Minecraft itself.
In any case, thank you for your work porting Minetest to the web. I appreciate it moving the needle in the "web-based Minecraft clone" niche. Even if it may not the be all to end all, hopefully the UX blockers can be resolved, fit and finish, if not in Minetest itself maybe it will inspire others to create something anew with lessons learned from your port. One step closer to the metaverse.
A web-based "Minecraft" has great potential, in my opinion, and has long been a dream of mine. My humble attempt at such a project: https://satoshinm.github.io/NetCraft/ (2017) - a port of Michael Fogleman's Craft, a simple Minecraft clone written in C, ported to the web using WebAssembly and Emscripten. It works, reasonably well (after a few small enhancements/fixes to Emscripten) but did not get very far. But it could be so much more, a "metaverse", if you will.
Minetest is a much more sophisticated application: paradust7's minetest-wasm port, even in its early stages, is already quite impressive. If it can be optimized, with streamlined add-on installation, seamless multiplayer/networking support, browser compatibility improved - I would not be surprised if this project catches on and gives Minecraft a run for its money.
Having the ability to easily casually play within a web browser, no install needed, is a massive advantage over the Java or C++ implementations of Minecraft - which have not (officially) embraced modding to the extent Minetest has. If successful, this project could capture the large and diverse community of Minecraft modders - able to more seamlessly deliver their creative content through the web. Excited to see how it develops further.
It's packaged on most distros also so you can probably `apt get install minetest` or `dnf install minetest` and have it running. You can host games on the LAN from your machine, or you can easily start a server. On fedora you can trivially `dnf install minetest-server` and then run `minetestserver` and you've got a server!
Anyone here got experience running both Minecraft and Minetest servers? How do they compare?
The other voxel OS game is : https://veloren.net/
I've tried base mineclone2 and mineclone 5 and they just feel like a clunkier version of minecraft. I played Minecraft Alpha and that was more polished.
So basically, it's the minetest game with a number of additions to make survival mode more interesting or convenient (dfcaverns, mobs, travelnet, unified_inventory, ropes), some automation I haven't used yet (mesecons, digilines, signs_bot), some things that sounded cool but haven't tried yet (tubelibe, signs ) and other things that round out the world (wool, dyes, vines).
I make a small number of concessions in survival mode: occasional use of flying, XYZ location, extremely rare use of the chest of everything or /giveme. And a stratum of iron at -8 :)
My current focus is on dfcaverns- massive caves with different ecosystems that involve digging deep. For exmaple, in minetest, ores often don't show up frequently until you get to -1024, which means digging straight down and building elevators for a while.
I played Mineclone 5 for a while and it was mostly feature complete for what I wanted to do, but it doesn't play with other mods all that well, while all the mods I selected have good interoperability.
Amusingly, very early versions of Minecraft circa 2009 _did_ run on the web browser: as a Java applet. This was short lived, and of course since 2017, Java applets are completely deprecated.
Mojang also published a JavaScript implementation of Minecraft at https://classic.minecraft.net/. You can share a link to play multiplayer. However, it is only a version of Minecraft "classic" (reports as 0.0.23a_01), and even then, a reimplementation, not 100% faithful to the original. It seems to be more of a "hey look what you can run your browser" cool tech demo of WebGL and WebRTC, than a serious multiplayer survival game.
Hopefully Minetest for the Web can succeed in this niche. I, for one, am rooting for them.
Why is WASM not used as extensively as Flash and Java were?
Uncaught TypeError: GLctx is undefined
--
Firefox 105 on Linux 64-bit (ElementaryOS)
(as an example:)
https://github.com/tenplus1/minetest_game/blob/master/mods/f...
That code would run server side, but there is some recent work for client-side scripts as well.