Skip to main content

Matchmaking rebalance

Last updated on November 13, 2024

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 and max_number alliance rule. OR
  • New match for match ruleset that has different values between player_min_number and player_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:

PlayerPartyMMR
Player BParty 260
Player CParty 310
Player DParty 440
Player EParty 440

Matchmaking will generate and compare the possible team composition for creating a backfill proposal:

ResultPlayer/Party SequenceTeam CompositionMember Count DiffMMR Distance
1[{B},{C},{D,E}]team[1]:[{A},{C}] team[2]:[{B},{D,E}]16.66
2[{B},{D,E},{C}]team[1]:[{A},{D,E}] team[2]:[{B},{C}]115
3[{C},{B},{D,E}]team[1]:[{A},{D,E}] team[2]:[{C},{B}]115
4[{C},{D,E},{B}]team[1]:[{A},{D,E}] team[2]:[{C},{B}]115
5[{D,E},{C},{B}]team[1]:[{A},{C},{B}] team[2]:[{D,E}]16.66
6[{D,E},{B},{C}]team[1]:[{A},{B}, {C}] team[2]:[{D,E}]16.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 and max_number alliance rule. AND
  • New match for match ruleset that has the same values between player_min_number and player_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:

PlayerPartyMMR
Player AParty 170
Player BParty 260
Player CParty 260
Player DParty 340
Player EParty 440
Player FParty 510

Matchmaking will generate and compare the possible team composition for creating a backfill proposal:

ResultPlayer/Party SequenceTeam CompositionMember Count DiffMMR Distance
1[{A},{B,C},{D},{E},{F}]team[1]:[{A},{B,C}] team[2]:[{D},{E},{F}]033.34
2[{A},{D},{E},{B,C},{F}]team[1]:[{A},{D},{E}] team[2]:[{B,C},{F}]06.66
3[{A},{D},{F},{B,C},{E}]team[1]:[{A},{D},{F}] team[2]:[{B,C},{E}]013.34
4[{A},{E},{F},{B,C},{D}]team[1]:[{A},{E},{F}] team[2]:[{B,C},{D}]013.34
5[{B,C},{D},{A},{E},{F}]team[1]:[{B,C},{D}] team[2]:[{A},{E},{F}]013.34
6[{B,C},{E},{A},{D},{F}]team[1]:[{B,C},{E}] team[2]:[{A},{D},{F}]013.34
7[{B,C},{F},{A},{D},{E}]team[1]:[{B,C},{F}] team[2]:[{A},{D},{E}]06.66
8[{D},{E},{F},{A},{B,C}]team[1]:[{D},{E},{F}] team[2]:[{A},{B,C}]033.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 and max_number alliance rule. AND
  • New match for match ruleset that has the same values between player_min_number and player_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:

PlayerPartyMMR
Player AParty 170
Player BParty 240
Player CParty 240
Player DParty 340
Player EParty 460
Player FParty 550
Player GParty 670
Player HParty 670
Player IParty 760
Player JParty 760
Player KParty 760
Player LParty 850
Player MParty 850
Player NParty 850

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:

StepSorted team compositionPartyAssign toTeam composition result
1team[1]:[]:0 team[2]:[]:0{I,J,K}team[1]team[1]:[{I,J,K}] team[2]:[]
2team[2]:[]:0 team[1]:[{I,J,K}]:180{L,M,N}team[2]team[1]:[{I,J,K}] team[2]:[{L,M,N}]
3team[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}]
4team[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}]
5team[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}]
6team[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}]
7team[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}]
8team[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}]