Minetest in wasm
-
- Member
- Posts: 10
- Joined: Thu Feb 06, 2020 15:46
- GitHub: karmakarmeghdip
- In-game: dark_knight
Minetest in wasm
Would be great if we could play Minetest in the browser. I believe one can compile cpp to wasm binary with emscripten and I believe clang supports it too. Modders or Gamedevelopers can integrate a browser minetest client in their project homepage and users can try it without having to download or install anything. The big problem is the graphics backend irrlicht. It doesn't have wasm support (That is being worked on as what their homepage says). Nevertheless thanks to webgl, a small openGL ES style API is exposed as from what I read. Anyway what does the community think about it? It can also be a remarkable difference from minecraft.
EDIT: If anyone never heard of WebAssembly then read this:
https://en.wikipedia.org/wiki/WebAssembly
https://webassembly.org/
EDIT: If anyone never heard of WebAssembly then read this:
https://en.wikipedia.org/wiki/WebAssembly
https://webassembly.org/
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
-
- Member
- Posts: 10
- Joined: Thu Feb 06, 2020 15:46
- GitHub: karmakarmeghdip
- In-game: dark_knight
Re: Minetest in wasm
What's the conclusion in the linked discussion. I can't find any actual answer.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Minetest in wasm
I think you underestimate how much code there is in Minetest, and how it even works internally.
Minetest needs file system access and relies on several libraries which are not available for web use.
If you have some spare time (at least an entire year), feel free to fork Minetest and try to port it somehow to web assembly.
Minetest needs file system access and relies on several libraries which are not available for web use.
If you have some spare time (at least an entire year), feel free to fork Minetest and try to port it somehow to web assembly.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Minetest in wasm
Such a port now exists:
Code: https://github.com/paradust7/minetest-wasm
Live demo: https://minetest.dustlabs.io/
Code: https://github.com/paradust7/minetest-wasm
Live demo: https://minetest.dustlabs.io/
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: Minetest in wasm
This looks very promising! I gave it a try by joining the just test server, and all seems to run smoothly. There is a small degree of latency, but not enough to detract from playability. Kudos on the great work!
What I find particularly intriguing is after browing through the official Web Assembly, homepage it states this:
"WebAssembly modules will be able to call into and out of the JavaScript context and access browser functionality through the same Web APIs accessible from JavaScript."
If I understand correctly, that means it would be possible to directly communicate with the parent web page. So dynamic multimedia content such as audio or video streams could be played, making it possible to finally have cut scenes, background music, and a variety of other interactive web-based functionality tied in with the game.
What I find particularly intriguing is after browing through the official Web Assembly, homepage it states this:
"WebAssembly modules will be able to call into and out of the JavaScript context and access browser functionality through the same Web APIs accessible from JavaScript."
If I understand correctly, that means it would be possible to directly communicate with the parent web page. So dynamic multimedia content such as audio or video streams could be played, making it possible to finally have cut scenes, background music, and a variety of other interactive web-based functionality tied in with the game.
Re: Minetest in wasm
I think both of those things are possible in vanilla Minetest. The main issue is network bandwidth to transfer multimedia. However with limited length and quality it should work fine.sorcerykid wrote: ↑Sat Aug 13, 2022 22:27If I understand correctly, that means it would be possible to directly communicate with the parent web page. So dynamic multimedia content such as audio or video streams could be played, making it possible to finally have cut scenes, background music, and a variety of other interactive web-based functionality tied in with the game.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: Minetest in wasm
Minetest doesn't support streaming video, as it doesn't even include a native video decoder. And even streaming audio isn't exactly trivial, particularly since the audio API in Minetest is very rudimentary. There are no status callbacks, moreless a way to manipulate the audio in realtime (other than changing volume).
In stark contrast, it takes just one line of code to embed an audio stream in a web browser. And from there, the Web Audio API allows for highly sophisticated control of all audio functions.
In stark contrast, it takes just one line of code to embed an audio stream in a web browser. And from there, the Web Audio API allows for highly sophisticated control of all audio functions.
minetest.dustlabs.io/ not working
After I click launch, the screen turns black. It says it attempted to re-enter a loop in the console... Any way to fix that?
I am running Mac OS.
Thank you
I am running Mac OS.
Thank you
Re: minetest.dustlabs.io/ not working
You're not going to get any support from the author on this thread. My recommendation is to open an issue on the Github repository.
I have access to a Mac computer so I decided to go ahead and test it out in Safari. It does not work in Safari according to my testing. I did not do any further testing on other browsers on Mac OS. I know it works on Chrome and Firefox on Windows.
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II
Re: minetest.dustlabs.io/ not working
Works on Windows with hardware accel, but on Mac if I turn it off it works (Only tested in Chrome)Mr. Rar wrote: ↑Tue Sep 27, 2022 13:57You're not going to get any support from the author on this thread. My recommendation is to open an issue on the Github repository.
I have access to a Mac computer so I decided to go ahead and test it out in Safari. It does not work in Safari according to my testing. I did not do any further testing on other browsers on Mac OS. I know it works on Chrome and Firefox on Windows.
Who is online
Users browsing this forum: No registered users and 42 guests