Minetest in wasm

Post Reply
dark_knight
Member
Posts: 10
Joined: Thu Feb 06, 2020 15:46
GitHub: karmakarmeghdip
In-game: dark_knight

Minetest in wasm

by dark_knight » Post

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/

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Minetest in wasm

by sorcerykid » Post

This has been brought up before: MineTest browser

Might be worth adding to the discussion there.

dark_knight
Member
Posts: 10
Joined: Thu Feb 06, 2020 15:46
GitHub: karmakarmeghdip
In-game: dark_knight

Re: Minetest in wasm

by dark_knight » Post

What's the conclusion in the linked discussion. I can't find any actual answer.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Minetest in wasm

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: Minetest in wasm

by Mr. Rar » Post

"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

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Minetest in wasm

by sorcerykid » Post

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!

Image

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.

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: Minetest in wasm

by Mr. Rar » Post

sorcerykid wrote:
Sat Aug 13, 2022 22:27
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.
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.
"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

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Minetest in wasm

by sorcerykid » Post

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.

LLucas2
New member
Posts: 2
Joined: Sun Sep 25, 2022 19:34
IRC: LLucas
In-game: LLucas2

minetest.dustlabs.io/ not working

by LLucas2 » Post

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

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: minetest.dustlabs.io/ not working

by Mr. Rar » Post

LLucas2 wrote:
Sun Sep 25, 2022 19:48
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
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

LLucas2
New member
Posts: 2
Joined: Sun Sep 25, 2022 19:34
IRC: LLucas
In-game: LLucas2

Re: minetest.dustlabs.io/ not working

by LLucas2 » Post

Mr. Rar wrote:
Tue Sep 27, 2022 13:57
LLucas2 wrote:
Sun Sep 25, 2022 19:48
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
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.
Works on Windows with hardware accel, but on Mac if I turn it off it works (Only tested in Chrome)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests