Network - Load For Late Players

Hello,

My first ever networked game is coming along quite nicely. But I’ve just found a really big problem when a player/client joins late (so during a game).

Example, lets say I set up a server, and my client connects and we mess around for a while. Lets say I kill him a few times (goes to my scoreboard), and I pick up new weapons along the way. If another client joins later on, first off the scoreboard is reset (for him), and he will see all the other players with the default starting weapon (baseball bat), even though they might have picked up something different.

So everything appears ‘new and fresh’ but only for the late comer. Even all the scene rigidbodies are in the default place (even though someone may have moved them).

Whats weird though, is that I have a paintball gun weapon, that does a ‘Network.Instantiate’ of paintball pellets, and if they have been fired around the scene, and a late comer joins, all the paintballs load into the scene as it looks with every player.

So, my question is, how would I make a late comer (client) load the scene as it actually is?

Hope that makes sense, and thanks!

So you need to add NetworkViews to your rigid bodies so that they are synched between the players - at the moment they appear synced because each game has the participants moving synchronously, however, when a new player joins that hasn’t happened for them yet.

When using RPC to communicate things like weapon selection you need to do either:

  • Buffer the RPC calls so that they are received by each joining participant

or

  • Pass the state of all other participants when a new player connects with some special player join RPC just to that copy of the game