Closed celfox closed 5 years ago
@celfox Have you tried with Bolt 1.2.8?
Sorry for the massive delay, updating to 1.2.8 broke a lot of things and it took a while to fix them.
After trying the update, I can confirm it does exactly the same thing.
Hello @celfox,
After several tests and research, this is not directly related to Bolt, but on how you handle your new scene. When you call BoltNetwork.LoadScene
, Bolt will start to load the Scene using the SceneManager.LoadSceneAsync, which is the recommended way to load heavy scenes.
The main load process occurs in the background as expected, and at this step, Bolt stills responsive. But after this, Unity needs to activate your scene, and at this moment it can freeze if you have several GameObjects to be initialized (call Awake()
and Start()
), and yes, at this moment, any other script may not run, including the ones from Bolt. We do not have control over this. Keep in mind that all loading occurs in the main thread.
In your large scene, the GOs are all active in the hierarchy and their components enabled? All rendered or in the camera's field? Are you using LODs? Maybe the trick is to activate/enable by batch or only what's needed, or even instantiate on demand by batch and pool, etc. You could also split the scene into sub-scenes and load them additively.
In order to mitigate any disconnections from the Photon Service, Bolt already maintains a background thread to send ack messages to our server, so your peer will not be disconnected for a while (about 1:30 minutes). We can't maintain this indefinitely because this also happens when your applications go to background, and it must be disconnected after some period of inactivity.
Here are some links with some discussion about this topic:
https://stackoverflow.com/questions/50618388/what-is-happening-in-scenemanager-loadsceneasync https://forum.unity.com/threads/scenemanager-loadsceneasync-freeze-in-2018.543316/ https://gamedev.stackexchange.com/questions/130180/smooth-loading-screen-between-scenes
How to reproduce issue
Expected Behavior
Bolt should continue functioning as normal. Console should work, and should accept new connections.
Actual behavior
Bolt systems completely break. Console does not work, and it does not accept new connections. Output log states: (snipped to useful parts for relevance)
Configuration