colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 102 forks source link

General Issue for WEBGL app multiplayer #105

Closed aedbrault closed 4 years ago

aedbrault commented 4 years ago

Hi i search a lot but not found any good solution for it , that's why i com to you guys to found some. I have problems with sync in multiplayer game when people switch of tab , the game turn slow / or not continue to work ( loading stop to load etc... ) until switch back on the right tab. Thanks a lot for reading my issue and hope someone can help

endel commented 4 years ago

This happens to any game project compiled with emscriptten. The game loop uses requestAnimationFrame(), which runs only when the tab is active.

I've posted a similar question in the Defold forum recently: https://forum.defold.com/t/html5-game-loop-when-tab-is-not-focused/49406

I don't think this is something that can be circumvented. We just have to deal with it.