View Full Version : AdvancedTeamBalancer

09-14-2012, 09:18 PM
DL (http://dl.dropbox.com/u/58384316/UT99/AdvancedTeamBalancer_r9.zip)

Work in Progress on a powerful team balancing environment.

Things done so far:
- Multi-team balancing (up to 8)
- Team elimination mode (hardcoded exclusively for Siege)
- Players from eliminated teams may enter other teams with !enter without rejoining.
- Initial balancing, tries evening both Kill and Score ratios.
- Limbo mode, now players don't need to go spec.
- Spec lamers that leave the game and rejoin are punished for X minutes by forcing them into Limbo mode.
- Team locking, teamswitch done without killing the player.
- Various operational modes.
- Aggresive global balancing (optional), performs 2 player switch when uneven.
- Newcomer balancing (optional), has 2 modes: even by skill, even by skill and numbers.
- Simple offline strength profiles updated after every match.
- Online strength stats can be fully recovered, even if player switches alias/ip.
- Stats are saved for players that left in midgame.
- Plugin system for player identification and fixed stat setting.
- Global balance can only be called every X seconds.
- Global balance lock for 20 seconds after player leaves, gives that player time to rejoin.
- Detects when a player changes name, even if name change happened during disconnected state.
- Client interface interaction, with no code dependancy at all.
- Automatic global balancing for teams with number difference >= 2.

Existing commands:
!team, !t > Global balance.
!playerlist > Displays all existing player's stats, in order of arrival.
!playermemory > Displays all player's names, in order of arrival. Displays player ID
!report > Debug command, displays own team number and playing time in seconds. > TO BE REMOVED
!enter > Puts player out of limbo mode (if allowed to).
!stats > Displays all teams' strength values
!p, !play > If player is in limbo, this command works like !enter, so player won't rejoin.

iACE08c plugin:
Players need ACE validation before entering gameplay.
Players can have preset strength values assigned via HWID/MAC1 (or both) recognition.
The plugin may broadcast the identity of the player if allowed to.
Profiles configured by ACE don't save on the normal profile list
Spectators don't need to validate

Disable UT default balancing and team locking.
Disables AutoTeamBalancer if loaded.
Disables Nexgen team balancer.
Disables Nexgen team locking at game start.

Client interface (ATB_Client_uK_beta1):
Automatically loaded by an INI directive.
Needs to be replicated to clients, add to ServerPackages.
Displays validation, limbo, spec laming status.
Gives players the ability to leave limbo by just using their mouse.
Uses player's HUD color setup.

Default configs load ACE plugin, so if your setup isn't running ACE, remove it from the ini.
The main balancer comes with Global Balancing off, the ALT one with Global Balancing activated.
The client interface package requires an ACE whitelist.

Main: AdvancedTeamBalancer
ALT: AdvancedTeamBalancer2

For ServerActor setups:
Main: AdvancedTeamBalancer.ATB_ServerActor
ALT: AdvancedTeamBalancer.ATB_ServerActor2

Never load both balancer mutators together.

As I update the status here, new things will be bolded.

09-14-2012, 09:20 PM
niceeeeeee finally a team where im not the only one holding it together, this should make for good games like the old days

09-14-2012, 10:16 PM
Maybe we'll be able to play ctf games that are not 2-17 all the time :D
Will this allow you to change to the losing team, and not be put back to the winning team if !t is typed.(very annoying if your trying to help).
An auto kick/ban for changing to the winning team would be nice.
Maybe flag drop if its 2v4 3v5 ect to stop lame caps.

09-14-2012, 10:41 PM
On CTF gametypes it is suggested to use Global Balancing and Newcomer Policy enabled.
After a couple of tests with Chan and BotZ with different skills, it took a few !t commands in the first minutes to produce 2 perfectly even teams.
After those first minutes, all my attempts to rebalance failed due to teams being even all the time.

The balancer is still green and does not yet have the ACE plugin to identify players and assign them preset strenghts.
Spawing can be delayed via plugin too, with an ACE plugin, players won't be able to spawn until ACE validates them which is the intended system for Siege servers to avoid team removers from blitzing into the game.

The current version is 95% reliable on most gametypes excepting Siege.
I haven't tested it with SmartCTF so the limbo mode for spec lamers may bug the scoreboards and confuse players a bit.
Limbo mode for spec lamers may not be enforced right away if a spec rejoins too fast, but all it takes is the lamer to get shot and try to respawn.

Whenever you want to try it (without plugins at all) on the CTF servers, just say it and I'll hand an appropiate INI for that.

09-15-2012, 05:58 AM
I'd be trying this on CTF too if you need

09-16-2012, 09:14 PM
Due to a bug in all Siege versions, the balancer will only properly operate on UltimateRC14 and on.
Also, it should make the players recover the killcount in their stats.

09-16-2012, 09:18 PM
the team balancer on the public sucks!!!! i was nuking and transing and somone !T and i die and lose my nuke!!! :(

09-16-2012, 09:24 PM
i wouldnt mind trying this out on our servers too, very interesting.

09-17-2012, 01:29 AM
Download link up.

Comes with 2 inis for both instances.
And both have a delay of 25 seconds.

After reading the readme, take a look at the inis too to learn to setup the balancer.

09-17-2012, 01:48 AM

09-17-2012, 03:00 AM
Wouldn't a test phase be better or are you that confident :p

09-17-2012, 03:31 AM
I started developing this back in 2011.
It worked fine back then, then rewrote it into a more Object oriented code type, then added the limbo, elimination and plugin system.

The balancing methods have enough testing on them, it's the limbo and plugin system that worries me, but those worked fine in both Siege and all other gametypes.

09-18-2012, 04:07 PM
I'm sure this issue has already been compensated for. But, the ATB is bouncing people To and FRO... I was also uprooted from my originating team and graced with a mid-game transition to the opposing side. However, I found it not so painful, as I didn't lose any standing, weapons, or health in the passing. Quite a tollerable event, providing it doesn't happen to the same player often or in the same match.

Also, while in 'Limbo' (and while playing too) I felt like I wasn't firmly "ROOTED" with my horizontal velocity. It seemed as though it was, well...slippin'. not skipping, not jumping... just ..variable and changing... and not evenly between the players either. OR it just be me. Not really sure about that...

But I am sure about the spectators and 'Limbo' TeamSay messages being changed. They should only be allowed to Team-talk amonst themselves. So all team messages are only broadcast to each other.. Technically, PM's from Spec's and 'Limbs' are supposed to be muted and disabled. but for some reason, they are not.

Just as with real War, change is rough, New Equipment (or code) is bound to be alittle buggy, but the battle dredges on until Victory.

You haven't posted your 'Declaration of War' yet? (the RC14 Comments & Suggestions Thread)?

09-19-2012, 12:29 AM
Put all my clients on blue team, not a single team bouncing issue.


This build of the mutator modifies the server settings to:
Allow free team switching on UT's default settings.
Removes AutoTeamBalancer if detected.
Disables Nexgen team balancer and Nexgen team locking capabilities.

Also, reverted Kill recovery so EFF doesn't fuck up.


09-19-2012, 01:03 AM
Also, each as client was added time was allotted to check the registers and compare the buffers, so that no intrisic spikes were occurring during their transitional ascent into the active player state from the "LIMBO" state. and why my HUD looked so nice for this test, I have NO IDEA, but I must have found that missing letter in my GPU config.


09-20-2012, 08:46 PM

Ace profile tells the balancer not to save profiles with preset strengths for obvious reasons.
Newcomer policy for mid game balancing when Global Balance is OFF is less prone to stack teams.
Started work on a client status plugin.
!p and !play commands are being intercepted for limbo'd players, so they don't rejoin.

BTW SAM, the game starts before the balancer does the initial balance and ACE checkup, set it to start on 25 seconds at least.

09-21-2012, 03:34 AM
Hey higor. I have set it to 25 seconds but the initial start seems to happen anyway. We lost some posts yesterday but I posted about how teams are being stacked. I'll post again when I'm home.

09-21-2012, 08:44 AM
We lost some posts yesterday

really? i can beleave haisuehui
i posted i biiiig explanation about a large defect in the balancer...
something about the PlayerSKill + MatchPoints
like: Blaze (120+30), or Red Team (500+200)

the balancer increses or decreases the players/team points during match and need stack the losing team for balance the points... because this we saw games 6x16... or 1 good player vs 5 good ones

the players are the same, but because the winning team get more points on F1, the balancer acts as if those players improve their skill to a sudden... many time this F1 points are luck! or it's on beggining of game, because is easy attack the core... many Revange kill (4 extras points, i think it would be better to remove Revange mutator), or other factor

dont matter is red or blue team is winning or losing, the balancer must balance the teams, not stack the weaker for they turn the game

09-21-2012, 01:15 PM
That happens because we're testing the Global Balance OFF mode, which forbids any kind of team change.

The mode that works OK is with Global Balance ON, but bear in mind, don't get MAD if you get teamswitched in the middle of the match.
With Global Balance ON mode, the MinBalanceTimer should at least be 300 seconds to prevent !t abuse.

EDIT: Perhaps I could make it so that the balancer delays game start for non-tournament games, regardless of the game settings.

09-21-2012, 05:03 PM
The balancer should handle game starts.

09-21-2012, 05:06 PM
Also if mid game balance is enabled it should not rearrange both teams to make things 'even' it should take onto consderation switching the last two people to join server.

09-21-2012, 05:09 PM
Noted, will take a while, I'm working on the client HUD for the balancer.
The client HUD will feature a small addition in mouse capturing and detection, will use that to simplify leaving limbo mode, and as practice for a constructor GUI.

09-21-2012, 11:13 PM
Great, just found that SiegeHUD also broke the mutator chain processing at PostRender().
So the client interface, and any other mutator using render functions is broken.

SAM, you're gonna have to put up with another release if we want this fixed.

EDIT: Or maybe not, still doing experiments.

Got these working, still needs some more tests.

09-22-2012, 03:12 AM
Postcards from the Edge.


09-22-2012, 06:42 AM
I've been noticing short frame drops ever since the balancer was introduced. Happens once every other minute or so. Maybe my computer is acting up or it has something to do with the balancer.

09-22-2012, 06:51 AM
The balancer is not even enabled or added to server so either this is the psychological issue I always speak of 'ie issues seem to arise when new stuff is introduced' or your computer is messing up :p

09-22-2012, 07:12 AM
Haha. So, you took it off?
I'll have a look at my computer then :P

09-22-2012, 09:32 AM
It has been off since yesterday awaiting a new build from higor when he is back.

09-22-2012, 03:05 PM

Added a client interface, so i suggest disabling the ACE display at startup.
Fixed some cases where limbo'd players managed to spawn.
Fixed spec-laming timers.
Added strength per extra member for Newcomer Policy when Global Balance OFF is 80, so teams will be less stacked.

09-22-2012, 04:49 PM
Oh shi..
Forgot to mention the client interface package require ACE whitelist.

09-23-2012, 04:39 PM

Added some player ID's, and periodic checks to fix the team arrays when players excessively join and leave in short amount of times.
The core/flag icons should no longer disappear in these cases.

09-24-2012, 08:01 AM
hey, this balancer auto update the stats, right? but... if a player rape in a game against a strong team making 100/1000, and rape with the same k/s when this player are on a stacked team against an ape team, he gain the same stats value or there are any compensation about the strength of enemy team?

09-27-2012, 02:39 PM
Two things: 1. What about apes that ragespec and fuck up the stats ( ;) ), and 2. Could you make it so that the net RU balance a player has between the teams affects their stats? For example, if some ape builds a massive leech, he obviously gained a lot of RU from somewhere - but if the enemy attacks that leech, he directly causes the other team to gain massive amounts of RU, shifting his balance in favor of the opposite team.

10-07-2012, 01:16 PM
What would be the best ini setting for CTF games.

10-07-2012, 01:47 PM
I'd advise against using this on CTF servers atm.....there are future releases pending which will make the mod much more suitable for servers as a replacement to AutoTeamBalancer. At this moment in time, it does not keep a "cached" record of player strengths which is a big flaw.

10-07-2012, 02:21 PM
So you are implying that I should just use AutoTeamBalancer till these releases come out. Hope I still have the current one.

10-07-2012, 02:34 PM
AutoTeamBalancer (at least for the moment) will identify player's strenghts correctly to a limited amount. So for now I would say it is best. This one (currently) does not keep a history unless it has been changed and does it on the fly by player performance per game which theoretically is good however a historical list also would make it pinpoint even better. Higor is taking a break from dev on this one though. I am pushing for a full cache similar to ATB.

10-13-2012, 04:17 PM
Well FLuKE has removed the autoteambalancer from our main RX6 server cause he thinks its to much for it to handle and seems to be crashing while it does its thing. Do you know of another good teambalancer thats not so resource hungry?

10-13-2012, 08:21 PM
yup, server went nuts crashing periodically and the logs showed TB as the last entry, now its removed and monitoring server.

shame because it did its job but also possible other mods we run could be playing a part in it and running together could be the issue, very tough to locate.

10-14-2012, 09:37 AM
It shouldn't be crashing the server...it's actually very stable. Recent spate of crashes here and probably some of the more popular servers are obviously someone doing it either remotely or through a new exploit. Working on finding what it is though...

noggieB your balancer mate!

10-18-2012, 12:22 AM
Oh by the way that autoteambalancer doesnt work well with smartctf. I noticed the !stats command brings back the default scoreboard and often the scoreboard never loads. To many similar commands between mods is not a great thing but I do realize that autoteambalancer was made primarily for siege so i guess i need to find a new scoreboard if I'm gonna use this.

11-14-2012, 04:41 AM
noggieB your balancer mate!

Hmmm? That sentence is missing a verb. If there is a bug please feed me data.

I saw you tried bAutoSwitchNewPlayers but the mod that blocks players from switching just put them back again? I like the workaround with 23 maxplayers, that seems to work well.

You *could* try removing the blocker mod, setting gametype's bNoTeamChanges=True, and ATB's PreferenceToSwitchNewPlayers=1.0 so it will even things up when people leave.

And yeah mutator chain sucks. Only takes one noob mutator in the chain, like one noob in the sup, to screw things up.

11-14-2012, 04:46 AM
noggieB You should add my suggestion to ATB already so that we move away from relying on IP and nicknames. ATB should score the hardware instead.

11-14-2012, 05:45 AM
Yeah it should. If you have a mod that collects that and exposes it nicely, I would plug ATB in. (If it doesn't expose it nicely, it will need a recompile each time the mod changes...) I did not get around to decompiling NexGen, having never installed it.

11-14-2012, 06:05 AM
Nexgen client ID is unreliable. I'll send you the source of a current mod we use that does it for something else. You can use it as an example.

--- Updated ---

Also I emailed you the other day you knobhead but I guess you don't check your mails regularly. Check your pm on forum tonight!

04-26-2013, 10:55 PM

Moved many functions to native code (DLL).
Usage of dynamic arrays for player profile finding and allocation.
Player profiles not also store data, but also handle authentication, stat collection, strenght calculation and team correction. (moved outside of the balancer mutator).
Player profiles operate independently of the balancer's system timer, added automatically by a native player detection routine.
ACE HWID, NexGen (theoretical), Siege FingerPrint, IP address, Name player recognition formats used, though, only one can be chosen at a time and the player code generated will be based on that.
Player authentication methods are not code dependant, rendering plugins useless.
Profile list extended from 256 to 1024, usage of a binary file for super fast save/load.
Tracks the latest 16 games for each player.
Initial balancing is done automatically right before game starts.
Removed all client interfaces.
Removed plugin system.
Removed Limbo mode.

Still in testing phases with bots, as soon as I verify this new core works, I'll start editing the old balancing logic.

04-27-2013, 06:20 AM
I think keeping a record of the last 16 games is too less. I would suggest you keep the last 32 games if possible and a larger player array maybe 2048. It Will allow for better balancing the longer the balancer knows them.

Is there a recycle record feature? If known player record has not been used instead of delete the record you could maybe archive it in an ini that way you keep current records in dll only. Also is there anyway to communicate this with gap ? Since we already have extensive player data we could use that to our advantage by having a merge function for clients who have multiple IDs and clearly are the same person.

10-23-2013, 10:50 AM
Am I wrong in thinking that TeamBalancer really only changes the last person who joined in on the game. Every time I go into a game and someone balances the team it moves me to the opposite team and if someone drops out and someone else team balances then I get moved back . I thought it was to even out the team by experience and not just by numbers? I certainly am not likely one to improve a team regardless of where I am am moved to. I would think that if a team is sort of stacked it would move one of them better players vs the latest person joining?