Balancing Teams Asymmetrically In Verse
Figuring Out the Algorithm
When the game begins, we want to balance each team to have an appropriate amount of players.
Unlike in games where player balancing is symmetrical and players are distributed evenly between teams, balancing teams asymmetrically means each team should have a relative number of players. In other words, team sizes should follow a relative ratio.
For instance, you might always want one team to have twice the number of players as another. As players join, you have to balance them in a way that preserves this relative number. In game modes where one team is more powerful, or has different abilities than the other team, asymmetric balancing creates smoother play experiences by carefully distributing the number of players on each team.
In this example, you need to make sure that teams with a larger maximum number of players (in this case, the Defenders) will always have more players than teams with a lower maximum (like the Infiltrators).
To distribute players correctly, you'll have to put each player onto the team with the largest difference from its maximum number of players.
To do this, for each new player, you'll have to check each team, and store a reference to both the maximum and current number of players on that team, as well as the team to assign this player to. You can subtract the maximum number of players from the current number to obtain the difference from maximum. When you find a team with a larger difference from maximum, you'll set the player to be assigned to that team.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.