How to use the room function

Options
Hello.

I was curious about how to create a team matching system where the members are "friends" and I wanted to know if my logic is correct.

For example, I want to create a 4 vs 4 non-random matching type of game where and I was planning on doing the following:

1. Create two rooms that separate four players who are "friends" of each other into each room. Once the necessary number of players have joined, it would look like this.

[Room 1] PlayerA, PlayerB, PlayerC, PlayerD
[Room 2] PlayerE, PlayerF, PlayerG, PlayerH

2. Then, combine the room players into one

[Room 1] players are moved to [Room 2]
[Room 2] is removed

3. Start a game based on the players in [Room 2]

[Room 2]
PlayerA, PlayerB, PlayerC, PlayerD,
PlayerE, PlayerF, PlayerG, PlayerH

Are the proceeding steps a proper way to accomplish this team type based system?

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @smartcapital2011,

    Thank you for choosing Photon!

    Please read more about how you can achieve team or friends matchmaking here.
  • Thank you for your help in this matter.
    Yes, we looked at the documentation, but we couldn't find exactly how to achieve a MOBA like matching system where we combine two groups of players into one.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2017
    Options
    Hi @smartcapital2011,

    If you have two teams and the team members are friends known to each other, try this:
    have a user from each team (leader?) do the matchmaking for the team:
    find random matches or create new one (when no match is found) using:
    • ExpectedUsers set to the UserIDs of the team members (you can add the caller's UserID for safety also)
    • MaxPlayers = teamSize * 2
    if a room is found send the room name to the team members so they could join.
  • Dannark
    Options
    I've made a similar system except for the combining rooms part, so I have an suggestion:

    Why don't you make one single room with 2 teams? (Let's say Team Blue and Red) You will have something like this:

    And Then you just put a password on it using RoomOptions.CustomRoomPropertiesForLobby();



    In this way only you and your friends will know the password, once you and your friend are in same Team you can remove the password (if you are the leader of your room) so in this way other peoples can join later.


    You could also change team while in room just like this (or kick, adding as friend, sending private message and all that stuff):