Skip to content

Vote Random

Person8880 edited this page Feb 28, 2019 · 79 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.

Note that KDR and SPM are normalised into the 0 - 2000 range, so that the standard deviation and average tolerance config options have similar usage with all balance modes.

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.

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 opt-out individually in the client configuration menu or by using the sh_shuffle_block_friend_groups command.

Config

The default config file should look like this:

{
    "AlwaysEnabled": false,
    "ApplyToBots": false,
    "BalanceMode": "HIVE",
    "BlockAfterRoundTimeInMinutes": 2,
    "BlockUntilSecondsIntoMap": 0,
    "DisplayStandardDeviations": false,
    "FallbackMode": "KDR",
    "HighlightTeamSwaps": false,
    "IgnoreCommanders": true,
    "IgnoreSpectators": false,
    "MinPlayers": 10,
    "NotifyOnVote": true,
    "PercentNeeded": 0.75,
    "ReconnectLogTimeInSeconds": 0,
    "StatsRecording": {
        "MinMinutesOnTeam": 5,
        "RookieBoundary": 7500,
        "RookieStat": "Score"
    },
    "TeamPreferences": {
        "CostWeighting": "MEDIUM",
        "MaxFriendGroupSize": 4,
        "MaxHistoryRounds": 5,
        "MinRoundLengthToRecordInSeconds": 300,
        "PlayWithFriendsWeighting": "MEDIUM"
    },
    "UseLocalFileStats": false,
    "VoteConstraints": {
        "MinAverageDiffToAllowShuffle": 75,
        "MinPlayerFractionToConstrain": 0.9,
        "MinStandardDeviationDiffToAllowShuffle": 0
    },
    "VoteCooldownInMinutes": 15,
    "VotePassActions": {
        "InGame": {
            "DurationInMinutes": 15,
            "EnforcementDurationType": "TIME",
            "EnforcementPolicy": [ "ASSIGN_PLAYERS" ],
            "ShufflePolicy": "INSTANT"
        },
        "PreGame": {
            "DurationInMinutes": 15,
            "EnforcementDurationType": "TIME",
            "EnforcementPolicy": [ "ASSIGN_PLAYERS", "BLOCK_TEAMS" ],
            "ShufflePolicy": "INSTANT"
        }
    },
    "VoteSettings": {
        "AFKTimeInSeconds": 60,
        "ConsiderAFKPlayersInVotes": true
    },
    "VoteTimeoutInSeconds": 60,
    "__Version": "2.6"
}

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
VoteCooldownInMinutes Determines the number of minutes to wait after a vote before another can be started.
MinPlayers Minimum number of players needed on the server for the vote to be enabled.
PercentNeeded Percentage of players needing to vote for it to pass.
NotifyOnVote Sets whether all players should be notified through the chat when a player votes to shuffle the teams.
ApplyToBots Sets whether to consider bots when shuffling teams. When disabled, all bots will be removed from the server on a successful shuffle.
BalanceMode Sets the method the plugin should use to balance the teams. Available modes are:
  • RANDOM
  • SCORE
  • KDR
  • HIVE
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).
VoteTimeoutInSeconds After this many seconds with no votes, the vote count is reset to 0 if it never passed.
AlwaysEnabled 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.
IgnoreCommanders Sets whether to ignore commanders when sorting.
IgnoreSpectators Sets whether to ignore spectators when sorting.
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.
BlockAfterRoundTimeInMinutes If set to a value greater than 0, it will block votes for shuffling teams after this many minutes into a round.
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.
HighlightTeamSwaps If set to true, players that switch teams will have a pulsing background on the scoreboard for 10 seconds after the team 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.
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
VoteConstraints Controls when a shuffle vote should be permitted. Note that this only applies to the HIVE mode.
  • MinPlayerFractionToConstrain - the fraction of players required to be on playing teams before constraints will be applied.
  • 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.
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.
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). Available values are:
    • 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 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.

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