Right now, when the tab is backgrounded the game is completely suspended, which makes sense because it uses requestAnimationFrame. Unfortunately this means the game completely stops responding to pings from the server, meaning that other players see the user go into the LAG state on the scoreboard and after a few seconds, the server disconnects them (at least on community servers).
Theoretically this could be solved by running the game in a Web Worker and or man-in-the-middling communication with the server in the backend and responding to pings on behalf of the user. The former would be ideal, but is extremely complicated from what I can gather. The latter is not ideal because when the user returns to the tab, there will be a significant buildup of server messages that may cause bugs or a temporary slowdown.
Right now, when the tab is backgrounded the game is completely suspended, which makes sense because it uses
requestAnimationFrame
. Unfortunately this means the game completely stops responding to pings from the server, meaning that other players see the user go into theLAG
state on the scoreboard and after a few seconds, the server disconnects them (at least on community servers).Theoretically this could be solved by running the game in a Web Worker and or man-in-the-middling communication with the server in the backend and responding to pings on behalf of the user. The former would be ideal, but is extremely complicated from what I can gather. The latter is not ideal because when the user returns to the tab, there will be a significant buildup of server messages that may cause bugs or a temporary slowdown.