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

[CS:GO] Skill Auto Balance (v4.1.2, 2021-2-20)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Effeff
AlliedModders Donor
Join Date: Jan 2019
Location: discord: ff#0533
Plugin ID:
6578
Plugin Version:
4.1.2
Plugin Category:
Server Management
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    [CS:GO] A configurable automated team manager.
    Old 05-25-2019 , 03:26   [CS:GO] Skill Auto Balance (v4.1.2, 2021-2-20)
    Reply With Quote #1

    Description: A configurable automated team manager
    Skill Auto Balance is a simple concept. Place players on teams so the skill level of each team is approximately the same. In practice, doing this is very difficult. How should we define "skill" for each team, when they are made up of random players? We cannot do it without context. For that reason, this plugin relies on any external plugin to provide that context: a "rating" for each player. See the modules section on github for more detail on how this plugin works.

    Follow installation instructions on github

    The plugin has been completely restructured, if you are using a previous version you must install everything again. Also, rather than modifying two different pages with different formatting styles, I'm just gonna update the github page. For more information about the plugin, see the github link above.

    There plugin is split into six modules, you can read about them specifically in the module section on github

    Last edited by Effeff; 02-20-2021 at 18:59. Reason: v4.1.2
    Effeff is offline
    Bara
    AlliedModders Donor
    Join Date: Apr 2012
    Location: Germany
    Old 05-25-2019 , 07:45   Re: [CS:GO] Skill Auto Balance (v1.0.2, 2019-5-25)
    Reply With Quote #2

    Quote:
    Get Plugin doesn't work and I'm not sure how to make it work but I put the .smx in attached files as well.
    SMLib isn't provided with SourceMod, that's the reason.

    You could replace Client_RemoveAllWeapons with something like that:

    Code:
    void RemoveClientWeapons(int client)
    {
        int iEnt;
        for (int i = CS_SLOT_PRIMARY; i <= CS_SLOT_C4; i++)
        {
            while ((iEnt = GetPlayerWeaponSlot(client, i)) != -1)
            {
                SafeRemoveWeapon(client, iEnt, i);
            }
        }
    }
    
    stock bool SafeRemoveWeapon(int client, int weapon, int slot)
    {
        if (HasEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"))
        {
            int iDefIndex = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
            
            if (iDefIndex < 0 || iDefIndex > 700)
            {
                return false;
            }
        }
        
        if (HasEntProp(weapon, Prop_Send, "m_bInitialized"))
        {
            if (GetEntProp(weapon, Prop_Send, "m_bInitialized") == 0)
            {
                return false;
            }
        }
        
        if (HasEntProp(weapon, Prop_Send, "m_bStartedArming"))
        {
            if (GetEntSendPropOffs(weapon, "m_bStartedArming") > -1)
            {
                return false;
            }
        }
        
        if (GetPlayerWeaponSlot(client, slot) != weapon)
        {
            return false;
        }
        
        if (!RemovePlayerItem(client, weapon))
        {
            return false;
        }
        
        int iWorldModel = GetEntPropEnt(weapon, Prop_Send, "m_hWeaponWorldModel");
        
        if (IsValidEdict(iWorldModel) && IsValidEntity(iWorldModel))
        {
            if (!AcceptEntityInput(iWorldModel, "Kill"))
            {
                return false;
            }
        }
        
        if (weapon == GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"))
        {
            SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", -1);
        }
        
        AcceptEntityInput(weapon, "Kill");
        
        return true;
    }
    __________________
    Discord (Bara#5006) | My Plugins (GitHub)
    You like my work? Support is not a crime.
    Bara is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-25-2019 , 20:57   Re: [CS:GO] Skill Auto Balance (v1.0.3, 2019-5-25)
    Reply With Quote #3

    1.0.3:
    Fixed Client index 0 problem for real this time
    - The "fix" from 1.0.2 was not related to GetScore(), and rather, it was a problem that happened because of my 1.0.1 fix which also was not a correct fix.
    - The real problem was, I was calculating "swapAmount" incorrectly, so there were more players being added to the pool than there were players on the server.
    Removed the SMLib include, and replaced relevant code with what Bara suggested.
    - Thank you Bara.
    Effeff is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-26-2019 , 13:50   Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
    Reply With Quote #4

    1.0.4:
    Fixed swapping the wrong players on the losing team
    - I had a > where there should have been a <. I'm a genius.
    Effeff is offline
    xSLOW
    Senior Member
    Join Date: Apr 2019
    Location: Romania
    Old 05-26-2019 , 15:59   Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
    Reply With Quote #5

    Nice release!
    I've been looking for a plugin like this!
    __________________
    My community:
    https://elitegamers.ro
    https://www.gametracker.com/search/c...elitegamers.ro

    Contact me, fastest way, through my discord server:
    https://discord.gg/SBHzDGbbgG
    xSLOW#0508
    xSLOW is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-26-2019 , 18:55   Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
    Reply With Quote #6

    1.0.5:
    Added cvar: sab_minrounddiff. Disabled by default.
    - 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"

    Soon I would like to do this which I wrote in plans:

    - I would like to do what "mp_autoteambalance 1" does, but more immediate at the end of the round so that at the start of every round the teams should never have unmatched numbers beyond 1 player.
    Effeff is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-27-2019 , 22:56   Re: [CS:GO] Skill Auto Balance (v1.0.5, 2019-5-26)
    Reply With Quote #7

    1.0.6:
    Fixed mistake with previous update calculating round difference incorrectly.
    - I was subtracting the difference b/w the streaks of each team, rather than subtracting the difference in rounds won.
    - So I added a counter that increases at the end of a round whenever a team wins, and this now uses the difference between those two numbers to determine the round difference, as it should have to begin with.

    Changed the way players are chosen to be swapped, from "every other player in each array" to "N/2 random players in each array".
    - I found out I could randomize the order of the array by using Sort_Random as the SortOrder.
    Effeff is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-28-2019 , 10:00   Re: [CS:GO] Skill Auto Balance (v1.0.7, 2019-5-28)
    Reply With Quote #8

    1.0.7:
    Reset the round win count for each team to 0 on map change (forgot to do this for previous update).
    Added a BalanceTeamCount function.
    - While the teams are uneven by more than 1 player, the most recently connected player on the team with more players is swapped to the other team.

    it's pretty late for me, I haven't tested this enough because I don't have a test server and I didn't feel like switching the config values on my own server to see what may/may not be working.
    Effeff is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-29-2019 , 02:01   Re: [CS:GO] Skill Auto Balance (v1.0.7, 2019-5-28)
    Reply With Quote #9

    1.0.8:
    Added convar:

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

    Reason being, I'm not confident in my implementation of randomly choosing from the pool. If the top two players end up on the same team, they have been carrying and triggering the swap and repeatedly these two players kept getting moved together. Having it choose every other player as it had before would prevent that I believe.
    Effeff is offline
    Effeff
    AlliedModders Donor
    Join Date: Jan 2019
    Location: discord: ff#0533
    Old 05-29-2019 , 02:41   Re: [CS:GO] Skill Auto Balance (v1.0.9, 2019-5-29)
    Reply With Quote #10

    1.0.9:
    Fixed bug w/ swapping randomly.
    - It would swap twice as many players as it was supposed to.

    >_< sorry for spam
    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 04:19.


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