Hi All,
I am on Unity 5.5.0f3 and I am trying to make a server which can support a lobby scene and an ingame scene with a twist that clients can join the game during the ingame scene. My real goal is a solid understanding of UNET and its pipeline so I can confidently roll a networked procedural open world… baby steps first.
I took the Tanks Network demo and tweaked the NetworkLobby (and NetworkPlayer) to so that players can join midgame, I also changed the GameManager so that all players connect ad-hoc and the round never ends.
Now when I start a server and have the local player jump into the game everything is OK. When I connect on a second unity instance the game scene is loaded but the client throws a CRC warning, presumably because the NetworkManagers are expecting to meet on the same scene:
"
Network configuration mismatch detected. The number of networked scripts on the client does not match the number of networked scripts on the server. This could be caused by lazy loading of scripts on the client. This warning can be disabled by the checkbox in NetworkManager Script CRC Check.
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
"
Immediately after the CRC warning I get these errors:
"
Spawn scene object not found for 1
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
Spawn scene object not found for 2
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
"
Presumably the errors are due to desynced scene networkIds. The server can see both player 1 and 2 as tanks, the client can see player 2’s tank (their own) but appears to have spawned the lobby player controller object for player 1 and 2 (especially odd for player 1 given that their player controller was replaced before player 2 connected). After the errors both players can fire rounds from their tanks and tank 2’s driving is synchronised.
If using scenes and Network Manager together is constrained by them needing to begin their conversation in one predetermined scene I guess I need to create the NetworkManager in the ingameScene on server and use prefabs to overlay the lobby in that scene based on replacing player controllers between rounds.
If anyone has successfully solved this sync problem or has any hints or advice (including not to use multiple scenes because of x) I am keen to hear it.
Thanks,
EnlightenedOne