Search Unity

Third Party some question about multiplayer game with Pun2

Discussion in 'Multiplayer' started by ab5050, Jun 19, 2022.

  1. ab5050

    ab5050

    Joined:
    Jan 21, 2022
    Posts:
    6
    Hi,

    I am looking into multiplayer game development with Unity and Pun2. I have some basic questions:

    - Is there a way I can create rooms that have no player as owner.
    I assume when a room is created by a player it will be destroyed when that player left the game right? Is there a way to avoid that? I mean once a room/game has been created I want it to stay and just finish based on some other criteria like time or when the game finished by itself etc.

    - Is it needed to have one scene per room in unity? Say I have few prebuilt scenes and I want one be used each time a room is being created. Should I instantiate a new copy of that scene in unity per each room that is being created?

    - do non interactable objects need any synching or network components? for example walls or objects in scene that do not move. should I add any photon component to them or they just need to be in scene like single player games and they will be available and work the same for all players?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,072
    Rooms can be created by anyone and they only get removed, when everyone left. The server for the actual room is a Photon (Cloud) Server.
    Clients can close a room (so nobody else can join anymore), so you don't need to worry about anyone joining very late.

    Clients can load any scene they like. You could also load multiple but PUN can only sync one scene (optionally).

    You don't need to sync static objects or those, which will be shown locally only.

    The PUN Basics Tutorial may be a good first iteration.
    Disclaimer: You will notice that PUN 2 is the oldest of our multiplayer solutions. Our state of the art multiplayer SDK is called Fusion.
     
    r31o likes this.