What I'm currently doing:
- Reading through the current auto-balancer code - Done
- Gathering data & getting (Thanks sniger for all the screenshots of match end scoreboards) - 20%
- Porting the current auto balancer algorithm to something I can test (I want to make sure the new one isn't worse. Also helps me understand old code)- 10%
- Write a new auto-balancer in something I can test
- Port new auto-balancer to M&B scripting language.
If you're looking at scoreboards, and the relation between player score and their k:d ratio, it might help to know exactly how score is calculated. Although I'm still in the middle of reworking it to more accurately reflect a player's contributions to his team's effort, the following should still be useful.
Current system:
- take the final damage dealt as the base score amount
- cap it by what HP the enemy has left
- if the hit kills the enemy player, add 30
- if not a kill but final damage >= 1, add 5
- if it is a horse and has a rider, reduce to 2/3
- if it is a horse without a rider, set to 0
- if the victim agent and attacker agents are on the same team, multiply by -2, if they're the same agent(you damage yourself), multiply by -1
- cap the hit player's offset between 75 and 125
- multiply score * victim's offset
- divide score by 100
- give this score to the one who did the damage
- multiply score by 1/3
- give to everyone within
2.5m that is an enemy of the victim(including those who died up to 5 seconds prior)
- finally, the scoreboard duplicates a player's score divides that number by 15 and rounds down. (So you can deal 9 damage to someone with a 100% offset, not see a change on the scoreboard, yet still get properly rewarded for it).
A player's offset is calculated by...
- finding the average score gained in the previous round for all players that spawned
- finding the average score for the whole map
- get the player's previous round score gained
- get the player's total score
- multiply both by 100
- divide the player's previous round score gained by the average score gained in the previous round
- divide the player's total score by the total score average
- take whichever is higher as the offset
I didn't want things to get out of hand with the offset, so I chose rather restrictive limitations on it. Several people on any given map tend to have 2 to 4 times the average player's score, so rather than having them literally worth 4 times as much score, thereby making them a target for everyone else on the server, I chose a rather low cap. Might change this in the future, but I haven't exactly had
any feedback on it.
On a sidenote, we all idle the mount&blade-crpg irc channel on QuakeNet, so if you have any questions, feel free to hop in and ask anytime.
Edot: Also, a player's Score Offset is set to 100 when entering the server and after a map change.