[CS:GO] Skill Auto Balance

Post Reply
User avatar
Andreeas
Hero Member
Hero Member
Posts: 601
Joined: Wed Jan 22, 2020 8:17 pm
Jucator SA:MP ?: Nu
Nick:: Andreeas
Jucator CS ?: Nu

[CS:GO] Skill Auto Balance

Post by Andreeas »

Background/Credits

I play on an AWP-only server, and frequently see that the scoreline ends up around 20-1 for one team. I looked for some plugins that involved scrambling teams, and while some do exist, the few that I've seen are relatively old. These aren't all that I've seen but the first ones I can find after searching.

Admin Player Team Switch and Scramble Menu by r5053
[CS:S/GO+DoD:S] Auto Team Scrambler 2 (Updated 27-12-2012 @ DODS/CSGO) by RedSword
[ANY MOD] SwapTeam v1.2.6 (Updated 30/09/12) by bobbobagan
CS:S Team Balance by dalto
RankMe RankScramble by eyal282

This doesn't have all of the features of the plugins I've shown above, but some of the things I've included were inspired by these and I'd like to include some of those features in the future.

Description

After a team wins a certain amount of rounds in a row, at the end of the round a pool of N of the top players on the winning team and N of the bottom players on the losing team are chosen and half of those two pools are swapped to the other team.


More specifically, this is how the plugin decides who to swap:

1. Check the value of the AmountToSwap convar
2. Pick the team with the fewest amount of players, and divide that by 4
3. Note that there exists a 3rd value, MAX_BALANCE_SIZE, which is 7 (the only reason for that is my server has 30 player cap and 8*2*2 = 32 so it wouldn't need to be that high)
4. Pick the lowest of the three numbers above (AmountToSwap vs. smaller team players / 4 vs. MAX_BALANCE_SIZE)
5. Multiply that number by 2
6. Pick the top N players on the winning team based off the ScoreType convar, store them in highestPlayers array
7. Pick the bottom N players on the losing team based off the ScoreType convar, store them in lowestPlayers array
8. Swap every other player in each array to the other team.

ConVars

Please change these as you see fit. The default ones are meant for my server, and I'm still trying to mess w/ the numbers to get something good. I think minstreak should definitely be higher, I am trying that out.

Spoiler

Code: Select all

sab_minstreak "5" //Amount of wins in a row a team needs before autobalance occurs

sab_scoretype "1" //Formula used to determine each player's 'skill'. 0 = K/D+1, 1 = K/D+K+1, 2 = K*K/D+1

sab_displaychatmessages "1" //Whether to display chat messages if a balance occurs or not

sab_freezesurvivor "1" //Whether to freeze the person swapped if they are alive at round end. If false, they are killed

sab_usedecay "0" //If 1, subtract sab_decayamount from a team's streak when they lose if their streak is greater than decayamount

sab_decayamount "2" //The amount to subtract from a streak if lenientDecay is true

sab_useminrounddiff "1" //If true, the amount of rounds a team must be ahead by before a balance occurs is the number in sab_minrounddiff

sab_minrounddiff "0" //The number of rounds the team that is in the lead must be ahead by in order for a swap to occur. So, if the team that is behind goes on a winstreak, they must first win enough rounds to be ahead in score of the other team before they will be swapped

sab_minplayersneeded "4" //The amount of players not in spectate must be at least this number for a balance to occur

sab_amounttoswap "4" //The number of players on each team that will be swapped. This will instead use the number that is 1/8 of the maximum clients for your server if you set it to a number higher than what that would be

sab_truerandom "0" //If true, will choose randomly from the pool of highest and lowest players. If false, will choose every other player. 
Installation

Just drag and drop the .smx and you're good to go, the config will be auto-generated in ./csgo/cfg/sourcemod/SkillAutoBalance.cfg

Dependencies

These are the #includes at the top of the .sp for this script, all of which should already come with your sourcemod installation. In other words, this doesn't depend on anything else.



Download
Source
Post Reply

Return to “Server Management”