A player's performance is primarily determined by the rate at which they can get kills. We measure this rate in terms of kills per round, and then extrapolate these rates over the next n rounds to determine how strong a particular team is.
This balancer searches every possible combination of player swaps, and evaluates every possible player move. Out of these combinations, it selects the optimal choice of swap or move, and performs it.
This means that your teams have excellent balance; please give this addon a try; we think you will be very pleased with the quality of team balance you will experience.
The design of the balancer is to be as unobtrusive as possible, only balancing when needed, and being smart about the balancing such that it is not needed very often.
The overall approach is this:
[*]stats are accumulated for each player, so that the player kill rate (kills per round) can be calculated. These stats reflect the current performance of the player.
[*]every n rounds, a set of merit scores are calculated, for every possible swap of a T/CT, and for every possible move of a T or CT to the other team,
subject to a set of reasonable constraints:
1) if we move a player, we cannot throw the numerical balance too far out of alignment,
2) if a player has already been swapped, they cannot be swapped again
3) if a player is alive and the script is not configured to allow live player swaps, the player cannot participate in a swap.
[*] [b]smart management of when to balance[/b]: sometimes, the balancer will detect that an exceptional condition exists...either the team numbers OR the team strengths are too far out of balance. If an off-schedule balance occurs, the next regularly scheduled balance may be skipped. Balances are also skipped if the balancer determines that the team strengths are already acceptable, or if there are no player trades or moves that will help the overall situation.
[*] [b]player immunity[/b]: No one likes to be swapped over and over. Once a player is swapped, that player is immune from being swapped for the rest of the map or for 30 rounds (configurable), whatever comes first.
[*] [b]Persistent storage[/b] Player killrates are stored in a database; so when that player connects again, the balancer already has a good prediction of his/her performance.
[*] [b]live player swaps/moves[/b] user can select whether or not live players can be moved/swapped. If you are running mani admin, live player swaps do not cause a player death; so allowing live player swaps is highly recommended. However, if you are not running mani, a player swap will cause a death, in which case disallowing live player swaps is recommended. Also on the topic of live players swaps: if a live player is swapped, all live players are temporarily health-boosted in order to prevent cheap end-of-round kills.
[*] [b]fast performance[/b] The heavy calculations involved are deferred until a second or so after round end, so that no lag occurs; in practice, the calculations have been unnoticable on a 24-player full server. Also, database writes (for the tracking of player killrates) is deferred until map change, where it occurs without any impact at all on your gaming experience.
[*] [b]global player immunity[/b] If there are particular players that you want to disallow any team swapping for, just list their steam ID's; the team balancer will then ignore them.
Many thanks goes to [cC]Sparty, who came up with the original concept of this balancer and explained it in [url=http://cans-crew.com/forums/viewtopic.php?f=7&t=4578]this post[/url]. Thanks also to the rest of the [cC] guys at [url=http://cans-crew.com/wiki]cans-crew.com[/url] who have provided valuable feedback and been very patient and helpful throughout the testing process.
Version Notes For 1.1
Updated on: 2008-11-29 19:51:00 EST by *XYZ*SaYnt (View Zip Contents
Version 1.1: added an optional notification to a player if he/she is switched to another team. The screen is very briefly overlaid with the appropriate color (based on whether player was switched to T or CT), an unobtrusive (but recognizable) sound is played, and a centered message is given to the user.
All of this can be disabled or partially disabled via the 'notify_team_change' configuration flag.
( Previous Versions )