Home › Forums › Miscellaneous › Archives › Liam Team Balancer
- This topic has 73 replies, 19 voices, and was last updated 19 years ago by
Liam.
-
AuthorPosts
-
August 12, 2007 at 11:23 pm #2659
Liam
ParticipantOkay, so we’ve played around with different ways of handling the team balancer and while its working, its not as efficient as it could be. So we would like your input on it.
What are your thoughts on how it could work better.
Keep this in mind when replying:
First off, dont be scared to suggest a brand new direction. The meat of the plugin is written and so changing the logic is easy.
Secondly, do not flame/troll this post.

Third, be imaginative. Nothing’s too out of the ballpark.
Anyways, once we compile a list of suggestions we’ll figure out what seems like it would work best and write the plugin accordingly.
Thanks in advance.
Liam
August 12, 2007 at 11:36 pm #24531Liam
ParticipantJust for teh record, the team balancer does two things:
The first is it keeps teams balanced on size. (That part works fine.)
The second is it keeps teams balanced on wins. (That part needs your input.)
August 13, 2007 at 5:26 pm #24557Fascist Flakes (Jagr)
ParticipantAugust 13, 2007 at 5:35 pm #24558Outie5000
Participanti think it needs to balance size based on KDR because half of the time there will be one team with 40% of the players having double digit kills, and the other team might have 1 person if even, with double digits.
While it helps a team win a round or two, its pretty unfair for the people who are already at a disadvantage with weapons and money.
August 13, 2007 at 5:36 pm #24559Liam
ParticipantOutie5000 said:
i think it needs to balance size based on KDR because half of the time there will be one team with 40% of the players having double digit kills, and the other team might have 1 person if even, with double digits.While it helps a team win a round or two, its pretty unfair for the people who are already at a disadvantage with weapons and money.
That is an excellent suggestion. Anyone else have any input on this idea?
August 13, 2007 at 6:23 pm #24562Liam
ParticipantFascist Flakes (Jagr) said:
Here you go Liam, found this out and trying to figure why it is not balancing with this.Was it even attempting to balance?
August 13, 2007 at 7:08 pm #24563Kuros
ParticipantIt didn’t seem to be.
August 14, 2007 at 8:19 am #24581pinkcs
ParticipantWhat Facist is showing has been the norm since the update you mentioned previously. I’ve seen very little balancing myself, though I have been switched a lot more, but normally only to even teams when someone else stacks and only when my score is low.
Over the past week I haven’t seen the Balancer move a high scoring player once. And on the occasions I’ve seen teams balanced on account of player numbers, I often only see the leading team being given the additional player.
I’ve tried to keep track of the balances made by the Team Balancer, but its been difficult because much more often than not no balancing takes place. This isn’t the case 100% of the time, as a few rounds I’ve played in have had a significant amount of players being moved, although its hard to say whether it Balanced teams or not (it could’ve all been down to one or a few players stacking, it didn’t seem to be down to the Balancer trying to balance out Win, Streak or Score variables etc).
August 14, 2007 at 9:40 am #24582Liam
Participantpinkcs said:
What Facist is showing has been the norm since the update you mentioned previously. I’ve seen very little balancing myself, though I have been switched a lot more, but normally only to even teams when someone else stacks and only when my score is low.Over the past week I haven’t seen the Balancer move a high scoring player once. And on the occasions I’ve seen teams balanced on account of player numbers, I often only see the leading team being given the additional player.
I’ve tried to keep track of the balances made by the Team Balancer, but its been difficult because much more often than not no balancing takes place. This isn’t the case 100% of the time, as a few rounds I’ve played in have had a significant amount of players being moved, although its hard to say whether it Balanced teams or not (it could’ve all been down to one or a few players stacking, it didn’t seem to be down to the Balancer trying to balance out Win, Streak or Score variables etc).
A new update was done last night. We tried something new since I haven’t had a lot of suggestions here. If what we did doesn’t work we’ll figure something out.
August 14, 2007 at 10:02 am #24583pinkcs
ParticipantAs a suggestion.
After balancing team numbers….
How about making the Balancer total all kills on both teams, total all deaths on both teams, then subtract the Deaths from the Wins. And then make it check the difference between both teams Values at the end of the round, If the difference is greater than the 2/3rd of the number of players in the server it places the lowest scorer on the losing team onto the winning team then looks for the a player on the winning team with a score (Kills minus Deaths) that is greater than half the initial difference between the two team values + the number of kills of the person just switched from the losing team. This chosen person is then switched to the losing team.
If the team that lost the round has the higher Team Value, only balancing based on team sizes occurs.
Example .start
Team CT Wins the round.
Teams are balanced if necessary
Check if Winning team has a greater Team Value.
Team CT = 24Kills 12Deaths
Team T = 23kills 21Deaths
Team CT Value = 12
Team T Value = 2
Lowest scorer (2Kills) from Team T is switched to Team CT.
Difference in Team Values = 10
Divide by 2 = 5
Plus Switched players kills = 7
Is there a Player on Team CT with 7+ kills?
Look for CT player with kills = to 7? Increment till a player is found.
If no player is found with 7+ kills, Switch CT player with highest Kills to Team T.
.end
August 14, 2007 at 11:03 am #24585Liam
Participantpinkcs said:
As a suggestion.After balancing team numbers….
How about making the Balancer total all kills on both teams, total all deaths on both teams, then subtract the Deaths from the Wins. And then make it check the difference between both teams Values at the end of the round, If the difference is greater than the 2/3rd of the number of players in the server it places the lowest scorer on the losing team onto the winning team then looks for the a player on the winning team with a score (Kills minus Deaths) that is greater than half the initial difference between the two team values + the number of kills of the person just switched from the losing team. This chosen person is then switched to the losing team.
If the team that lost the round has the higher Team Value, only balancing based on team sizes occurs.
Example .start
Team CT Wins the round.
Teams are balanced if necessary
Check if Winning team has a greater Team Value.
Team CT = 24Kills 12Deaths
Team T = 23kills 21Deaths
Team CT Value = 12
Team T Value = 2
Lowest scorer (2Kills) from Team T is switched to Team CT.
Difference in Team Values = 10
Divide by 2 = 5
Plus Switched players kills = 7
Is there a Player on Team CT with 7+ kills?
Look for CT player with kills = to 7? Increment till a player is found.
If no player is found with 7+ kills, Switch CT player with highest Kills to Team T.
.end
Thats actually a really good idea.

Anyone else have any suggestions/comments about this? If not, I’ll write it and we’ll give it a go.
August 15, 2007 at 2:47 pm #24654pinkcs
ParticipantWhats the ETA on the next update? The way things stand right now, if its going to take a while to get major changes made it might be worth ripping the artificial logic out of the balancer and just leave it as an anti stacking device for the time being. Right now its consistently stacking the players with the highest K:D onto one team.
August 15, 2007 at 2:51 pm #24656Bitey
ParticipantCan’t do anything right now we have no access to Tron.
August 15, 2007 at 2:54 pm #24657Sushi
ParticipantAs of the last update, as has been said, the balancer is stacking teams horribly. If players attempt to switch teams themselves, it just autos them back. Yea.
August 15, 2007 at 2:56 pm #24659Fascist Flakes (Jagr)
Participantpinkcs said:
Whats the ETA on the next update? The way things stand right now, if its going to take a while to get major changes made it might be worth ripping the artificial logic out of the balancer and just leave it as an anti stacking device for the time being. Right now its consistently stacking the players with the highest K:D onto one team.The teambalancer is updated and fixed on Liam’s side, unfortunately we’ve been locked out of the server by ITS here at Western and we are working to get our access back into it so we can replace the balancer with the updated version.
August 15, 2007 at 3:34 pm #24663pinkcs
ParticipantThanks for the update.
August 15, 2007 at 3:38 pm #24664Liam
Participantpinkcs said:
Thanks for the update.Kuros emailed ITS and asked them to update it. Hopefully they will do it.
August 15, 2007 at 6:08 pm #24684TouchDown
ParticipantHmm… interesting ways to use TB but here’s what I think should happen. I am no programmer or anything btw so don’t expect much x_X.
The plugin should first calculate everyone’s K:D ratio.
For instance: 5vs5
P1-CT-k/d: 2.5-5/2
P2-T-k/d:1.1-10/9
P3-CT-k/d:2-20/10
P4-T-k/d:1.5-15/10
P5-T-k/d:0.5-5/10
P6-CT-k/d:1.5-40/30
P7-T-k/d:1.0-5/5
P8-CT-k/d: 0-0/5
P9-CT-k/d: (undefined – x-1 for example)-5/0
P10-T- k/d:1.4-7/5
Second we add the amount of wins to each player depending on their team.
Add their rank to the amount of time they’ve played (in hours) and now we divide them in their separate teams. The team that has the most values that are highest automatically loses x amount of players (depending on how many players on each time) and the team with the least values that are highest receives x amount of players (also depending on how many players on each time).
If I continue my example:
P1 has a k:d ratio of 2.5, played for 10 minutes and is on the winning team (10 times) his “rank score” is 2.5 + 0.16666666666666666 + 10 = 12.16666666666666666666666666
P6 has a k:D ratio 1.5, played for 1 hour and is on the winning team (10 times) his “rank score” is 1.5+1+10 = 12.5
P4 has a k:d ratio 1.5, played for 30 minutes and is on the losing team (2 times) his “rank score” is 1.5 +0.5=2=4
P5 has a k:D ratio 0.5, played for 20 minutes is on the losing team (2 times) his “rank score” is 0.5+0.3+2 = 2.8
(this is just an example, usually it’s way different from this) Note: If the value of the k:d ratio is undefined (as in 5/0 or such), add the amount of kills to the rank score.
Now the TB will now switch people with a score with less than 5 with someone with who has a score more than 10 on opposing teams.
IF the teams are NEARLY tied, (Following the same k:d ratios)
P1 has a k:d ratio of 2.5, played for 10 minutes and is on the winning team (5 times) his “rank score” is 2.5 + 0.16666666666666666 + 5 = 7.56666666666666666666666666
P6 has a k:D ratio 1.5, played for 1 hour and is on the winning team (5 times) his “rank score” is 1.5+1+5 = 7.5
P4 has a k:d ratio 1.5, played for 30 minutes and is on the losing team (4 times) his “rank score” is 1.5 +0.5+5=7
P5 has a k:D ratio 0.5, played for 20 minutes is on the losing team (4 times) his “rank score” is 0.5+0.3+4= 4.8
As you can tell the rank scores are closer to each other but as a revision: I will add all their kills subtracted by their deaths
P1 has a k:d ratio of 2.5, played for 10 minutes and is on the winning team (5 times) his “rank score” is 2.5 + 0.16666666666666666 + 5 + 3= 10.56666666666666666666666666
P6 has a k:D ratio 1.5, played for 1 hour and is on the winning team (5 times) his “rank score” is 1.5+1+5 +10 = 17.5
P4 has a k:d ratio 1.5, played for 30 minutes and is on the losing team (4 times) his “rank score” is 1.5 +0.5+4 +5=11
P5 has a k:D ratio 0.5, played for 20 minutes is on the losing team (4 times) his “rank score” is 0.5+0.3+4 -5= -0.2
This revision can be used by the machine if the rank scores are very close, now we can adjust the teams based on the current scores.
17.5 will now switch with -0.2 and 11 will switch with 10.5666666666666666666666666666666666666666666. However, as a word of caution, we will not need this revision unless the scores are close.
I think the machine can calculate the closeness based on the scores:
A-P1-CT
B-P2-CT
C-P3-T
D-P4 -T
If A+B/2 <= to A or B
If A+C/2 <= to A or C etc…
Then we can call the revision to program.
This algorithm I guess is decent for most circumstances.
Jonny
August 15, 2007 at 7:04 pm #24688Phonetically Phamous (dice
Participantanyway to make the player switch very early round start,, this way all the *edited*ing people will end
August 15, 2007 at 7:12 pm #24689pinkcs
ParticipantJust put in a delay on the player switch, so it makes the switch the second before the teams are reset, instead of at the exact moment the round is won.
August 15, 2007 at 7:21 pm #24690Kuros
ParticipantEnd of round swapping plagues even the best of the best team balancers. Just get used to it.
August 15, 2007 at 8:30 pm #24692Phonetically Phamous (dice
Participanti kinda enjoy the end of round rush, keeps everyone on their toes,,, was curious if you did it at the begening of the round during the “freeze time”
or can their be an end of round freeze time of say 1 second?
August 15, 2007 at 8:43 pm #24694Liam
ParticipantOnce we move to Sourcemod and get away from metamod I’ll do that. With Metamod its like an extra thousand lines of code to get it to swap like your talking about.
Sourcemod has all of the stuff built into its framework to allow that more easily.
August 16, 2007 at 4:18 pm #24738pinkcs
ParticipantWhats the current timeframe for moving to Sourcemod? Is it just a matter of time depending on when access to the server box is regained? Or will it be awhile before we see these sort of changes?
Not important questions, but I’m just being overtly curious.
August 16, 2007 at 5:00 pm #24741Phonetically Phamous (dice
Participantthats really pending who our new webmaster and/or CS:S council leader will be
August 16, 2007 at 5:13 pm #24744Kuros
Participantpinkcs said:
Whats the current timeframe for moving to Sourcemod? Is it just a matter of time depending on when access to the server box is regained? Or will it be awhile before we see these sort of changes?Not important questions, but I’m just being overtly curious.
Sourcemod isn’t quite usable yet, but I can’t wait till it is. As soon as it’s ready, that’s where we’ll be.
August 21, 2007 at 9:34 pm #25063Liam
ParticipantWCUTB has been updated as of August 21, 2007. Enjoy.

Thanks to the wonderful people at ITS for taking care of that.
August 22, 2007 at 11:28 am #25092rainefardreamer
Participantcould you modify it so bracket is always on the losing team? that dood stacks like crazy (kidding)
but it seemed to at least not stack the teams, at least not enough that i noticed…
August 22, 2007 at 12:06 pm #25095Bracket
ParticipantNo more team stacker? Back to the manual way =/
August 22, 2007 at 12:13 pm #25097Liam
ParticipantActually the balancer seemed to be working really well yesterrday. Let me know.
-
AuthorPosts
- The forum ‘Archives’ is closed to new topics and replies.