Raised This Month: $99 Target: $400
 24% 

Simple Team Balancer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Antithasys
Moderator
Join Date: Apr 2008
Plugin ID:
1042
Plugin Version:
2.0.96
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
Servers with this Plugin:
16 
Plugin Description:
Balancers players based on player count.
Unapprover:
Reason for Unapproving:
Reported not working; unsupported?
Old 07-26-2009 , 18:32   Simple Team Balancer
Reply With Quote #1

Simple Team Balancer

Description:

Balances the teams based upon player count.

Features:
  • Admins with RESERVATION flag are immune by default
  • Admin flag can be set in simpleteambalancer.cfg
  • A player will not be switched more than once in 5 (default) minutes
  • Balance buddy systems tries to keep players together
  • Ability to restrict the buddy system to stb_adminflag
  • Ability to lock buddy selection
  • Ability to prioritize players; always prefers dead players
  • Ability to control built-in cvars
  • Ability to force the player to accept the balanced team
  • Ability to log balancer activity
  • Bypassed when in TF2 Arena Mode
Commands:
  • buddy <userid> - Adds a balance buddy
  • lockbuddy - Locks your balance buddy selection so only you can change it
Console Variables:
  • stb_enabled - Enable or Disable Simple Team Balancer
  • stb_balancedelay - Delay in seconds to start an autobalance
  • stb_logactivity - Enable or Disable the displaying of events in the log
  • stb_logactivity2 - Enable or Disable the displaying of detailed events in the log (This will spam log)
  • stb_unbalancelimit - Amount of players teams are allowed to be unbalanced by
  • stb_deadonly - Enable or Disable the switching of only dead players
  • stb_priorityenabled - Enable or Disable the prioritization of living players
  • stb_uberlevel - Min level medic must have to have priority over other players. Setting to 0 will rarely switch a living medic
  • stb_switchbackforced - Amount of time in seconds to not switch a player twice and force the team if enabled
  • stb_livingplayercheckdelay - Delay in seconds to start checking living players once teams become unbalanced
  • stb_livingplayerswitchdelay - Delay in seconds to switch living players once selected
  • stb_roundstartdelay - Delay in seconds to start balancing teams after the start of a round
  • stb_adminflag - Admin flag to use for immunity. Must be in char format
  • stb_buddyenabled - Enable or Disable the buddy system
  • stb_buddyrestriction - Enable or Disable Admin Only buddy lists
  • stb_convarcontrol - Enable or Disable the control of builtin console variables
  • stb_mp_autoteambalance
  • stb_mp_teams_unbalance_limit
A simpleteambalancer.cfg file will be made when first ran. It will be located in /cfgs/sourcemod

Installation:
Place the simple-teambalancer.smx in the /sourcemod/plugins dir.
Place the simple-plugins.smx in the /sourcemod/plugins dir.
Place the simpleteambalancer.phrases.txt in the /sourcemod/translations dir.
Changelog:

Quote:
2.0.96
Added checks for invalid cvars
Added resetting of globals on mapstart
Added logactivity2 message for IsUnBalanced function
Frequently Asked Questions:

Q: How does it determine if the teams are unbalanced?
A: Purely by player count. Example: 10vs13

Q: Does it take the players score into account?
A: No.

Q: Does it take the players K/D ratio into account?
A: No.

Q: How does it pick a player to switch?
A: The plugin goes through three layers of prioritization:

Find a dead player in the following order:
  • If he is an admin, skip him
  • If he has been switched before, skip him
  • If he has a buddy and is on the same team, skip him
  • If he has a buddy and is not on the same team, switch him
  • If has buildings built, skip him (TF2 Only) (stb_priorityenabled 1)
  • If he is just a regular dead player, switch him
Find a living player in the following order:
  • If he is an admin, skip him.
  • If he has been switched before, skip him
  • If he has a uber, skip him (TF2 Only) (stb_priorityenabled 1)
  • If he has buildings built, skip him (TF2 Only) (stb_priorityenabled 1)
  • If he has a buddy and is on the same team, skip him (stb_buddyenabled 1)
  • If he has a buddy and is not on the same team, switch him (stb_buddyenabled 1)
  • If he is just a regular live player, switch him
If the plugin still cannot find a player to switch, it will get a random non admin player, and switch him after the delay.

If someone dies and fits the requirements after a live player has been selected the plugin will then switch that player. With the delays involved is more than likely that a dead player with be switched before a living one. Of course, you can always increase the two delays involved to increase the odds of a dead player being switched. It is also very rare for it to have to result to finding a random living player. You can also now just have it search for dead players with the dead only cvar.

Q: Does this replace the built-in autobalancer?
A: Yes.

Q: Do I have to disable the built-in autobalancer?
A: By default this plugin takes control of the console variables that control the built-in autobalancer and team balance limits. I have never been a fan of forcing changes to servers with plugins without the ability to turn it off. Therefore stb_convarcontol can turn this off. But I highly suggest you leave it on.

Q: Does disabling this plugin turn on the built-in autobalancer?
A: No. If you have stb_convarcontol on, it will release the console variables so you can then set them.

Q: Can someone joining the game and picking a team make the teams unbalanced?
A: Only if you don't let it control the built-in console variables and have a different mp_teams_unbalance_limit.

Q: Can admins join any team making the teams unbalanced?
A: No. Admins are immune to switches, but not the built-in team joining controls.

Q: What is a balance buddy?
A: A balance buddy is a person that you pair up with. It will try to keep you and your buddy on the same team.

Q: Can I have more than 1 balance buddy?
A: No.

Q: Can anyone make me their balance buddy?
A: Depends on stb_buddyrestriction. By default only admins can select a buddy. If open to the public, than anyone can.

Q: If someone else selects me as a balance buddy does that override my selection?
A: Yes. You can now lock it so that only you can change your balance buddy with the command lockbuddy.

Q: Does my balance buddy remain during a map change?
A: No. You have to reselect your buddy on a map change.

Q: Are players forced to the team?
A: Yes. The player has to accept his team for five(default) mins.

Future Updates:

Looking for additional translations! If you have or can translate the phrases, please do and post with the new translations. I will add them to the file and certainly credit you.

French - by Slipenbois
German - by gH0sTy
Hungarian - by KhyrOO

Notes:

This plugin requires Simple SourceMod Plugins Core to work. It has NOT been included in the .zip file.

There was a problem with the tf2.inc file that comes with sourcemod. I had to change that file in order to get it to work with other games. I included that file with my changes as well. Plugin is compiled in 1.2.3.
Attached Files
File Type: zip Simple Team Balancer.zip (34.3 KB, 2737 views)
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 09-15-2009 at 19:10. Reason: updated version
Antithasys is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 07-26-2009 , 18:39   Re: Simple Team Balancer
Reply With Quote #2

Reserved
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 07-26-2009 , 19:34   Re: Simple Team Balancer
Reply With Quote #3

So what, these are the same plugins just rewritten and must be used with the core? Any particular reason for this?
retsam is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 07-26-2009 , 19:44   Re: Simple Team Balancer
Reply With Quote #4

It is very similar to the old plugin. It uses the new core so now it's multi-game. It should support any game xpt for l4d.

It was pretty much rewritten from the ground up, and since it uses the new core, it will be very friendly with other plugins that move players. Assuming they use to the core as well.

I changed the public cvar, and since I did that, I went ahead and made a new thread.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 07-26-2009 at 19:53.
Antithasys is offline
Kenny Loggins
SourceMod Donor
Join Date: Jun 2008
Location: Rochester, MN
Old 07-30-2009 , 02:34   Re: Simple Team Balancer
Reply With Quote #5

I'm seeing this error in my SM error logs

Quote:
L 07/29/2009 - 2334: [SM] Displaying call stack trace for plugin "simple-teambalancer.smx":
L 07/29/2009 - 2334: [SM] [0] Line 1148, C:\Compiler\scripting\simple-teambalancer.sp::FindSwitchablePlayer()
L 07/29/2009 - 2334: [SM] [1] Line 1371, C:\Compiler\scripting\simple-teambalancer.sp::Timer_LivingPlayerCheck()
__________________

Server Admin / Leader
ClanAO.com
Kenny Loggins is offline
BrutalGoerge
SourceMod Donor
Join Date: Jul 2007
Old 07-30-2009 , 02:43   Re: Simple Team Balancer
Reply With Quote #6

the reason that the error is being thrown is missing from your log

what's on the line above L 07/29/2009 - 2334: [SM] Displaying call stack trace for plugin "simple-teambalancer.smx"

??
__________________
My Pluggies If you like, consider to me.

Last edited by BrutalGoerge; 07-30-2009 at 02:49.
BrutalGoerge is offline
Kenny Loggins
SourceMod Donor
Join Date: Jun 2008
Location: Rochester, MN
Old 07-30-2009 , 03:42   Re: Simple Team Balancer
Reply With Quote #7

Looks like I only see it on one server it might just a one off issue Iím thinking. The error right above it is related to the maprate.smx plugin I have seen this error for a while now.

However I did notice almost all my servers that had this plugin loaded crash on and off all day today. I also loaded 2 other plugin one your new version of gScramble (great plugin) and the other was the new version of SourceBans. I have used the old version of this plugin for a long time with no issues (also great plugin) so Iím back on that version to see if this newer version is indeed this problem.
__________________

Server Admin / Leader
ClanAO.com
Kenny Loggins is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 07-30-2009 , 04:37   Re: Simple Team Balancer
Reply With Quote #8

This new version has been running on my servers for two weeks or more. I have never seen that error message you posted. More information would be helpful.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Kenny Loggins
SourceMod Donor
Join Date: Jun 2008
Location: Rochester, MN
Old 07-30-2009 , 14:15   Re: Simple Team Balancer
Reply With Quote #9

I wish I had more info I replaced the plugin last night with your older version and my crashes have seemed to have stopped. Aside from that one error i posted I see nothing in my logs (Lets just assume that error was a one off since I only noticed it once in one server)

My servers almost never crashed before I installed the plugin and the next day they started crashing almost every hour. Once I got home I noticed servers that did not restart had no issue (since they still had the old version running) that’s what pointed me in the direction of the plugin.

I wanted to give it more time before I posted just to see if I ran into more troubles today but so far it’s looking stable with no problems. If you need me to test anything just let me know.
__________________

Server Admin / Leader
ClanAO.com
Kenny Loggins is offline
BrutalGoerge
SourceMod Donor
Join Date: Jul 2007
Old 07-30-2009 , 14:43   Re: Simple Team Balancer
Reply With Quote #10

it just seems you didn't post all the log...
usually it goes

L 07/30/2009 - 149:52: SourceMod error session started
L 07/30/2009 - 149:52: Info (map "pl_goldrush") (file "errors_20090730.log")
L 07/30/2009 - 149:52: [SM] Native "some native" reported: some error
L 07/30/2009 - 149:52: [SM] Displaying call stack trace for plugin "some plugin.smx":
L 07/30/2009 - 149:52: [SM] [0] Line ####, some plugin.sp::Some function()

That 3rd line is the most important.
__________________
My Pluggies If you like, consider to me.
BrutalGoerge is offline
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:43.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode