AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Skill Auto Balance (v4.1.2, 2021-2-20) (https://forums.alliedmods.net/showthread.php?t=316478)

Effeff 05-25-2019 03:26

[CS:GO] Skill Auto Balance (v4.1.2, 2021-2-20)
 
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

Bara 05-25-2019 07:45

Re: [CS:GO] Skill Auto Balance (v1.0.2, 2019-5-25)
 
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;
}


Effeff 05-25-2019 20:57

Re: [CS:GO] Skill Auto Balance (v1.0.3, 2019-5-25)
 
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 05-26-2019 13:50

Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
 
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.

xSLOW 05-26-2019 15:59

Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
 
Nice release!
I've been looking for a plugin like this!

Effeff 05-26-2019 18:55

Re: [CS:GO] Skill Auto Balance (v1.0.4, 2019-5-26)
 
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 05-27-2019 22:56

Re: [CS:GO] Skill Auto Balance (v1.0.5, 2019-5-26)
 
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 05-28-2019 10:00

Re: [CS:GO] Skill Auto Balance (v1.0.7, 2019-5-28)
 
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 05-29-2019 02:01

Re: [CS:GO] Skill Auto Balance (v1.0.7, 2019-5-28)
 
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 05-29-2019 02:41

Re: [CS:GO] Skill Auto Balance (v1.0.9, 2019-5-29)
 
1.0.9:
Fixed bug w/ swapping randomly.
- It would swap twice as many players as it was supposed to.

>_< sorry for spam


All times are GMT -4. The time now is 21:15.

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