Matchmaking System

Hello,
I am working on my new game. I am using PUN to make my game better. I want to make a matchmaking system like CS:GO, Rainbow Six Siege. I checked ur tutorials but i can't find what i was looking for.

I made a lobby system. It works like a room. You are entering to room and inviting friends. Everything OK. But i want to make a system like this;

Started matchmaking with lobby (2-5 players in room) then find how many players you need. When it finds 10 players, start the game.

My real question is i am starting matchmaking from a lobby, then i am making the lobby as joinable i mean visible = true. When some one directly looks for game with RandomJoin, he joins the room. But only who looks for game as solo can join the lobbies. I want to mix the game with other lobbies and start game with 10 players.

I can't find any enough tutorial for this. Please help me,
Thanks!

Comments

  • Admins... Where are you? i need help.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2018
    Hi @NerfeR,

    Thank you for choosing Photon!

    The answer to your question may be hidden in our Matchmaking Guide.
    We will try to better expose documentation about team and friends matchmaking in the future.

    You need to make a difference between rooms that are meant as "temporary lobbies" and actual rooms.
    You can do so using one of these two ways:
    - Using a room property visible to the lobby, you can filter the rooms based on the value of that property.
    - Use separate lobbies for each purpose.

    Now for players that want to join rooms together (teams or friends or whatever), first you make them join the "temporary lobby room" which should have MaxPlayers set as the size of the team. Then once that room is full, one of the players will leave and start matchmaking using Slot Reservation feature (see "ExpectedUsers" parameter) using the UserIDs of all players. The players left/still in the "temporary lobby room" can keep polling/calling FindFriends and pass the UserID of the player who is doing the team matchmaking, once they find out he's in a room they should leave the current room and join him to that room.
    Another way of doing this is to make the player who does the team matchmaking come back to the temporary room to inform the team members and then everyone can quit and go to the main room.

    Of course, you can make use of PlayerTTL, MaxPlayers and IsVisible etc. on room creation or even change those values post room creation.
  • First thank you for answering.

    with "ExpectedUsers" the leader is looking for match but he says like "We're 4 friends, we need lobby 4 players slots avaliable" if is there like this a room, then he joins. After that his friends joins the room right?

    So, how can i bring his friends to room?
  • JohnTube
    JohnTube ✭✭✭✭✭
    After that his friends joins the room right?
    Yes.
    So, how can i bring his friends to room?

    1. The friends keep calling FindFriends(leaderUserId) and when the leader is in the room they will know about it using FindFriends' result.

    Or

    2. The leader leaves the room and goes back to the temporary room to inform his friends via RaiseEvent or RPC or whatever that they should switch to the new room (in any case, make sure to include the leaderUserId in the ExpectedUsers also)
  • Okay, Thank you so much for answering my questions and fixing my brain. :)