Many players different Scenes?

Hi is it possible, and how, that players can be in the same game but in different scenes at the same Time?! Like in diablo or any other online game? For example a group of players are in the main City (scene)and other players are outside the City (another scene) for questing or so.

Application.LoadLevelAdditiveAsync

Is obsolete now. What can help now for this Problem?

Thank you!

Yes it is possible (at least with PUN, haven’t tried it with UNET, but the same principles should apply).

Use SceneManager to load the scenes, which can be done async and additively if required.

One approach to handle players in differing maps is to have each player keep track of the map it is currently in via a syncvar (UNET) or customproperty (PUN), build index can be used for this. Then you can selectively load the correct scene for the client and show or hide the player avatar on each remote client depending on whether the local player map matches the remote player map.

Thanks for the reply! So i have to Check in which map or scene the local Player is and then load the other scene for the client who have triggered the scene change for example?

It’s may be easiest to make each player responsible for loading their own scenes/maps (this is the approach we took). Scene changes should only be triggered by the local client, and should be restricted to that client, as that’s the map that will be shown to the local player.

Then all you need to consider is whether or not, from the point of view of the local player, the avatars of other players in the game should be disabled or not depending on if they are in the same scene/map as the local player. Basically, you don’t want to be able to see any networked objects that aren’t in the same map as you.

You could also use this to restrict sending network data to them too, as this would save bandwidth.

1 Like