zRivals Duels logozRivals Duels

Ranked and MMR

How ranked duels change MMR, the ranks, the stats that are tracked, the leaderboard, and the anti abuse checks.

Ranked duels give every player an MMR, a rating that goes up when they win and down when they lose. Beating someone much stronger is worth a lot, beating someone much weaker is worth very little, so the rating settles where a player really belongs.

Unranked and ranked

Ranked duels come from the matchmaking queue: /duel queue ranked or /ranked pairs players close to each other's MMR, so nobody picks their ranked opponent. /duel <player> challenges are unranked unless queue.ranked-challenges is on in config.yml.

UnrankedRanked
Wins, losses and draws countedYesYes
MMR changesNoYes
Counts toward the season leaderboardNoYes
Needs zrivalsduels.ranked for both playersNoYes
Anti abuse checksNoYes

How MMR changes

The plugin uses the Elo system that chess uses. In plain terms:

  1. It works out who was expected to win. The bigger the MMR gap, the more likely the higher player is to win. A gap equal to divisor (400) means the higher player is about ten times more likely to win.
  2. It compares that with what happened. A win counts as 1, a loss as 0.
  3. It moves both ratings by the surprise. The change is the K factor times the difference between what happened and what was expected, rounded to a whole number. An expected win moves the rating a little, an upset moves it a lot.

For the curious, the chance that player A beats player B is 1 / (1 + 10^((MMR_B - MMR_A) / 400)), and the change for A is round(K x (result - chance)).

A card showing that 1200 beating 1500 gains 27 MMR while 1500 beating 1200 gains only 5, with a bar chart of points gained by opponent gap.

The 1200 vs 1500 example

With the default K factor of 32:

MatchExpected winner's chanceWinnerLoser
1500 vs 150050%+16-16
1200 beats 150015% for the 1200 player1200 goes to 1227 (+27)1500 goes to 1473 (-27)
1500 beats 120085% for the 1500 player1500 goes to 1505 (+5)1200 goes to 1195 (-5)

The underdog who wins gains a lot. The favourite who wins gains little.

Placement games

A player's first ranked games move their rating faster, so new players reach their real level quickly. While a player has played fewer than placement-games ranked games in total, their own change uses placement-k-factor instead of k-factor. Each player uses their own K, so a new player can gain 41 from beating a 1500 player while that player loses only 27.

Settings

mmr:
  # MMR a new player starts with
  starting: 1000
  # How strongly each ranked result moves MMR
  k-factor: 32
  # Number of first ranked games that use the placement K factor, 0 turns placement off
  placement-games: 10
  # K factor used during placement games
  placement-k-factor: 48
  # Smallest MMR change a ranked game can give
  min-change: 1
  # Largest MMR change a ranked game can give
  max-change: 60
  # Lowest MMR a player can drop to
  floor: 0
  # Rating gap that makes a player ten times more likely to win
  divisor: 400
KeyWhat it doesDefault
startingMMR for a player's first ranked game of a season when they have no rating yet1000
k-factorHow much one result can move a rating32
placement-gamesHow many first ranked games use the placement K. 0 turns placement off10
placement-k-factorK during placement48
min-changeEvery win gains at least this much, every loss costs at least this much1
max-changeNo single game moves a rating more than this60
floorMMR never drops below this through losses0
divisorThe rating gap for a ten to one favourite. Bigger values make gaps matter less400

What counts as a result

  • A win, a forfeit by the opponent, the opponent disconnecting or leaving the boundaries: a win.
  • A time limit draw: no MMR change for either player.
  • A duel ended by staff: no MMR change, and nothing is recorded.

Ranks

An MMR ladder from 0 to 2600 with Bronze at 0, Silver at 1100, Gold at 1300, Platinum at 1500, Diamond at 1800 and Master at 2200, and the starting MMR of 1000 marked.

A player's rank is the highest rank whose min-mmr their MMR reaches. Ranks live in ranks.yml, and you can have as many as you like.

ranks:
  bronze:
    # Name shown in menus, messages and placeholders
    display: "<#cd7f32>Bronze"
    # Lowest MMR needed for this rank
    min-mmr: 0
    # Item shown for this rank in menus
    icon: COPPER_INGOT
    # Main colour of this rank, used for highlights
    colour: "#cd7f32"
Default rankmin-mmr
Bronze0
Silver1100
Gold1300
Platinum1500
Diamond1800
Master2200
KeyWhat it does
displayThe rank name everywhere, MiniMessage format. Put the colour in here
min-mmrLowest MMR for the rank
iconNot used yet. Changing it has no effect
colourNot used yet. Changing it has no effect, the colour on screen comes from display

Rank ids (the key, like bronze) must be lower case letters, digits, - or _. position cannot be used as a rank id because it would clash with %duel_rank_position%. An invalid rank is skipped with a console warning. If no valid rank is left, everyone shows as a single Unranked rank.

Tracked stats

LifetimeThis season
Wins, losses and draws (every duel)MMR
Total duelsRanked wins
Ranked wins, ranked losses and ranked gamesRanked losses
Highest MMR everRanked games
Best rank everBest MMR this season
Best leaderboard position everBest rank this season
Season wins (finished #1) and top 3 finishes

/duel stats [player] shows them in a menu, or in chat when stats.use-menu is false. It works for offline players. Looking at another player needs zrivalsduels.stats.others.

Leaderboard

The leaderboard lists players with at least min-ranked-games ranked games this season, ordered by MMR. Ties go to the player with more ranked wins, then to whoever reached that MMR first.

It is kept in memory and refreshed in the background every refresh-seconds and after each ranked result. /duel top, menus and placeholders all read that copy, so they never slow the server down.

leaderboard:
  # Seconds between leaderboard refreshes
  refresh-seconds: 60
  # Ranked games this season a player needs to appear on the leaderboard
  min-ranked-games: 1
  # Most leaderboard entries kept in memory
  max-cached: 500
  # Entries per page in /duel top
  page-size: 10
  # Open a menu for /duel top instead of a chat list
  use-menu: false

stats:
  # Open a menu for /duel stats instead of a chat summary
  use-menu: true

Only the top max-cached players are kept, so a %duel_top_600_player% placeholder with the default of 500 shows the empty text.

Anti abuse

Stops players farming rating with alts or a friend.

anti-abuse:
  # Block ranked duels between players on the same IP address
  block-same-ip: true
  # Most ranked games allowed against the same opponent inside the window
  same-opponent-limit: 3
  # Length of the same opponent window in hours
  same-opponent-window-hours: 24
  # Lower MMR gains for repeat games against the same opponent inside the window
  repeat-reduction-enabled: false
  # MMR multiplier for the first, second, third game and so on against the same opponent
  repeat-multipliers: [1.0, 0.75, 0.5]
KeyWhat it doesDefault
block-same-ipNo ranked between two players on the same IP. Unranked still workstrue
same-opponent-limitMost ranked games against the same opponent inside the window. After that only unranked is allowed until the window passes. 0 turns the limit off3
same-opponent-window-hoursLength of the rolling window24
repeat-reduction-enabledShrink MMR changes for repeat games against the same opponent inside the windowfalse
repeat-multipliersMultiplier for the first, second, third game and so on. The last value is used for every game after that[1.0, 0.75, 0.5]

In the ranked queue these checks run before two players are matched. A pair that fails is not matched again for 30 seconds and both keep searching. When ranked challenges are on and ranked is not allowed, the mode button in the setup menu says why. Counters live in the database, so leaving and rejoining resets nothing. Ranked is also paused for the few seconds a season end takes.

Match history

Every finished duel is written to match history with both players, their IP addresses stored only as a one way hash, the kit, the arena, the MMR before and after, the wager and how it ended. Staff can check a player with:

/duel admin history <player> [page]

Matches where both players had the same IP address are marked SAME IP. Duels ended by staff or cut short by a server stop are not written to history.

Admin tools

CommandWhat it does
/duel admin setmmr <player> <value>Set a player's MMR for the current season
/duel admin resetstats <player>Reset every lifetime stat and the current season stats. Asks you to confirm within 30 seconds
/duel admin history <player> [page]Show a player's match history

All three need zrivalsduels.admin.stats or zrivalsduels.admin.history, see Permissions.

On this page