Skip to content

Vote Random

Person8880 edited this page Apr 4, 2021 · 78 revisions

Overview

The vote random plugin offers a vote to force shuffle the teams either for a set duration or for the next round.

There are four team balancing modes available.

  1. Pure random.

  2. Hive recorded score per minute played. Anyone with no past score on record or with a past score of 0 is randomised.

  3. Past KDR based. Same as the score based, except it uses each player's Hive recorded kill to death ratio to balance the teams. Anyone with a past KDR of 0 is randomised. Assists count for 10 percent of a kill.

  4. Using the game's built in skill ranking. This ranking is tracked in some servers and is a fairly reliable data source for balancing. However, the game sometimes has issues getting the ranking data and may leave everyone with a 0 skill rank. This is a problem with the game, not Shine. This mode is not available in NS2: Combat.

If you wish to make a player immune to being forced onto a team, give them access to sh_randomimmune. Note that when the afkkick plugin is also enabled, all shuffling modes will move players that have been AFK for over a minute into the ready room before shuffling the remaining players.

Team Balancing Process

The team balancing process has 4 phases:

  1. Find all players viable for balancing, and collect their team preferences if they have any.
  2. Assign players to teams to have equal amounts of players on both.
  3. Optimise the teams by simulating player swaps until the teams cannot be improved further.
  4. If team preferences are tracked, team-specific skills are not being used, and commanders are either swappable or not present, check the final teams to determine if the weighted majority of players have the team they want. If not, swap all marines to aliens and vice-versa.

Team/Role Based Skills

For Hive skill based shuffling, team and commander skills can be used to provide more information to the team optimiser to balance the teams.

Team skills are used when UseTeamSkill is enabled under BalanceModeConfig, and are applied during the simulated swaps based on the target team a player is being swapped to.

Commander skills are used when UseCommanderSkill is enabled and are applied to players that are a commander at the time a shuffle occurs (using the team-specific value if UseTeamSkill is enabled). Note that if commanders are considered swappable, their commander skill will only be used when they have not been swapped. Additionally, the use of commander skill values relies on players continuing to be the commander after the shuffle vote. If a player stops being commander, the team balance will likely be disrupted.

Friend Groups

When TeamPreferences.PlayWithFriendsWeighting is not NONE, players can group up with their friends and the optimiser will attempt to keep them on the same team.

To group with other players, click their name on the scoreboard and choose "Join friend group". You can also add more players to the group in the same way, up to the server's configured maximum. To leave a friend group, click your own name and choose "Leave friend group".

To prevent certain players from adding others to their group, deny access to the sh_add_to_friendgroup command. Clients may also individually opt to either need to confirm an invite to join a group, or block all invites entirely in the client configuration menu. Additionally, clients may decide whether their groups are open to all, or require an invite.

Config

The default config file should look like this:

{
    "ApplyToBots": false,
    "AutoShuffleAtRoundStart": true,
    "BalanceMode": "HIVE",
    "BalanceModeConfig": {
        "HIVE": {
            "BlendAlienCommanderAndFieldSkills": false,
            "UseCommanderSkill": true,
            "UseTeamSkill": true
        }
    },
    "BlockAfterRoundTimeInMinutes": 2,
    "BlockBotsAfterShuffle": true,
    "BlockUntilSecondsIntoMap": 0,
    "DisplayStandardDeviations": false,
    "EndOfRoundShuffleDelayInSeconds": 30,
    "FallbackMode": "KDR",
    "HighlightTeamSwaps": false,
    "IgnoreCommanders": true,
    "IgnoreSpectators": true,
    "LogLevel": "INFO",
    "NotifyOnVote": true,
    "ReconnectLogTimeInSeconds": 0,
    "RemoveAFKPlayersFromTeams": true,
    "StatsRecording": {
        "MinMinutesOnTeam": 5,
        "RookieBoundary": 7500,
        "RookieStat": "Score"
    },
    "TeamPreferences": {
        "CostWeighting": "MEDIUM",
        "FriendGroupInviteCooldownInSeconds": 15,
        "FriendGroupInviteDurationInSeconds": 15,
        "FriendGroupRestoreTimeoutSeconds": 300,
        "MaxFriendGroupSize": 4,
        "MaxHistoryRounds": 5,
        "MinRoundLengthToRecordInSeconds": 300,
        "PlayWithFriendsWeighting": "MEDIUM"
    },
    "UseLocalFileStats": false,
    "VoteConstraints": {
        "InGame": {
            "FractionNeededToPass": 0.75,
            "MinAverageDiffToAllowShuffle": 100,
            "MinPlayerFractionToConstrainSkillDiff": 0.9,
            "MinPlayers": 10,
            "MinStandardDeviationDiffToAllowShuffle": 0,
            "StartOfRoundGraceTimeInSeconds": 0
        },
        "PreGame": {
            "FractionNeededToPass": 0.6,
            "MinAverageDiffToAllowShuffle": 75,
            "MinPlayerFractionToConstrainSkillDiff": 0.9,
            "MinPlayers": 10,
            "MinStandardDeviationDiffToAllowShuffle": 0
        }
    },
    "VoteCooldownInMinutes": 1,
    "VotePassActions": {
        "InGame": {
            "DurationInMinutes": 15,
            "EnforcementDurationType": "TIME",
            "EnforcementPolicy": [
                {
                    "MaxPlayers": 0,
                    "MinPlayers": 0,
                    "Type": "ASSIGN_PLAYERS"
                },
            ],
            "ShufflePolicy": "INSTANT"
        },
        "PreGame": {
            "DurationInMinutes": 15,
            "EnforcementDurationType": "TIME",
            "EnforcementPolicy": [
                {
                    "MaxPlayers": 0,
                    "MinPlayers": 0,
                    "Type": "ASSIGN_PLAYERS"
                },
                {
                    "MaxPlayers": 0,
                    "MinPlayers": 0,
                    "Type": "BLOCK_TEAMS"
                }
            ],
            "ShufflePolicy": "INSTANT"
        }
    },
    "VoteSettings": {
        "AFKTimeInSeconds": 60,
        "ConsiderAFKPlayersInVotes": true,
        "ConsiderSpectatorsDuringActiveRound": true,
        "ConsiderSpectatorsInVotes": true
    },
    "VoteTimeoutInSeconds": 60,
    "__Version": "2.12"
}

The file should be called “VoteRandom.json” and should be placed in the directory defined as your plugin config directory (default is config://shine/plugins).

Option Description
ApplyToBots Sets whether to consider bots when shuffling teams. When disabled, all bots (except commander bots) will be removed from the server on a successful shuffle.
AutoShuffleAtRoundStart Forces teams to be shuffled at the start of each round and changes the vote to instead disable automatic shuffling for the next round if it passes.
BalanceModeConfig Configures per-mode configuration options. Currently only the HIVE mode has extra configuration options, which are:
  • BlendAlienCommanderAndFieldSkills - enables blending of an alien commander's field and commander skill, using the average of the two. This may improve balance for alien commanders that frequently leave the hive to fight, and is only applicable if UseCommanderSkill is true.
  • UseTeamSkill - enables the use of per-team skill values when shuffling players.
  • UseCommanderSkill - enables the user of commander-specific skill values when a player is a commander at the time a shuffle occurs.
BalanceMode Sets the method the plugin should use to balance the teams. Available modes are:
  • RANDOM
  • SCORE
  • KDR
  • HIVE
BlockAfterRoundTimeInMinutes If set to a value greater than 0, it will block votes for shuffling teams after this many minutes into a round.
BlockBotsAfterShuffle Sets whether to block bots from being added after a shuffle has occurred until a round has completed (if ApplyToBots is false).
BlockUntilSecondsIntoMap If set to a value greater than 0, it will block votes for shuffling teams until this many seconds have passed after a map change.
DisplayStandardDeviations If set to true and the sorting mode is Hive skill, then the standard deviation of Hive skill values for Marines and Aliens will be displayed on the scoreboard.
EndOfRoundShuffleDelayInSeconds Sets how long to wait after the end of a round before applying a queued shuffle (from an END_OF_PERIOD shuffle during a round, or an ongoing time-based enforcement of teams).
FallbackMode If you are using Hive skill rank sorting, this method will be used to sort those with a 0 skill rank (can be any mode except HIVE).
HighlightTeamSwaps If set to true, players that switch teams will have a pulsing background on the scoreboard for 10 seconds after the team change.
IgnoreCommanders Sets whether to ignore commanders when sorting.
IgnoreSpectators Sets whether to ignore spectators when sorting.
NotifyOnVote Sets whether all players should be notified through the chat when a player votes to shuffle the teams.
ReconnectLogTimeInSeconds If set to a value greater than 0, it will log players who reconnect within this number of seconds after a shuffle vote passes.
RemoveAFKPlayersFromTeams Sets whether to remove AFK players from teams when shuffling (and move them to the ready room).
TeamPreferences Controls how to track players that get to play their preferred team. This is used to attempt to give every player a fair chance at playing the team they want to by remembering who got to play on the team they wanted after a round.
  • CostWeighting - determines how strongly to weight team preferences when optimising teams (phase 3 above). Value must be one of:
    • NONE
    • LOW
    • MEDIUM
    • HIGH
  • MaxHistoryRounds - determines how many rounds to record to provide additional weighting information.
  • MinRoundLengthToRecordInSeconds - the minimum time a round must be played before team preferences are recorded.
  • MaxFriendGroupSize - the maximum size allowed for groups of friends.
  • PlayWithFriendsWeighting - how strongly to weight friend groups when optimising teams (phase 3 above). Value must be one of:
    • NONE
    • LOW
    • MEDIUM
    • HIGH
  • FriendGroupInviteDurationInSeconds - how long an invitation to join a friend group should be displayed to a player before being cancelled.
  • FriendGroupInviteCooldownInSeconds- how long after a friend group invitation is denied or cancelled before the inviter can send another invite to the same player.
  • FriendGroupRestoreTimeoutSeconds - how long after a map change to stop restoring friend groups from the previous map (set to 0 to disable restoring groups).
VoteConstraints Controls when a shuffle vote should be permitted and what is required to pass. The behaviour may be configured for votes that pass before a game has started (PreGame) and for votes that pass during a game (InGame). The InGame rules can be delayed at the start of a round by using the StartOfRoundGraceTimeInSeconds option (e.g. to allow a lower fraction of votes for shuffle votes right at the start of a round).

Configurable options per game state are:
  • MinPlayers - Minimum number of players needed on the server for the vote to be enabled.
  • FractionNeededToPass - Fraction of players needing to vote for it to pass.
  • MinPlayerFractionToConstrainSkillDiff - the fraction of players required to be on playing teams before skill difference constraints will be applied. Note that this only applies to the HIVE mode.
  • MinAverageDiffToAllowShuffle - if the difference in average skill exceeds this amount, voting is permitted.
  • MinStandardDeviationDiffToAllowShuffle - if the difference in standard deviation of skill exceeds this amount, and this amount is greater than 0, voting is permitted.
Skill difference constraints are applied as an OR condition, that is, if either of the minimum skill difference values are met a vote is allowed.
Note that voting will also be permitted if the difference in the number of players on each team exceeds 1, regardless of skill values.
VoteCooldownInMinutes Determines the number of minutes to wait after a vote before another can be started.
VotePassActions Controls how a shuffle should be applied after a successful vote. The behaviour may be configured for votes that pass before a game has started (PreGame) and for votes that pass during a game (InGame).
  • ShufflePolicy - determines when to apply the shuffle. May be one of:
    • INSTANT - immediately when the vote passes (will also reset the round if one is in-progress).
    • END_OF_PERIOD - when the current game state ends (i.e. the in-progress round ends, or a new round starts).
    • NEXT_ROUND - when the next round begins.
  • EnforcementPolicy - how to enforce the teams (if at all). If MaxPlayers is greater than 0, the policy only applies when the number of players is less-equal the given value. Similarly, MinPlayers restricts the policy to apply when the number of players is greater-equal the given value. The Type sets the enforcement policy to apply, and can be one of:
    • ASSIGN_PLAYERS - auto-assign players onto teams.
    • BLOCK_TEAMS - block players from switching teams.
  • EnforcementDurationType - determines how long to enforce any restrictions defined in the EnforcementPolicy. Available values are:
    • NONE - do not enforce anything.
    • TIME - use the provided DurationInMinutes to enforce for the given time after the shuffle is applied.
    • PERIOD - enforce for the entire period after the shuffle is applied (e.g. if the teams shuffle at the start of a round, then enforcement will last until the round ends).
VoteSettings Allows for controlling whether AFK players and spectators are considered in votes. Set ConsiderAFKPlayersInVotes to false to prevent AFK players from counting towards the total votes. AFKTimeInSeconds controls how long a player should be AFK before they are no longer counted. Set ConsiderSpectatorsInVotes to false to prevent spectators from counting towards the total votes, and ConsiderSpectatorsDuringActiveRound to false (with ConsiderSpectatorsInVotes set to true) to prevent spectators from voting during an active round.
VoteTimeoutInSeconds After this many seconds with no votes, the vote count is reset to 0 if it never passed.

Local File Stats

If you are running a server that is not valid for Hive stats submitting, you can enable a local stats storage which will record kills, deaths, score and playtime of players on your server. This allows the KDR and score per minute modes to function without using the Hive stats system at all.

To populate the values, it will start from the values in the Hive system, if available. Otherwise all values start at 0.

Option Description
UseLocalFileStats Enables or disables the use of local file-based stats.
StatsRecording -> MinMinutesOnTeam Sets the minimum time a player must be on a team to have a win or loss recorded at the end of the round.
StatsRecording -> RookieStat Sets which stat should be used to determine a player's rookie status. Available stats are: Score, Kills, Deaths, Assists, PlayTime, Wins and Losses.
StatsRecording -> RookieBoundary Sets the value at which players are no longer considered a rookie. For example, with the default config, a player with greater or equal to 7500 total recorded score will no longer be considered a rookie.

Commands

Command Chat Command Arguments Description
sh_voterandom !random or !voterandom or !randomvote or !shuffle or !voteshuffle or !shufflevote N/A Votes to shuffle teams.
sh_enablerandom or sh_forceshuffle !enablerandom or !enableshuffle or !forceshuffle <true/false> Immediately shuffles (or disables team enforcing) without a vote.
sh_teamstats N/A N/A Displays anonymous team skills, average skill and standard deviation in the console. Only works if Hive skill is the shuffling mode.
Clone this wiki locally