Hacker News new | ask | show | jobs
by hutzlibu 1344 days ago
"keyboard side effects(e.g. Ctrl, W), "

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)

2 comments

A handful of key combinations cannot be cancelled. With the Full Screen API, the page also loses use of the ESC key, which is extremely important to Minetest's menu interface. (That's why F11 is the recommended way to go full screen)

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.

"For storage, a bare minimum Minetest world needs 1GB, grow-able to multiple gigabytes. I don't think IndexedDB is meant for that."

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)

You actually can't override a few of the events such as Control-W [1], however that could easily be fixed by using an alternate keybind for the game instead.

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...

[2]: https://dev.minetest.net/Engine/Network_Protocol

"You actually can't override a few of the events such as Control-W"

I definitely did overwrite it in my app, but I just checked and remembered, that you also have to be in full screen mode.

Although the support isn't amazing [1], I believe you can capture C-w and friends [2].

[1]: https://caniuse.com/mdn-api_keyboard

[2]: https://developer.mozilla.org/en-US/docs/Web/API/Keyboard_AP...

WebRTC data channels would be ideal, so that clients can connect directly to servers (or at least regional proxies) in a UDP-like way. Vanilla minetest would need to include an WebRTC endpoint for this to become universally available. There are lots of details that would need to be worked out.