I need to spawn levels with MultiplayerSpawner to avoid synchronization problems, but it uses ResourceLoader.load internally which hangs the game. I need to use a loading screen to load asynchronously.
What I tried:
Spawning a loading screen instead of level. This leads to “node not found” errors when host loads scene faster than clients, which means MultiplayerSynchronizers cannot syncronise spawn properties.
Loading ALL levels to memory before starting game. This works but it increases loading times 20 seconds on my machine and wastes a lot of memory, not worth using
Using rpcs to make sure all peers have scene loaded. This makes everyone wait for no reason, and doesn’t work when a player joins the game later.
Running MultiplayerSpawner in a thread group. This doesn’t make any difference.
I couldn’t find anything related in MultiplayerAPI and SceneMultiplayer other than object_configuration_add. Looks like MultiplayerSpawner calls it internally to track a node. I tried removing object configuration to see if I can delay spawning with it, but it despawns scene from all peers when it stops tracking a node.
Oh! That looks like an issue I could try and contribute too.
Yeah the documentation around the multiplayer API is a little strange. If you look at MultiplayerAPIExtension class there is an example of extending the SceneMultiplayer class, and it gives you access to the fundamental API. I haven’t spent a lot of time looking at it to know what’s possible, or the order of operations.