Matchmaking rebalance
Overview
This article provides an overview of the matchmaking rebalance process in Accelbyte Gaming Services (AGS). Rebalance is a process where Matchmaking will arrange players who already matched together into a balanced team. In a competitive game, the rebalance process is important to make sure that the gameplay is fair and the overall player stats (MMR, kills, etc) is similar among teams. By default, the matchmaking service enables the rebalance
configuration when it is not being set in the matchmaking ruleset. The rebalance process will consider the member count between teams and (if any) by matchmaking attributes. For eample, MMR. Furthermore, Matchmaking will always put players with a party in the same team.
Currently, there are three types of rebalancing methods in matchmaking:
- Permutation
- Combination
- Greedy
Permutation
The permutation method is being used to create a backfill and new match for a relax (loose) team configuration in the matchmaking ruleset:
- Backfill proposal to a session with minimum 1 player member.
- New match for match ruleset that has different values between
min_number
andmax_number
alliance rule. OR - New match for match ruleset that has different values between
player_min_number
andplayer_max_number
alliance rule.
Matchmaking will use the permutation method to generate sets of party sequences inside a team. For each set, it tries to assign the parties to each team "horizontally." This means the parties will be assigned to the first team, then the next team sequentially, by considering the maximum capability of each team. The matchmaking will also ensure the member count difference and match attribute distance is as small as possible before the party is assigned to the team. This step will result in sets of team composition.
Each set of team composition will be checked and compared with the previous best team composition. The team that has the smallest difference in terms of member count between teams and (if any) matching attributes (i.e., MMR) will be chosen as the best team composition. The final best team composition will be returned as a balanced match result.
Example
Ruleset:
{
"auto_backfill": true,
"alliance": {
"min_number": 1,
"max_number": 2,
"player_min_number": 1,
"player_max_number": 3
},
"matching_rule": [
{
"attribute": "mmr",
"criteria": "distance",
"reference": 100,
"max": 3000
}
]
}
There is 1 active backfillable session (session 1) with 1 member (Player A: Party 1, MMR 70). And there are 3 parties submitting a matchmaking request with the composition:
Player | Party | MMR |
---|---|---|
Player B | Party 2 | 60 |
Player C | Party 3 | 10 |
Player D | Party 4 | 40 |
Player E | Party 4 | 40 |
Matchmaking will generate and compare the possible team composition for creating a backfill proposal:
Result | Player/Party Sequence | Team Composition | Member Count Diff | MMR Distance |
---|---|---|---|---|
1 | [{B},{C},{D,E}] | team[1]:[{A},{C}] team[2]:[{B},{D,E}] | 1 | 6.66 |
2 | [{B},{D,E},{C}] | team[1]:[{A},{D,E}] team[2]:[{B},{C}] | 1 | 15 |
3 | [{C},{B},{D,E}] | team[1]:[{A},{D,E}] team[2]:[{C},{B}] | 1 | 15 |
4 | [{C},{D,E},{B}] | team[1]:[{A},{D,E}] team[2]:[{C},{B}] | 1 | 15 |
5 | [{D,E},{C},{B}] | team[1]:[{A},{C},{B}] team[2]:[{D,E}] | 1 | 6.66 |
6 | [{D,E},{B},{C}] | team[1]:[{A},{B}, {C}] team[2]:[{D,E}] | 1 | 6.66 |
The Result 6 will be used by matchmaking to create the backfill proposal for session 1.
Combination
The combination method is being used only to create a new match for a strict team configuration in the matchmaking ruleset and the total players in one match is less than 12 players:
- New match for match ruleset that has the same values between
min_number
andmax_number
alliance rule. AND - New match for match ruleset that has the same values between
player_min_number
andplayer_max_number
alliance rule. AND - The total number of players (number of teams * number of players) < 12.
Similar to the permutation method, Matchmaking uses the combination method to generate a set of party sequences inside a team. For each set, Matchmaking assigns the parties to each team “vertically”, which means the parties will be assigned to the first team until it reaches the max capability and then move to the next team. It will result in sets of team composition.
Each set of team composition will be checked and compared with the previous best team composition. The team that has the smallest difference in terms of member count between allies and (if any) matching attributes (i.e., MMR) will be chosen as the best team composition. The final best team composition will be returned as a balanced match result.
Example
Ruleset:
{
"alliance": {
"min_number": 2,
"max_number": 2,
"player_min_number": 3,
"player_max_number": 3
},
"matching_rule": [
{
"attribute": "mmr",
"criteria": "distance",
"reference": 100,
"max": 3000
}
]
}
There are 5 parties submitting a matchmaking request with the composition:
Player | Party | MMR |
---|---|---|
Player A | Party 1 | 70 |
Player B | Party 2 | 60 |
Player C | Party 2 | 60 |
Player D | Party 3 | 40 |
Player E | Party 4 | 40 |
Player F | Party 5 | 10 |
Matchmaking will generate and compare the possible team composition for creating a backfill proposal:
Result | Player/Party Sequence | Team Composition | Member Count Diff | MMR Distance |
---|---|---|---|---|
1 | [{A},{B,C},{D},{E},{F}] | team[1]:[{A},{B,C}] team[2]:[{D},{E},{F}] | 0 | 33.34 |
2 | [{A},{D},{E},{B,C},{F}] | team[1]:[{A},{D},{E}] team[2]:[{B,C},{F}] | 0 | 6.66 |
3 | [{A},{D},{F},{B,C},{E}] | team[1]:[{A},{D},{F}] team[2]:[{B,C},{E}] | 0 | 13.34 |
4 | [{A},{E},{F},{B,C},{D}] | team[1]:[{A},{E},{F}] team[2]:[{B,C},{D}] | 0 | 13.34 |
5 | [{B,C},{D},{A},{E},{F}] | team[1]:[{B,C},{D}] team[2]:[{A},{E},{F}] | 0 | 13.34 |
6 | [{B,C},{E},{A},{D},{F}] | team[1]:[{B,C},{E}] team[2]:[{A},{D},{F}] | 0 | 13.34 |
7 | [{B,C},{F},{A},{D},{E}] | team[1]:[{B,C},{F}] team[2]:[{A},{D},{E}] | 0 | 6.66 |
8 | [{D},{E},{F},{A},{B,C}] | team[1]:[{D},{E},{F}] team[2]:[{A},{B,C}] | 0 | 33.34 |
The Result 6 is the combination result that will be used to create a new match (game session).
Greedy
The greedy method is being used only to create a new match for a strict team configuration in the matchmaking ruleset and the total players in one match is more than 12 players:
- New match for match ruleset that has the same values between
min_number
andmax_number
alliance rule. AND - New match for match ruleset that has the same values between
player_min_number
andplayer_max_number
alliance rule. AND - The total number of players (number of teams * number of players) > 12.
Matchmaking uses the greedy partitioning method to rebalance for a large number of players. It will sort the team composition based on attribute value in ascending order (if any session exists), and sort the parties by total attribute value in descending order. It will then fill the party with the largest value first (one by one) to the team with the least total value.
Example
Ruleset:
{
"alliance": {
"min_number": 2,
"max_number": 2,
"player_min_number": 7,
"player_max_number": 7
},
"matching_rule": [
{
"attribute": "mmr",
"criteria": "distance",
"reference": 100,
"max": 3000
}
]
}
There are eight parties submitting a matchmaking request with the composition:
Player | Party | MMR |
---|---|---|
Player A | Party 1 | 70 |
Player B | Party 2 | 40 |
Player C | Party 2 | 40 |
Player D | Party 3 | 40 |
Player E | Party 4 | 60 |
Player F | Party 5 | 50 |
Player G | Party 6 | 70 |
Player H | Party 6 | 70 |
Player I | Party 7 | 60 |
Player J | Party 7 | 60 |
Player K | Party 7 | 60 |
Player L | Party 8 | 50 |
Player M | Party 8 | 50 |
Player N | Party 8 | 50 |
Parties are sorted by total attribute (MMR) values in descending order:
[ {I,J,K}:180, {L,M,N}:150, {G,H}:140, {B,C}:80, {A}:70, {E}:60, {F}:50, {D}:40 ]
Each party will be assigned to the team through the steps below:
Step | Sorted team composition | Party | Assign to | Team composition result |
---|---|---|---|---|
1 | team[1]:[]:0 team[2]:[]:0 | {I,J,K} | team[1] | team[1]:[{I,J,K}] team[2]:[] |
2 | team[2]:[]:0 team[1]:[{I,J,K}]:180 | {L,M,N} | team[2] | team[1]:[{I,J,K}] team[2]:[{L,M,N}] |
3 | team[2]:[{L,M,N}]:150 team[1]:[{I,J,K}]:180 | {G,B} | team[2] | team[1]:[{I,J,K}] team[2]:[{L,M,N},{G,H}] |
4 | team[1]:[{I,J,K}]:180 team[2]:[{L,M,N},{G,H}]:290 | {B,C} | team[1] | team[1]:[{I,J,K},{B,C}] team[2]:[{L,M,N},{G,H}] |
5 | team[1]:[{I,J,K},{B,C}]:260 team[2]:[{L,M,N},{G,H}]:290 | {A} | team[1] | team[1]:[{I,J,K},{B,C},{A}] team[2]:[{L,M,N},{G,H}] |
6 | team[2]:[{L,M,N},{G,H}]:290team[1]:[{I,J,K},{B,C},{A}]:330 | {E} | team[2] | team[1]:[{I,J,K},{B,C},{A}] team[2]:[{L,M,N},{G,H},{E}] |
7 | team[1]:[{I,J,K},{B,C},{A}]:330 team[2]:[{L,M,N},{G,H},{E}]:350 | {F} | team[1] | team[1]:[{I,J,K},{B,C},{A},{F}] team[2]:[{L,M,N},{G,H},{E}] |
8 | team[2]:[{L,M,N},{G,H},{E}]:350 team[1]:[{I,J,K},{B,C},{A},{F}]:380 | {D} | team[2] | team[1]:[{I,J,K},{B,C},{A},{F}] team[2]:[{L,M,N},{G,H},{E},{D}] |