Matchmaking Teams Logic

Options
Hello,

I'm trying to make a matchmaking system similar to the one league of legends has.
What I have so far is a host that can invite his friends into a room he has created and the he can start the matchmaking by leaving the room and trying to join a random room and saving slots for his party friends. Photon chat is used to send the room name to the party when matched.

My problem is that I want to keep the parties in the same team when they join the random room (10 vs 10 game). Let's say 9 players started matchmaking as a party and found another 9 players that are matchmaking as a party and another 2 players as a party, this would mean that the 2 players as a party won't join the same team.

My question is the following: Is there any best practice to randomly join parties into rooms while splitting the teams and keeping the parties in the same team? Or am I obliged to randomly join the 9 players party to a room of a maximum of 10 players until it is full and then rejoin the 10 players randomly into another room of max 20 players? (That's the best way I could possibly think of that could make this work)

P.S.: I am writing this logic on the client side. Can I write it in some way into a cloud script?
Note: I am using PlayFab as a backend

Thanks in advance!
Elie

Comments

  • jeanfabre
    Options
    Hi,

    Cloud Script would not do for this.

    You could create a team system that store in room properties the unique Team ID, people accepting the team invitation will join a random room with matchmaking expecting a room property "TeamID" to be the one given when accepting invitation. The team leader can create the room and set the "TeamID" Room property prior to the process. You would need this teamID to be likely a list of ids to accept both teams to join and invite. Use SQL lobby to make complex queries or simply have two room properties, "TeamA_ID" and "TeamB_ID".

    The other solution is to use friends, players that accept invitation keep the playerID of the team leader, go to the masterServer or lobby, and then poll the friendList until the TeamLeaderPlayerID joins a room, then you know this is the room you have to join too ( and your teamleader will have reserved a slot for you).

    Bye,

    Jean
  • lello200
    Options
    Hey Jean,

    Thanks for your reply.

    I think you misunderstood my question, I'm not having problems in reserving slots for friends or joining them after the host finds the match, that part is completely working with the help of photon chat.

    My problem is that when matchmaking, multiple parties might join the room together, and each party should be on the same team with their friends.
    As I mentioned in the example above, if 9 players are in a party, and another 9 players are in another party and they were matchmaking and got into the same room, then the first 9 players party will be on Team A, and the second 9 players party will be on Team B. Now what if a third party of 2 players joins this room? They will be forced to split up into different teams, which is not what I want.

    Appreciate any suggestions
  • lello200
    Options
    BUMP
  • jeanfabre
    jeanfabre mod
    edited August 2016
    Options
    Hi,

    you are right, as I am trying to read your explanations, it's more and more confusing.

    what do you mean by "Party". is it a "Game", and so you would have many games in one room?

    Maybe you could explain your use case using a scenario referencing each player, room and party properly?

    Player1, Player2, playerX....
    Room1,Room2,roomx...
    party1,party2,partyX...

    and then, if we can see the flow of where players should go, it will be easier I think. Unless someone else shime in and understands your use case :)

    Bye,

    Jean
  • lello200
    Options
    Okay so I will explain this a bit more. Here's a refined explanation (I hope..):

    So my game needs 20 players per room in total, 10 players on each team.

    By "Party" I mean a bunch of players that are friends that joined the same room together and started matchmaking to find other players.

    Now what I want in my game is that each party that starts to matchmake with other players should be on the same team. so if 2 friends started matchmaking they should end up in the same team together.

    So again I repeat the problem:
    If a party of 9 players matchmakes with another party of 9 players this is fine, since I can split them into two teams. Now in each team there will be one vacant place for a player to join. What if a party of 2 joins this room? Then I will have to split them into different teams (Which is not how I want my game to be).

    I thought of a workaround which is to kick the party of 2 and wait for other players, but then this party of 2 might just keep reentering the room, so others can't join this room, so it's a bad idea xD

    Hope the scenario is clearer now.
  • jeanfabre
    Options
    hi,

    ok, so "Team" and "Party" is the same. We use the term Team, and we provided an extension for this.

    you need to fill the room properties with flags to allow a room to be joined by a team/party. Then when doing matchmaking, you need to filter using this flag.

    However, you will know in advanced how many players per team/party you have, so when you create the room, simply set it to the property number of expected users, and no one else will be able to join but the expected one. I don't think it make sense to reuse rooms in your case, when a two teams/parties decide to play again each other, simply create the room, don't try to matchmaking an existing one, it doesn't make sense to try and do that.

    Also, if you are already using PhotonChat, assign a teamLeader that's responsible for sending information on what room to join to other members, then there is no matchmaking to do at all and no risk of race condition for joining rooms. It has its flaw because if the team leader is disconnected... then you need a mechanism to assign the next player in that team as leader ( use player Id, and pick the lowest one, then every player will know which team leader it is).

    Bye,

    Jean

  • lello200
    Options
    I've been trying to think of what you just said. Maybe i'll add a room property of the max players that can still join a single team, so each time a player connects to the room this property will be added. Although i'm not sure how efficient and fast this will be handled, maybe two players join at the same time and the room property wasn't updated before that. Anyway I will try it and surely will post an update here.

    Thanks Jean!
  • jeanfabre
    Options
    Hi,

    I am pretty sure unless you have a use case that the property should be setup when you create the room, so that there is no need to join a room out of the blue.

    let us know how you progress on this. Indeed, it's not the easiest feature to implement for a network game, so layout your plan on a paper, draw logic diagram to help you picture all the protocoles. it helps.

    Bye,

    Jean