-
-
Notifications
You must be signed in to change notification settings - Fork 843
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The Network RTT calculation becomes highly inaccurate after an online scene is loaded with ServerChangeScene. This is due to all messages being blocked by server and client whenever a scene is being loaded. If the scene takes a long time to load, EMA for NetworkTime.cs will be thrown off.
How can we reproduce the issue, step by step:
- Using "Room" example...
- In
OfflineScene, addNetworkPingDisplaycomponent to theNetworkRoomManagergame object.
-> Since the example room scene is simple, it loads really fast, so we need to artificially create a loading delay. - In
NetworkRoomManagerExt.OnGUI()I added...
...
ServerChangeScene(GameplayScene);
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
static async void foo()
{
loadingSceneAsync.allowSceneActivation = false;
await System.Threading.Tasks.Task.Delay(5000);
loadingSceneAsync.allowSceneActivation = true;
};
foo();
// ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑- Open project on new instance of Unity editor (could use ParrelSync)
- Run game on both Unity editors (start host on one, start client on the other)
- Ready players on both clients, and start game on host client
- Scene should take 5 seconds to load after which you should see the RTT on the client rise significantly (usually in the 1000s)
Expected behavior
Ideally, NetworkPingMessage should still go through while loading a scene so that server/client RTT calculation always stays as accurate as possible.
Desktop:
- OS: Windows
- Build target: Android, Windows
- Unity version:
v2021.3.8f1 - Mirror branch: master
Additional context
After a while, the RTT will settle back down to a more accurate number, usually this takes a few seconds to happen.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
