• Make sure to read the forum rules before creating a new thread or commenting on someone else's thread. The forum rules can be read on this page.

Team Numbers Balancing & Switch Prompting

Stavrdaf

Member
Bug Squad
V2 Sage
One of the biggest issues of the server right now is team balancing and specifically when a team has more players than another. Balancing is a delicate matter that is influenced by overall team player skill, class balancing, spawns and team player numbers especially for low playercounts. I shall talk about the last one.

The current system focuses on people joining a team to fix team player inbalance but restricting players from joining the underpopulated team until the appropriate ratio is reached. However, a big problem is that the system doesnt account for players leaving mid-match. If all players that want to join have joined a team then if people leave the teams become inbalanced.

Inbalanced teams refers to when one team's difference between their expected and actual player numbers exceeds a certain threshold. Naturally, if one team has less players than expected one other will have more than expected. The appropriate bound is one that strongly balances the teams close to their ratio when in low total player numbers while becoming more lax as the total player numbers increase.

Code should probably be calculated when a player joins or leaves the game or periodically throughout the game and should be:

math.round(all_players_in_teams * team_ratio) - current_players_in_team >= math.round(threshold)
threshold = sqrt(all_players_in_teams)/2.55
or instead of 2.55 -> whatever constant C

Let's expain why this works.

Say that the ratio for attackers on a certain map is 55% and defenders 45% for 10 players that's 5 attackers and 5 defenders. Say the attackers are losing and one of them leaves making it 9 players total in game and 4 attackers 5 defenders, we would agree this is already inbalanced favouring the defenders now and something should be done. Let's check the formula for attacker team.
math.round(9*0.55) - 4 = math.round(4.95) - 4 = 5-4 = 1
math.round(sqrt(9/2.55)) = math.round(0.68) = 1
Defender team will likewise have a negative difference having more players than needed:
math.round(9*0.45) - 5 = math.round(4.05) - 5 = 4 - 5 = -1
math.round(sqrt(9/2.55)) = math.round(0.68) = 1

The condition triggers and one player from defenders is prompted to switch to attackers (more details further down).
The threshold amount changes depending on how many total players there are and with the current constant offers a leniancy of 1 player difference when 1 to 14 players are in teams, 2 player difference when 15 to 40 players, 3 player difference from 41 to 79, etc... As such the more players are in teams the less balanced the teams can be. The C can be changed in order to change that leniancy but I find 2.55 works fine.

I propose that if the teams are unbalanced enough players of the bigger team should be prompted to switch over to the smaller team. The players of the bigger team should be prompted with text appearing somewhere noticable but not annoying within their hud (like how spearman exhausted message appears) as well as chat requesting for them to switch over to the smaller team. In the chat prompt accompanied by the hud prompt players are given a link/button they can press or a command they can write (like /votefor, /nextmap etc) that allows them to switch, teleporting to the opposing lobby and resetting their kit.

Only one player can switch at the time and all other attempts to switch with the command are denied after the first and if it's found that the teams remain inbalanced the process can restart after some time. A silver reward should be displayed in the prompt and given to the player that switches to incentivize the action. The silver should start at a low amount e.g 10 to 15. The silver should increase after some time if the switch hasnt been made along with a new prompt to a maximum of e.g 100 silver (something equivalent to compensating for any loss of mvp reward) at which point the switch will be prompted periodically until someone takes the offer.

If another switch is required and prompted in a single game then the silver reward maximum should decrease. If a switch is made without interacting with the prompt but by interracting with the switch team signs of a lobby then the silver reward should also be given to the first player.

The whole prompt system is mostly designed around small player teams that we currently have and thus not designed for extreme numbers or many switches and in that case can become annoying. If a big enough number of players is reached then switching can either be prompted subtly (only chat), give no silver or allow for any number of players to use the prompt to switch before denying the rest. Or in general any combination of these suggestions can be used.

TLDR if teams inbalanced, switch prompted in chat and hud for the larger team, silver reward if accepted, appears for example as so:

(for chat)
"Teams are inbalanced, click here or type {insert command} to switch teams and get {insert silver} silver!"
 
Back
Top