Search Unity

Third Party Unity Photon or Mirror multiplayer with multiple scenes

Discussion in 'Multiplayer' started by legrisk, Aug 10, 2021.

  1. legrisk

    legrisk

    Joined:
    Mar 15, 2014
    Posts:
    3
    I've been experimenting with unity mulitplayer, I have switched back and forth between mirror and Photon trying to get the functionality that I want. Basically I want there to be multiple scenes that players can switch between. Like the inside of a house, shop or whatever, the main map, and a number of travelling maps. The only examples I have seen so far is all players moving between scenes together. I want to be able to travel alone. Any advice or suggested reads?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    This sounds like you may want to drop loading distinct scenes. If you aim for "streaming" locations, as house-interiors, you can keep players in context with the rest of the scene and other players. The reference will stay the same, so to say.

    There are many other approaches to this. E.g. you could come up with a system which shows exact positions only for those in the same scene but a backend service shows who is where on a world map (that backend is not mirror or PUN but a rest service for example).
     
  3. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    You can achieve exactly what you want with PUN, I have it working in my RPG game https://forum.unity.com/threads/the-kingdom-of-galanor-playtest-available.532590/

    It requires you to handle the map loading separately for each client. You will also need to develop a system to hide networked objects that are on different maps to the local client and you'll also likely want to use RaiseEvent instead of RPCs to cut down on sending data to clients that are in different maps where it makes sense to do so.

    I use a player custom property to keep track of which map each client is in, and then show or hide other networked objects based on its value.

    But PUN can definitely be used to do what you want without the need for any backend service.