You are an unregistered user, you can register here
Navigation

Information

Site

Donations
If you wish to make a donation you can by clicking the image below.


 
Go Back   The Unreal Admins Page > Forums > Unreal Admins > Unreal Tournament > UT Server - General Chat

Reply
Thread Tools Display Modes
  #1  
Unread 15th July, 2007, 04:18 PM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Exclamation AutoTeamBalance mutator for even games

UT is a fine game, but it can be tough when players of different skill are playing on the same server. You can get some unbalanced games that end 7-0. So, inspired by a mod originally used on the XOL DOG server, I have written this AutoTeamBalance mutator, which should work on any UT99 server.

It keeps a record of the skills of players on your server, and uses the information to balance the teams at the beginning of each game. In theory this should make games closer and fairer, or at the very least, better than random teams.

It has a few other features too, including mid-game teambalance, warning players if the teams become unbalanced, fakenicker detection, and more which can be found in the README, or by typing "mutate help" in the console.

Please give me feedback about what needs improving in this thread, and I will try to help. Many of the features are configurable. Turn them on to try them out, and back off if they cause any trouble.

I hope this will make for some more exciting games on public servers, and less l33t players bashing noobs.

You can install it as a ServerActor, or as a Mutator, whichever you prefer.
Thanks go to XOL's Sourceror, iDeFiX, Rork, _tAiger, admin_this, Shiva, and others who helped with the coding and testing of this mod.

Updates: To upgrade, just replace AutoTeamBalance.u with the new version. But also read the changes for that release.
  • 2007/10/22: Release 1.3 - see changes later in this thread.
  • 2007/09/20: Release 1.2 - see changes later in this thread.
  • 2007/07/15: Added an example AutoTeamBalance.ini to the zip, and expanded the README.
  • 2007/07/30: Fixed a nasty bug that flag-carriers were not dropping the flag when they switched teams with !red or !blue or semi-admin ForceFullRebalance. Kick and kickban commands now work as intended for semi-admins.
  • 2007/08/01: Now offers 4 different scoring methods, including average_of_frags_and_score (new default), and score_related_to_scoreboard_position. These deal better with over-large Assault and CTF bonuses. (The best defenders don't let enemies grab the flag, the best coverers don't let enemies near their FC. )
  • 2007/08/01: Tracked down and fixed an error in the maths (oops!) which had been producing scores for short games which were larger than they should be. (Some players who played short high-scoring joust games got inaccurately huge strengths!)
  • 2007/09/08: Added bForceEvenTeams. Added bSeparateStatsByGamemode. Added extra notification that a player has been moved to the other team.
  • 2007/09/20: Added bRelativeNormalisation, bFlashOnWarning, bShakeOnWarning, bBuzzOnWarning, "!vote" and "!teams". See AutoTeamBalance-1.2 post below.
__________________
nogginBasher's UT mods I telefragged STRYCH9 once

Last edited by nogginBasher : 17th February, 2017 at 05:58 AM. Reason: language, updated a dead link
Reply With Quote
  #2  
Unread 15th July, 2007, 08:24 PM
Andromeda Andromeda is offline
Dominating
 
Join Date: Sep 2004
Posts: 105
Default

Sounds like a great idea!
One thing though, the zip doesn't contain AutoTeamBalance.ini. The source has the default values for configuration, but there might be some out there who don't know what they are doing

Last edited by Andromeda : 15th July, 2007 at 08:30 PM.
Reply With Quote
  #3  
Unread 15th July, 2007, 11:00 PM
iDeFiX iDeFiX is offline
Godlike
 
Join Date: Jun 2004
Location: NL
Posts: 369
Default

I didn't do a thing!
Nice job btw
Reply With Quote
  #4  
Unread 15th July, 2007, 11:18 PM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

Well AutoTeamBalance.ini should be generated automatically with good defaults, but I have included an example ini-file anyway. iDeFiX, I just want to spread the blame around. And anyway you *did* help!
__________________
nogginBasher's UT mods I telefragged STRYCH9 once

Last edited by nogginBasher : 1st August, 2007 at 02:30 PM.
Reply With Quote
  #5  
Unread 2nd August, 2007, 08:41 AM
iDeFiX iDeFiX is offline
Godlike
 
Join Date: Jun 2004
Location: NL
Posts: 369
Default

Is anyone testing or using it btw?
Reply With Quote
  #6  
Unread 3rd August, 2007, 01:23 AM
Andromeda Andromeda is offline
Dominating
 
Join Date: Sep 2004
Posts: 105
Default

Quote:
Originally Posted by iDeFiX View Post
Is anyone testing or using it btw?
Yes, unreal://66.151.7.64:7777
Reply With Quote
  #7  
Unread 6th August, 2007, 11:33 PM
[BSC]MasterJohnny [BSC]MasterJohnny is offline
Holy Shit!!
 
Join Date: Apr 2005
Location: Hajdúszoboszló, Hungary
Posts: 823
Default

Is there any option in it which makes teamballace every time after a configured period? (The way like ASC does it, e.g. every minute.)
Reply With Quote
  #8  
Unread 7th August, 2007, 02:53 PM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

There is no such option at the moment. I took the philosophy that humans know best, so a human must always say "teams" before any switches occur. But, would you like me to add this option?

The mod is also running on F0X2 server, with many of the optional features enabled: unreal://213.131.248.65/
__________________
nogginBasher's UT mods I telefragged STRYCH9 once

Last edited by nogginBasher : 7th August, 2007 at 02:56 PM.
Reply With Quote
  #9  
Unread 7th August, 2007, 05:04 PM
TheWatcher TheWatcher is offline
Unstoppable
 
Join Date: Jun 2007
Posts: 205
Default

Hi nogginBasher. I see you use a cvs. Perhaps you can explain how it work .
Reply With Quote
  #10  
Unread 7th August, 2007, 08:21 PM
[BSC]MasterJohnny [BSC]MasterJohnny is offline
Holy Shit!!
 
Join Date: Apr 2005
Location: Hajdúszoboszló, Hungary
Posts: 823
Default

Quote:
Originally Posted by nogginBasher View Post
But, would you like me to add this option?
As long as it is optional, it wouldn't make any harm, imo.
Reply With Quote
  #11  
Unread 9th August, 2007, 01:46 PM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

Indeed Johnny, but I only want to complicate the code, and expend the time to do it, if someone really wants to use that feature. Well it's in my TODO list now...

TheWatcher, I'm afraid for security reasons my CVS repository is not public access, so unless you become a serious contributor, you cannot access it directly. However, you can use the web-interface in the link above. It will let you "Download a tarball" (zip-file) of the latest version, or pick out earlier versions, or browse differences between the earlier versions of the source code. You can find various CVS tutorials on the web, although Subversion is becoming a more modern alternative.

One other issue I am thinking about, is players who change IP frequently. I did not realise until I started testing the mod, how many ISPs change the last two digits of their users' IPs. Possibly the only thing I can do here, is increase the "MaxHoursWhenCopyingOldRecord" for players who's last 2 IP digits have changed, and delete their old record to clear space in the database.
__________________
nogginBasher's UT mods I telefragged STRYCH9 once
Reply With Quote
  #12  
Unread 9th August, 2007, 06:51 PM
TheWatcher TheWatcher is offline
Unstoppable
 
Join Date: Jun 2007
Posts: 205
Default

Quote:
Originally Posted by nogginBasher View Post
One other issue I am thinking about, is players who change IP frequently. I did not realise until I started testing the mod, how many ISPs change the last two digits of their users' IPs. Possibly the only thing I can do here, is increase the "MaxHoursWhenCopyingOldRecord" for players who's last 2 IP digits have changed, and delete their old record to clear space in the database.
I am not good with replication but have you try to make a special identifier for player when he first enter a server? Perhaps use servertime and other information to make a hash and save this in client? Is this possible?
Reply With Quote
  #13  
Unread 16th August, 2007, 01:14 AM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

Mmmm good idea. I think XOL used to do that actually. Thanks, I should look into it...
__________________
nogginBasher's UT mods I telefragged STRYCH9 once
Reply With Quote
  #14  
Unread 16th August, 2007, 09:13 AM
SoNY_scarface SoNY_scarface is offline
Holy Shit!!
 
Join Date: Mar 2007
Posts: 1,726
Default

im testing this mod works good sometimes only thing is i have a multistyle server with diff mods and obviosuly some ppl are better at some mods than others so when the mods change it completely unbalances teams unless ur playing the same mod all day this mod works
Reply With Quote
  #15  
Unread 16th August, 2007, 11:06 AM
SoNY_scarface SoNY_scarface is offline
Holy Shit!!
 
Join Date: Mar 2007
Posts: 1,726
Default

i have been using this mod for like 2 weeks now
__________________




Reply With Quote
  #16  
Unread 19th August, 2007, 04:07 PM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

Scarface, I see your server has 4 modes in MapVoteLA, some with translocator, some without. I may be able to address your problem, by optionally building a different database for each mode. I could take a signature of the gametype and the mutators, and add that to the player's name in the one big DB. This way, each player would have a different entry for each mode.

However, if you don't have different mutators in your different game-modes, (e.g. you just change one of the variables in UnrealTournament.ini), it will be harder to detect which mode we are running.

In that case, you could change the *order* of any mutators you do have, to change the signature I plan to generate. Otherwise, I might need to add some config parameter CheckTheseVariablesWhenBuildingSignature in which you could specify bUseTranslocator and any other variables you change. What do you think?
__________________
nogginBasher's UT mods I telefragged STRYCH9 once
Reply With Quote
  #17  
Unread 20th August, 2007, 09:15 AM
SoNY_scarface SoNY_scarface is offline
Holy Shit!!
 
Join Date: Mar 2007
Posts: 1,726
Default

sounds good to me bro although since iv put that mod on some people have been comlpaining about lag :s personally i havent noticed anything untoward but then again my usual ping is about 120-150 so i guess it wouldnt make a huge diff to me.... anyone else had this prob? or complaints? for the most part it works brilliantly with evening teams for now i only have it loading on binslayer...
__________________





Last edited by SoNY_scarface : 20th August, 2007 at 09:19 AM.
Reply With Quote
  #18  
Unread 21st August, 2007, 05:58 AM
nogginBasher nogginBasher is offline
Dominating
 
Join Date: Jun 2005
Location: Bristol UK
Posts: 125
Default

Argh, I tried pretty hard to minimise the possibility of lag, but this *is* my first Unrealscript!

AutoTeamBalance does perform some calculations when a player joins mid-game, and will also need to search the database when a second player joins mid-game. If lag seems to appear on player joins, you can try setting bUseOnlyInGameScoresForRebalance=True. With this set, the database will only be accessed at the beginning and end of games, which should speed up any calculations mid-game.

Also, if you have set bWarnMidGameUnbalance, it will perform some processing every 10 seconds, to check team-balance. If the lag seems to be occurring regularly, you may wish to set that to False again.

If any Unrealscripting gurus want to take a look, I am doing "SetTimer(1,True);" before the start of the game, to check for the moment just before the game starts. But it should be guaranteed to do "SetTimer(0,False);" at that time (provided bWarnMidGameUnbalance is not set, in which case it's "(10,True)"). I assume that's fine, but is there a better way to disable the timer? I avoided using Tick() entirely; I even did "Disable('Tick');" just to be sure.

MasterJohnny, I realised that you probably only want to auto-balance teams when players leave the game, making it 5v3 for example, which seems like a sensible feature to add. I was concerned about another issue: AutoTeamBalance can swap 2 players when it's 5v5, but one team has stronger players than the other. However, I think that swapping 2 players is quite disruptive, and that should only really be done if a player has requested it. I guess I could make both of these force-balance features optional anyway...
__________________
nogginBasher's UT mods I telefragged STRYCH9 once

Last edited by nogginBasher : 21st August, 2007 at 06:03 AM.
Reply With Quote
  #19  
Unread 21st August, 2007, 06:25 AM
TheWatcher TheWatcher is offline
Unstoppable
 
Join Date: Jun 2007
Posts: 205
Default

If you search for player name it it is a good idea to do a alphabetical sort on the list. To decrease the search time on a large database you can make a second table with pointer to the the first name of a letter.
Reply With Quote
  #20  
Unread 21st August, 2007, 07:47 AM
SoNY_scarface SoNY_scarface is offline
Holy Shit!!
 
Join Date: Mar 2007
Posts: 1,726
Default

aliasers make the database HUGE
__________________




Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:43 AM.


 

All pages are copyright The Unreal Admins Page.
You may not copy any pages without our express permission.