Author Topic: cube v1.6.1 - CTF/INF Ultimate Balancer  (Read 16259 times)

0 Members and 1 Guest are viewing this topic.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
cube v1.6.1 - CTF/INF Ultimate Balancer
« on: June 05, 2011, 06:24:29 pm »



script name: cube, or ctf/inf ultimate balancer
short description: pretty complex team balancer + a few teams-related things
original author: fri
core version: 2.7.6



longer description:
Unlike most balancers you've seen, cube balances teams based on the difference in number of players AND team scores.

Regular balancers check whether the difference in number of players is greater than 2, and moves a random player to the opposite team if it is. cube doesn't stop at such a plain check - this is where team scores, swaps and player choosing methods go into play.

features list:
- works with CTF and Infiltration gamemodes
- uses seven methods of choosing the player to be moved, including "least caps", "worst k/d ratio", and more
- avoids flag carriers not to ruin the game
- automatically puts new players into weaker team
- gives some "immunity time" to moved players, so they won't be moved again too soon
- disables itself in the last 10 seconds of a map (to avoid "wrong map version" problems)
- supports some well-known triggers such as !alpha, !spec (+aliases), and, of course, !balance (!bal, teams, ...)
- "team-changing" triggers can be disabled or limited to X uses per player per map
- locks the recenly moved players in their new teams, so they won't fight the system and go back
- in case of a big unbalance, admins can shuffle the teams using one simple command (/mix)
- admins can swap the teams of two or all players at once
- you can exclude some people from the balance by putting their nicknames or HWIDs on the exclusion list
- can keep teams' scores even if all players left (optional)
- (dev) the code is commented and thus fairly easy to understand

Uses Explode function by CurryWurst and Curt.

commands list:
all players:
!balance, teams - trigger balance
/bal - trigger balance without disclosing who triggered it
!alpha, !1 - go to alpha team
!bravo, !2 - go to bravo team
!spec, !5 - go to spectator team
!join, !j - join weaker team (spec only)
(plus a few aliases of all these triggers/commands)
additional commands (admins only):
/swap ID1 ID2 - swap teams of specified players
/swap all - swap everyone
/mix or /shuffle - shuffle teams
/hwid ID - show hardware ID of specified player
/exclude ID - exclude specified player from balancing
/kickbots, /kickspec - kick all bots / spectators
/cubeinfo - shows current info about version, balances, config, etc.

You can test cube on Bonecrusher's servers, e.g here: 80.72.37.10:23073 (server 2.7.6, cube v1.5).

If you have any suggestions, please post them here. Have fun!






Changes 1.6 -> 1.6.1:
fixed: a terrible bug which rendered /exclude command useless (it excluded the user, not the specified ID)
modified: simplified a bit of logic

Changes 1.5 -> 1.6:
added: /exclude ID command for admins, to exclude players for the duration of their visit on the server
added: /cubeinfo command for admins - shows current cube info (version, config, number of balances)
added: a message that shows up if cube could not choose any player to move; you should not see it anyway
added: public messages show current balance status, e.g. 'Teams balanced. [3v2 4:7]'
added: option to make swap ignore the number of flag captures when choosing players
fixed: a bug that caused spectators to be moved to alpha team when /swap all was used
modified: reworked the whole config to make it even clearer
modified: some default values in config
modified: bots are now ignored by cube
modified: excluding now makes people completely immune to cube's effects
modified: colors of some messages
modified: /hwid ID command also works with nicknames

full changelog is in the readme.txt file
« Last Edit: April 25, 2014, 03:24:15 pm by freestyler »

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: cube v0.4b (updated)
« Reply #1 on: June 08, 2011, 08:24:59 pm »
best balance script there is

Im chill like that

Offline L[0ne]R

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2078
  • need a life. looking for donors.
Re: cube v0.4b (updated)
« Reply #2 on: June 08, 2011, 10:19:58 pm »
sounds promising, hoping that most servers will switch to it.

As for the name:
Ctf Ultimate BalancEr?
Ctf Ultimate Balance Enhancer?
« Last Edit: June 08, 2011, 10:21:37 pm by L[0ne]R »


L[one]R, INF veteran
maps - remakes: inf_Warehouse ; inf_Fortress ; inf_(Sun)Rise ; inf_Outpost ; inf_Abel ; inf_Moonshine

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.5b
« Reply #3 on: June 11, 2011, 06:43:06 pm »
Version 0.5b is now available.


Changes 0.5 -> 0.5b:
added: fifth method - choosing player with no caps and worst k/d ratio. if it fails - least caps; it's the default method now
modified: balance won't trigger in the last 10 seconds of a map to avoid wrong map version problems
modified: the !alpha-like triggers won't work in the last two seconds of a map

I'm still open to suggestions and feature requests.
« Last Edit: June 11, 2011, 06:52:36 pm by freestyler »

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1907
    • TransHuman Design
Re: cube v0.5b
« Reply #4 on: June 11, 2011, 07:05:11 pm »
Quote
5v5, 8:0 -> one player from Alpha moved to Bravo, because Alpha is definitely too strong
In situations like this I'd rather see swapping best player from alpha with worst player from bravo. I dislike any situations where there's difference between teams greater than 2. In my opinion 6vs4 is unbalanced and it's like your Cube was flawed but it's for sure superior.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.6
« Reply #5 on: June 12, 2011, 12:42:25 pm »
Version 0.6 is out.


Changes 0.5b -> 0.6:
added: optional (and enabled by default) method of dealing with 5v5 situations: swap best and weakest player's teams instead of moving one causing 4v6 (idea by Wookash)
added: another method - fewest kills and no caps (new default)
modified: swap is now a separate procedure - swap(caller, id1, id2);

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: cube v0.6
« Reply #6 on: June 12, 2011, 03:13:35 pm »
I love you man. No homo.
Now all you need to do is make one like this for Inf, and I will forever be in your debt.
b&

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: cube v0.6
« Reply #7 on: June 14, 2011, 08:17:10 am »
Code: [Select]
(15:13:52)  [*] [Error] cube -> (OnPlayerSpeak): Out of Global Vars range
(15:13:52)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0B43, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (OnPlayerSpeak): Access violation at address 080A0BCC, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0BCC, accessing address 00000120

uncool :<

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.6
« Reply #8 on: June 14, 2011, 01:01:08 pm »
When reporting bugs please add info about number of players in each team, team scores and config (if not default). This way I can reproduce it and fix the issue.

I'm working on 0.7 with automatic Inf support, but it needs a lot of testing and time, which I do not have.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: cube v0.6
« Reply #9 on: June 14, 2011, 02:29:38 pm »
Code: [Select]
(15:13:52)  [*] [Error] cube -> (OnPlayerSpeak): Out of Global Vars range
(15:13:52)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0B43, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (OnPlayerSpeak): Access violation at address 080A0BCC, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0BCC, accessing address 00000120

uncool :<

linux?

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: cube v0.6
« Reply #10 on: June 14, 2011, 03:30:05 pm »
Quote from: brad cZe
One thing i'd change. After map changes, if you got balanced you get kicked by server
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.7 (CTF+INF)
« Reply #11 on: June 14, 2011, 05:44:04 pm »
Quote from: brad cZe
One thing i'd change. After map changes, if you got balanced you get kicked by server
This was fixed in 0.5b, where balance doesn't trigger in the last 10 seconds of a map. I suggest downloading newer version.


Version 0.7 is out. (yay, Infiltration!)


Changes 0.6 -> 0.7:
added: detect Infiltration / Capture The Flag and use respective Weight and MinDiff
added: 'teams?', 'balance?' and 'bal?' triggers
modified: can't swap spectators now
modified: "Teams balanced." won't show up after automatic swap anymore
modified: fixed bug with not balancing 4v6 when one team is stronger and SwapOnUnbal is true
modified: now balance autotriggers if (Interval*n) minutes passed since last balance
 (used to trigger every <Interval> minutes, no matter if other (requested) balances occured or not)
modified: if the last balance was swap then multiply the interval by 1.5 (to avoid another swap too soon after last one)
modified: player can't use !teams until 15 seconds since last successful balance pass

Offline L[0ne]R

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2078
  • need a life. looking for donors.
Re: cube v0.7 (CTF+INF)
« Reply #12 on: June 14, 2011, 07:00:47 pm »
I'd say "Add TDM support too" but nobody plays 4-team TDM anyway. <_<


L[one]R, INF veteran
maps - remakes: inf_Warehouse ; inf_Fortress ; inf_(Sun)Rise ; inf_Outpost ; inf_Abel ; inf_Moonshine

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: cube v0.7 (CTF+INF)
« Reply #13 on: June 14, 2011, 07:19:40 pm »
You are now officially a hero.
Also, as Loner said, this would rock with TDM, except nobody plays it anymore, but I think it would come in handy for the soldat forums meet-ups.
b&

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.7 (CTF+INF)
« Reply #14 on: June 15, 2011, 02:14:25 am »
As you said, nobody plays TDM. Even if some players do, there's not that many people, so the balance is not needed. If there were servers filled with 20 people playing TDM then I would reconsider it.

I also don't know how it would calculate the balance. Standard deviation or what?

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: cube v0.7 (CTF+INF)
« Reply #15 on: June 16, 2011, 06:25:25 am »
Code: [Select]
(15:13:52)  [*] [Error] cube -> (OnPlayerSpeak): Out of Global Vars range
(15:13:52)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0B43, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (OnPlayerSpeak): Access violation at address 080A0BCC, accessing address 0000010D
(15:13:53)  [*] [Error] cube -> (AppOnIdle): Access violation at address 080A0BCC, accessing address 00000120

uncool :<

linux?
yes debian 64x soldat mode : Realistic survival CTF

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: cube v0.7 (CTF+INF)
« Reply #16 on: June 16, 2011, 08:26:38 am »
welcome to linux<->soldatserver cooperation hell. Make yourself comfortable.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.8
« Reply #17 on: June 19, 2011, 01:22:51 pm »
Grab the new, shiny v0.8 now!


Changes 0.7 -> 0.8:
added: /mix (or /shuffle) admin-only command to shuffle the teams
added: cube recompiles itself after /gamemode x
added: aliases for /gamemode x. no need to remember their numbers anymore
added: info about number of players and scores, shown with every balance (admin console only)
added: !a, !b, !s triggers (changing team)
modified: don't balance when one team has won the round and map hasn't changed yet (in addition to timeleft = 0)
modified: final fix for 4v6, no weird balance should happen anymore (on default config at least)
removed: IncludeFlags is hardcoded now (not optional anymore). if it was set to false, cube was no different from any other balancer. most of cube's code used team scores with no regard to this option anyway

Offline Beowulf Agate

  • Major
  • *
  • Posts: 73
Re: cube v0.8
« Reply #18 on: June 19, 2011, 03:01:09 pm »
theres still v0.7 at that shiny v0.8's link :)

not anymore :F
« Last Edit: June 19, 2011, 03:05:02 pm by Beowulf Agate »

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: cube v0.9
« Reply #19 on: June 24, 2011, 04:52:42 pm »
v0.9 is out. We're close to the finale!


Changes 0.8 -> 0.9:
added: limiting number of swaps per map (default: 2). if it's reached, teams are considered balanced (in situations where swap would normally occur, of course)
modified: less /setteam-ing for shuffle - don't move player if he's already in his 'destined team'
modified: shuffle locks players in teams for LockTime*60 seconds
modified: little changes in messages
modified: player choosing method defaults to 1 again (random player). it's more fun this way

Please post what features would you like to see in this script. I want to make v1.0 as useful as possible.