Raised This Month: $77 Target: $400
 19% 

[CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)


Post New Thread Reply   
 
Thread Tools Display Modes
Effeff
Member
Join Date: Jan 2019
Old 06-01-2019 , 01:13   Re: [CS:GO] Skill Auto Balance (v1.1.7, 2019-6-1)
Reply With Quote #21

1.1.7:
Fixed issue with invalid client after timer because I didn't check if client was valid at end of timer.

okay surely there shouldn't be any other minor bugs popping up now.
Effeff is offline
Effeff
Member
Join Date: Jan 2019
Old 06-02-2019 , 01:09   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #22

1.1.8:
Admins can now swap players with "sm_swapplayers <#userid|name> <#userid|name>"
- As of now I think any admin can do it with no filter/immunity. I haven't been able to test it since my account has root access.

Honestly I'm really excited that I got this to work so quickly, only started working on this earlier today.

Last edited by Effeff; 06-02-2019 at 01:10.
Effeff is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-02-2019 , 15:52   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #23

What about the team balance I posted on Kento's RankMe?
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 10$
eyal282 is offline
Effeff
Member
Join Date: Jan 2019
Old 06-02-2019 , 16:51   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #24

Quote:
Originally Posted by eyal282 View Post
What about the team balance I posted on Kento's RankMe?
Well I can link to your comment on the top of OP if you'd like.

My server doesn't use RankMe so I hadn't thought of using that to sort players. This just sorts by either K/D+1, K/D+K+1, or K*K/D+1 depending on what you choose. The differences b/w those three is whether you want to prioritize the k/d ratio or the number of kills when determining a "skill" value for a player. This method honestly isn't that great, and if I were to instead come up with an "average skill" for the server and try to split the teams in a way to make each team equal to that, it'd be better.

I swap with CS_SwitchTeam so that players who are swapped aren't killed at the end of the round (instead they are frozen, stripped of weapons, and given god until the next round), and it can be disabled so that it behaves like ChangeClientTeam.

There's a couple of ConVars that whoever uses this can play with, like # of players to swap, and some that affect how frequently a balance occurs.

Originally when I was writing this plugin, I did not want it to just be a "team scrambler" - I wanted it to keep teams almost the same, just swapping players enough so that it'd be a little more fair for each team. One of the biggest things players do on my awp server is counter how specific players they're facing play, so if those players end up changing frequently it messes with that aspect.

Also I wrote this in the transitional syntax, dunno if it matters though.
Effeff is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-02-2019 , 22:48   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #25

Quote:
Originally Posted by Effeff View Post
Well I can link to your comment on the top of OP if you'd like.

My server doesn't use RankMe so I hadn't thought of using that to sort players. This just sorts by either K/D+1, K/D+K+1, or K*K/D+1 depending on what you choose. The differences b/w those three is whether you want to prioritize the k/d ratio or the number of kills when determining a "skill" value for a player. This method honestly isn't that great, and if I were to instead come up with an "average skill" for the server and try to split the teams in a way to make each team equal to that, it'd be better.

I swap with CS_SwitchTeam so that players who are swapped aren't killed at the end of the round (instead they are frozen, stripped of weapons, and given god until the next round), and it can be disabled so that it behaves like ChangeClientTeam.

There's a couple of ConVars that whoever uses this can play with, like # of players to swap, and some that affect how frequently a balance occurs.

Originally when I was writing this plugin, I did not want it to just be a "team scrambler" - I wanted it to keep teams almost the same, just swapping players enough so that it'd be a little more fair for each team. One of the biggest things players do on my awp server is counter how specific players they're facing play, so if those players end up changing frequently it messes with that aspect.

Also I wrote this in the transitional syntax, dunno if it matters though.
I like old syntax, they work the same.
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 10$
eyal282 is offline
eliteroyal
AlliedModders Donor
Join Date: Dec 2016
Location: Moldova
Old 07-02-2019 , 08:20   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #26

so does it work as intended?
how to config it for a 24 slots server?
__________________
PEACE FROM MOLDOVA
eliteroyal is offline
Effeff
Member
Join Date: Jan 2019
Old 07-07-2019 , 16:56   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #27

Quote:
Originally Posted by eliteroyal View Post
so does it work as intended?
how to config it for a 24 slots server?
This is the config I have for my 24 slot server that is really fast paced:

HTML Code:
// This file was auto-generated by SourceMod (v1.10.0.6416)
// ConVars for plugin "skillautobalance.smx"


// 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
// -
// Default: "4"
// Minimum: "0.000000"
sab_amounttoswap "4"

// The amount to subtract from a streak if lenientDecay is true
// -
// Default: "2"
// Minimum: "1.000000"
sab_decayamount "2"

// Whether to display chat messages if a balance occurs or not
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sab_displaychatmessages "1"

// Whether to freeze the person swapped if they are alive at round end. If false, they are killed
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sab_freezesurvivor "1"

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

// 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
// -
// Default: "0"
// Minimum: "0.000000"
sab_minrounddiff "5"

// Amount of wins in a row a team needs before autobalance occurs
// -
// Default: "5"
// Minimum: "0.000000"
sab_minstreak "8"

// Formula used to determine each player's 'skill'. 0 = K/D+1, 1 = K/D+K+1, 2 = K*K/D+1
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "2.000000"
sab_scoretype "1"

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

// If 1, subtract decayamount from a team's streak when they lose if their streak is greater than sab_decayamount
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sab_usedecay "0"

// If true, the amount of rounds a team must be ahead by before a balance occurs is the number in sab_minrounddiff
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sab_useminrounddiff "1"
It works as intended, but there is some stuff I could improve in future that I just haven't gotten to yet.
Effeff is offline
Maximoose
AlliedModders Donor
Join Date: Feb 2015
Old 07-12-2019 , 11:12   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #28

Found in recent error logs. Happens 2-7 time per day

L 07/12/2019 - 16:44:55: SourceMod error session started
L 07/12/2019 - 16:44:55: Info (map "de_dust2002") (file "errors_20190712.log")
L 07/12/2019 - 16:44:55: [SM] Exception reported: Script execution timed out
L 07/12/2019 - 16:44:55: [SM] Blaming: skillautobalance.smx
L 07/12/2019 - 16:44:55: [SM] Call stack trace:
L 07/12/2019 - 16:44:55: [SM] [1] Line 535, /home/forums/content/files/2/9/0/0/7/2/175749.attach::RemoveClientWeapons
L 07/12/2019 - 16:44:55: [SM] [2] Line 500, /home/forums/content/files/2/9/0/0/7/2/175749.attach:acifyPlayer
L 07/12/2019 - 16:44:55: [SM] [3] Line 165, /home/forums/content/files/2/9/0/0/7/2/175749.attach::SwapPlayer
L 07/12/2019 - 16:44:55: [SM] [4] Line 256, /home/forums/content/files/2/9/0/0/7/2/175749.attach::BalanceSkill
L 07/12/2019 - 16:44:55: [SM] [5] Line 466, /home/forums/content/files/2/9/0/0/7/2/175749.attach::EventRoundEnd
L 07/12/2019 - 16:487: Error log file session closed.
Maximoose is offline
Effeff
Member
Join Date: Jan 2019
Old 07-16-2019 , 08:59   Re: [CS:GO] Skill Auto Balance (v1.1.8, 2019-6-2)
Reply With Quote #29

Quote:
Originally Posted by Maximoose View Post
L 07/12/2019 - 16:44:55: [SM] [1] Line 535, /home/forums/content/files/2/9/0/0/7/2/175749.attach::RemoveClientWeapons
To immediately stop the script timeout, change this cvar from 1 to 0: "sab_freezesurvivor". This change will kill the player if they are being swapped to the other team though.

The area that seems to have a problem is here:

PHP Code:
void RemoveClientWeapons(int client)
{
    
int iEnt;
    for (
int i CS_SLOT_PRIMARY<= CS_SLOT_C4i++)
    {
        while ((
iEnt GetPlayerWeaponSlot(clienti)) != -1)
        {
            
SafeRemoveWeapon(clientiEnti);
        }
    }

The problem is inside the while loop. "(iEnt = GetPlayerWeaponSlot(client, i)) != -1" is never returning false, meaning the weapon in the current slot is never removed.

I never experienced this issue on my server. Can I have more information about your server, like a list of plugins? If there is a plugin that, for example, makes sure all players always have a knife or fists instead of no weapon, then I think that could cause this problem.

The reason this plugin removes the players weapons is because swapping a player at round-end can be confusing (you are suddenly able to shoot your teammates that survived). So, I give the swapped player god and remove their weapons/freeze them so they cannot kill or be killed until the next round.

If you are interested I can include this workaround: instead of removing their weapons, I can try setting their ammo to 0, so they cannot shoot at anyone (if you have knives they could possibly knife people who are close to them while frozen though). Or a different solution, it just depends on what your server is.

Last edited by Effeff; 07-16-2019 at 09:00.
Effeff 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 23:02.


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