The problem is this:
In the multi-player game js and asm.js, I have two loops.
One handles the actual game tics, such as position position, speed and battle.
Another handles rendering of this world on canvas so that the user can see.
What I would like to do is when the processor / GPU (they did the same on some machines now, I can’t say that I am happy with this) is too burdened, the rendering cycle should skip and therefore stop changing canvas. That is, freezing the game screen in the lags of the lag.
At the same time, a small computing power is used to successfully complete the actual tick of the game, preventing desynchronization with other game clients.
(This is an RTS game when it comes to loading, so user input is sent over the network instead of the positions of all objects).
Otherwise, the client will have to kick other clients, or all clients will have to suspend its reconnection and re-synchronization. that is bad bad bad!
, , , . -, , , " " , . , , , , , , - , .
, ( ) , , , ( 10 ).
, , , ?
: , / , (.. 100 , , / ).