Raised This Month: $51 Target: $400
 12% 

Fair Team Balancer


Post New Thread Reply   
 
Thread Tools Display Modes
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 02-14-2008 , 03:55   Re: Fair Team Balancer
Reply With Quote #21

The plugin works fine on my TF2 server.

The only thing is that the sm_teams command gives "Plugin encountered error 15: Array index is out of bounds"

Also is there any way to disable the message that states that the teams are balanced?
__________________
Extreme_One is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-14-2008 , 05:57   Re: Fair Team Balancer
Reply With Quote #22

I can not thank you enough. I have started writing one of these for TF2 a couple times now, and just never had the time to finish it or would run into a stupid problem.

Future update suggestions I have for this regarding TF2...

1) Instead of checking every 2 minutes, why not just check if the teams are even, or 1 person apart on player death, then set it to balance in X seconds (15 or 30 probably) and after X seconds check to see if its still imbalanced, then balance them if its not.

2) Add an option for player balance immunity. The biggest problem right now is some people will just get switched back and fourth, back and fourth. Maybe add something that once a player is switched, they won't be switched again for X minutes (10 would probably be optimal, but making it a cvar would be nice). Could just make an array and add the players to it after they are switched as some sort of immunity list.

3) In the future a skill based balancer would rock, this might be a big enough addition to make a different plugin. But you could do it as easily as based on how many points they have, or do a more advanced version and do it based on a kill to death ratio, then take medics into account and what not. This would be on every server if done right lol.
__________________
CrimsonGT is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 02-14-2008 , 07:07   Re: Fair Team Balancer
Reply With Quote #23

DWN:
The line numbers listed in your post actually don't make sense. None of the line numbers matches with anything in my plugin... Maybe you don't have the latest version?

The checks I've added should prevent such errors from happening, if the latest version doesn't work either I'll add a few more checks.

Quote:
Originally Posted by DontWannaName View Post
The auto checker spams chat a lot with failed to switch teams, they are full or w/e
What do you mean, I haven't implemented any such messages... Please post a server log or something...

Quote:
Originally Posted by Extreme_One View Post
The only thing is that the sm_teams command gives "Plugin encountered error 15: Array index is out of bounds"
There should be a line number listed?

Quote:
Originally Posted by Extreme_One View Post
Also is there any way to disable the message that states that the teams are balanced?
yes, delete the prints in lines 137/138. I might add a cvar or other parameter for that if requested.
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble

Last edited by MistaGee; 02-14-2008 at 07:46.
MistaGee is offline
Send a message via ICQ to MistaGee
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 02-14-2008 , 07:32   Re: Fair Team Balancer
Reply With Quote #24

Quote:
Originally Posted by MistaGee View Post
...



There should be a line number listed?
OK yeah I did get that info last night but forgot to post it.
I'll grab logs and post later.

Quote:
Originally Posted by MistaGee View Post
...
yes, delete the prints in lines 137/138. I might add a cvar or other parameter for that if requested.
Thank you I can do that

Quote:
Originally Posted by DontWannaName View Post
...The auto checker spams chat a lot with failed to switch teams, they are full or w/e
Me plus DontWannaName = 2 requests for a cvar to have a cvar to disable chat for when there's no balancing required.
__________________
Extreme_One is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 02-14-2008 , 07:39   Re: Fair Team Balancer
Reply With Quote #25

Quote:
Originally Posted by CrimsonGT View Post
2) Add an option for player balance immunity. The biggest problem right now is some people will just get switched back and fourth, back and fourth. Maybe add something that once a player is switched, they won't be switched again for X minutes (10 would probably be optimal, but making it a cvar would be nice). Could just make an array and add the players to it after they are switched as some sort of immunity list.
As you pointed out, adding such a feature is fairly easy. I just want to make sure the rest works, after that I'll implement that

Quote:
Originally Posted by CrimsonGT View Post
3) In the future a skill based balancer would rock, this might be a big enough addition to make a different plugin. But you could do it as easily as based on how many points they have, or do a more advanced version and do it based on a kill to death ratio, then take medics into account and what not. This would be on every server if done right lol.
It is already skill based... the algorithm in the first post describes how the plugin decides who to switch.

Besides, I don't think I need to take medics into special account, because they get scores whenever a player they're healing kills someone (I'm always in the top 5 of the server's scoreboard, and I play medic all the time )...
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
FredJed223
Senior Member
Join Date: Feb 2008
Old 02-14-2008 , 15:15   Re: Fair Team Balancer
Reply With Quote #26

Updated my servers to newest version... Will post back with any results.

Thanks
FredJed223 is offline
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 02-14-2008 , 15:27   Re: Fair Team Balancer
Reply With Quote #27

Quote:
Originally Posted by MistaGee View Post
...


There should be a line number listed?


...
Code:
 27 "Fair Team Balancer" (2.4) by MistaGee
Code:
20:23:53 sm_teams
20:23:53 L 02/14/2008 - 20:18:20: [SM] Plugin encountered error 15: Array index is out of bounds
20:23:53 L 02/14/2008 - 20:18:20: [SM] Debug mode is not enabled for "fairteambalancer.smx"
20:23:53 L 02/14/2008 - 20:18:20: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 27 on
Code:
20:25:07 sm plugins debug 27 on
20:25:07 [SM] Successfully toggled debug mode on plugin fairteambalancer.smx.
20:25:16 sm_teams
20:25:16 L 02/14/2008 - 20:19:43: [SM] Plugin encountered error 15: Array index is out of bounds
20:25:16 L 02/14/2008 - 20:19:43: [SM] Displaying call stack trace for plugin "fairteambalancer.smx":
20:25:16 L 02/14/2008 - 20:19:43: [SM]   [0]  Line 123, /home/groups/alliedmodders/forums/files/2/1/3/1/23555.attach::PerformTeamCheck()
20:25:16 L 02/14/2008 - 20:19:43: [SM]   [1]  Line 101, /home/groups/alliedmodders/forums/files/2/1/3/1/23555.attach::Command_Teams()
__________________
Extreme_One is offline
ThatGuy
Senior Member
Join Date: Nov 2007
Old 02-14-2008 , 22:39   Re: Fair Team Balancer
Reply With Quote #28

I find it rather annoying when it switches on events for TF2, or just when teams are fine.

For example..

Quote:
It's 12 on 12. Red has 2 cap points blue has 3. Scores are almost identical....

The switcher takes the Reds BEST player and puts it to blue...

causing the teams to be 11-13 and scores to be in favor of the blue team..
In other words, some times it actually unbalances the game when the teams are perfect, couldn't this be setup to only change the player if there's a 1 player difference? Also, would it be possible to have an option to turn on/off switching on events so we can just setup our timer every how many seconds we want? I don't think both are really necessary, especially if you set the timer to 30 seconds.
__________________

Last edited by ThatGuy; 02-14-2008 at 22:44.
ThatGuy is offline
lamdacore
Member
Join Date: Aug 2005
Old 02-15-2008 , 04:36   Re: Fair Team Balancer
Reply With Quote #29

Quote:
Originally Posted by Extreme_One View Post
Code:
 27 "Fair Team Balancer" (2.4) by MistaGee
Code:
20:23:53 sm_teams
20:23:53 L 02/14/2008 - 20:18:20: [SM] Plugin encountered error 15: Array index is out of bounds
20:23:53 L 02/14/2008 - 20:18:20: [SM] Debug mode is not enabled for "fairteambalancer.smx"
20:23:53 L 02/14/2008 - 20:18:20: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 27 on
Code:
20:25:07 sm plugins debug 27 on
20:25:07 [SM] Successfully toggled debug mode on plugin fairteambalancer.smx.
20:25:16 sm_teams
20:25:16 L 02/14/2008 - 20:19:43: [SM] Plugin encountered error 15: Array index is out of bounds
20:25:16 L 02/14/2008 - 20:19:43: [SM] Displaying call stack trace for plugin "fairteambalancer.smx":
20:25:16 L 02/14/2008 - 20:19:43: [SM]   [0]  Line 123, /home/groups/alliedmodders/forums/files/2/1/3/1/23555.attach::PerformTeamCheck()
20:25:16 L 02/14/2008 - 20:19:43: [SM]   [1]  Line 101, /home/groups/alliedmodders/forums/files/2/1/3/1/23555.attach::Command_Teams()
that is because he is counting the players being in spectrators, too. but the array for counting has only a size of 2 (for two groups and not three)
so the simpliest solution is to check if player are in a team greater than 1.

from row 120
Code:
        for( new i = 1; i < mc; i++ ){
                if( IsClientInGame(i) ){
                        cTeam = GetClientTeam(i);
                        // MOD BY LAMDACORE
                        if (cTeam >= 2) {
                                ++tPlayers[ cTeam-2 ];
                                tFrags[ cTeam-2 ] += GetClientFrags(i);
                                }
                        // END MOD BY LAMDACORE
                        }
                }
lamdacore is offline
raffe2
Member
Join Date: Dec 2005
Old 02-15-2008 , 05:03   Re: Fair Team Balancer
Reply With Quote #30

When i try to use this on cstrike I get:
"[AMXX] Invalid Plugin (plugin "fairteambalancer.smx")"

You use include sourcemod and i play cstrike, is that the problem?
I use amxx 1.76 and not 1.8, could this be the problem?
Normally I get a .amxx-file, but his is a .smx-file, maybe it is that?

Last edited by raffe2; 02-15-2008 at 05:20.
raffe2 is offline
Reply



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 08:10.


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