2
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Balance Teams plugin  (Read 8997 times)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 983
    • GitHub
Balance Teams plugin
« on: April 15, 2011, 08:36:24 PM »
Hi everybody.

I have recently begun to develop some plugins for b3bot.
One of the first things I noticed is the lack of a real Team Balancer. Those provided by PowerAdminUrT:

!teams -> strikes a balance based solely on the number of players
!shuffleteams -> melee players randomly

are not just what I wanted, so I decided to develop one by myself.

DESCRIPTION

Balance teams, not only considering the number of players but the quality of each players.
It is calculated the difference between the number of kills and deaths (for each player) when the command is launched.
Is thus made a list of players ranked in descending order according to this value.
Players are then assigned to teams in a sequential manner, leaving spectators users in spec mode.


To run the Team Balancing just add the plugin to your extplugins, edit the balanceteams.xml according to your needs, add the plugin to b3.xml and run !balance

Hope this help.  ;D ;D
Pls report any bug (I personally tested the plugin on a full server and it seems to works good, but some bugs may everytime appear)

[Update]
#  15-04-2011 v1.0
#    * First release
#
#  17-04-2011 v1.1
#    * added players locking after team balancing [requires PowerAdminUrt]
#
#  17-06-2011 v1.2
#    * bugfixes
#   * some code cleanup
#



[attachment deleted by maintenance]
« Last Edit: June 17, 2011, 09:45:37 PM by mr.click »

Offline gsigms

  • Newbie
  • *
  • Posts: 2
Re: Balance Teams plugin
« Reply #1 on: April 18, 2011, 09:27:37 PM »
hi,

nice job :)

if I may, a suggestion:

the kill death might not always be very good indicators, (begining of round) or for players that just connected, may be a timedelay to disable the command for the first few minutes of a round or memorizing scores from last round/map or treating new comers (those with less than X, kills + deaths) in a separate batch...


Offline creatiu

  • Newbie
  • *
  • Posts: 2
Re: Balance Teams plugin
« Reply #2 on: June 03, 2011, 10:06:04 PM »
Hi mr.click, thank you for this awesome plugin, I didn't want to install Power Admin but I was really looking for this command :) I have added it to my server Barcelona Terror - Public (urtbcn.com)

Cheers

Offline KnightOrk

  • Jr. Member
  • **
  • Posts: 36
Re: Balance Teams plugin
« Reply #3 on: June 15, 2011, 05:36:18 PM »
Would like to Test this Plugin, but Attachement deleted  :-\

Edit: I also wrote a Mail @ Mr.Click
« Last Edit: June 16, 2011, 04:50:15 PM by KnightOrk »

Offline opaflamme

  • Newbie
  • *
  • Posts: 1
Re: Balance Teams plugin
« Reply #4 on: June 16, 2011, 11:29:13 AM »
Hi Mr.Click, like KnightOrk, i want test your plugin so please, could you re-upload ?

Thanks.

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Balance Teams plugin
« Reply #5 on: June 16, 2011, 02:21:04 PM »
Provided this works with CoD4, i too would like to test this..
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 983
    • GitHub
Re: Balance Teams plugin
« Reply #6 on: June 17, 2011, 09:53:43 PM »
Hello all. I'm sorry but recently University "killed" me! ;D ;D ;D ;D ;D I re-uploaded the b3 plugin and added some changes (expecially bugfixes).

*** notice: Recently PowerAdminUrt got updated: in the latest version there is a new command !sk that mean SkillShuffle. That command split players between teams according to their skill (skill computed by b3bot). My plugin, otherwise, calculate the current strenght of a player (that means KILLS - DEATHS of the current map). Actually i use both commands on my servers, according to what I need.

@MordyT: the plugin only works with Urban Terror. To send the rcon request to get back the client list I do not use the b3 built in function (because the b3 function do not retrieve number of deaths). I'm not a COD players, I play just UrT, so i don't know how to parse correctly the rcon request on other fps games. If u try to use it on COD4 you'll probabily get an error!
« Last Edit: June 18, 2011, 01:56:49 PM by mr.click »

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: Balance Teams plugin
« Reply #7 on: June 26, 2011, 10:24:21 AM »
Please do not attach plugins to forum posts, for they will be removed over and over again by maintenance tasks.

You can upload your plugin to our download section, at no cost at all ;)

Offline DraNick

  • Newbie
  • *
  • Posts: 6
Re: Balance Teams plugin
« Reply #8 on: May 28, 2012, 12:55:16 PM »
Hello,

I have added the plugin as instructed but when I run the !balance or !balanceteams commands I get "There was an error processing your command".

Any ideas please?

Thank you!

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 983
    • GitHub
Re: Balance Teams plugin
« Reply #9 on: May 28, 2012, 04:02:24 PM »
Erm, I gave up on this plugin after poweradminurt came out with the skuffle command which basically is better. I suggest you to try that solution instead of mine

Offline DraNick

  • Newbie
  • *
  • Posts: 6
Re: Balance Teams plugin
« Reply #10 on: May 28, 2012, 04:42:13 PM »
Thank you! I'll give it a go.

Offline DraNick

  • Newbie
  • *
  • Posts: 6
Re: Balance Teams plugin
« Reply #11 on: May 28, 2012, 04:58:27 PM »
Ran into trouble with poweradminurt as well:

Code: [Select]
120528 17:56:14	CRITICAL	"Error loading plugin: 'NoneType' object has no attribute 'getInt'"
Traceback (most recent call last):
  File "b3\parser.pyo", line 622, in loadPlugins
  File "b3\plugin.pyo", line 56, in __init__
  File "b3\plugin.pyo", line 115, in loadConfig
  File "C:\BigBrotherBot\extplugins\poweradminurt.py", line 278, in onLoadConfig
  File "C:\BigBrotherBot\extplugins\poweradminurt.py", line 445, in LoadVoteDelayer
AttributeError: 'NoneType' object has no attribute 'getInt'

Please help!

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Balance Teams plugin
« Reply #12 on: May 29, 2012, 05:34:04 PM »
Ran into trouble with poweradminurt as well:

Code: [Select]
120528 17:56:14	CRITICAL	"Error loading plugin: 'NoneType' object has no attribute 'getInt'"
Traceback (most recent call last):
  File "b3\parser.pyo", line 622, in loadPlugins
  File "b3\plugin.pyo", line 56, in __init__
  File "b3\plugin.pyo", line 115, in loadConfig
  File "C:\BigBrotherBot\extplugins\poweradminurt.py", line 278, in onLoadConfig
  File "C:\BigBrotherBot\extplugins\poweradminurt.py", line 445, in LoadVoteDelayer
AttributeError: 'NoneType' object has no attribute 'getInt'

Please help!
Full b3.log please.
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline DraNick

  • Newbie
  • *
  • Posts: 6
Re: Balance Teams plugin
« Reply #13 on: May 29, 2012, 05:40:16 PM »
Well I believe the issue is that I was using mod for cd4 while that version is for a different game. Is there a full version (with all the features) for CoD4?

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Balance Teams plugin
« Reply #14 on: May 29, 2012, 05:45:03 PM »
Well I believe the issue is that I was using mod for cd4 while that version is for a different game. Is there a full version (with all the features) for CoD4?
The CoD4 server would need to be modded to allow team switches.

You can look at the poweradmincod4 if you would like...
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

 


Rate this page +1 at Google Search