Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Create lobby or empty rooms?

Discussion in 'Multiplayer' started by mirzahat, Sep 1, 2015.

  1. mirzahat

    mirzahat

    Joined:
    Dec 21, 2014
    Posts:
    53
    Hello,

    Im adding multiplayer funcionalty to my billiard game with Photon PUN Turnbased.

    The scenario is like this:

    1. Player goes into the game.

    2. If no online players are there, I let the player play offline mode.

    3. In the background, a new room is created where only this player is placed.

    4. When a new player arrives, the cod checks if there are rooms only with one player.

    5. Players start a match.

    Now my question:

    Is is smart to create empty "waiting rooms" or it a waste of resources?

    Is there maybe a way to add players to a lobby, where they wait for a new opponent?

    Mirza
     
  2. arcady87

    arcady87

    Joined:
    Jul 24, 2013
    Posts:
    25
    well, imo "creating lobbies" or "waiting rooms" is never a wasting of resources.. i guess this sentence stands in according with how often you update and retrieve data from your own MasterServer Host List. for that i know, only MasterServer can help. also, you can try to put an eye on the new Network system that comes with U3D 5.1 (the possibility to create "lobbies", which needs to be optimized... just spend two minutes to check and read what users wrote about it).

    honestly, if you really care "resources", imo you can want server-users to share their IP directly with their friends... once clients have got server's IP, they can do whatever they want (connect to, or not). these old ways always work... they are a bit rough.

    above this, the creation of a PvP system is really easy: check how many players populate the same game session (if needed, try to balance it), opponent teamates are always flagged/tagged as hostile to each other.

    please, keep in mind that my suggestions are not coming from an experienced coder. ok?
    hope to have helped you, somehow.

    -arcady87
     
    Last edited: Sep 1, 2015
  3. mirzahat

    mirzahat

    Joined:
    Dec 21, 2014
    Posts:
    53
    thx, this leads me to conclusion that Im on the right path :)