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.
| Unranked | Ranked | |
|---|---|---|
| Wins, losses and draws counted | Yes | Yes |
| MMR changes | No | Yes |
| Counts toward the season leaderboard | No | Yes |
Needs zrivalsduels.ranked for both players | No | Yes |
| Anti abuse checks | No | Yes |
How MMR changes
The plugin uses the Elo system that chess uses. In plain terms:
- 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. - It compares that with what happened. A win counts as 1, a loss as 0.
- 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)).
The 1200 vs 1500 example
With the default K factor of 32:
| Match | Expected winner's chance | Winner | Loser |
|---|---|---|---|
| 1500 vs 1500 | 50% | +16 | -16 |
| 1200 beats 1500 | 15% for the 1200 player | 1200 goes to 1227 (+27) | 1500 goes to 1473 (-27) |
| 1500 beats 1200 | 85% for the 1500 player | 1500 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| Key | What it does | Default |
|---|---|---|
starting | MMR for a player's first ranked game of a season when they have no rating yet | 1000 |
k-factor | How much one result can move a rating | 32 |
placement-games | How many first ranked games use the placement K. 0 turns placement off | 10 |
placement-k-factor | K during placement | 48 |
min-change | Every win gains at least this much, every loss costs at least this much | 1 |
max-change | No single game moves a rating more than this | 60 |
floor | MMR never drops below this through losses | 0 |
divisor | The rating gap for a ten to one favourite. Bigger values make gaps matter less | 400 |
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
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 rank | min-mmr |
|---|---|
| Bronze | 0 |
| Silver | 1100 |
| Gold | 1300 |
| Platinum | 1500 |
| Diamond | 1800 |
| Master | 2200 |
| Key | What it does |
|---|---|
display | The rank name everywhere, MiniMessage format. Put the colour in here |
min-mmr | Lowest MMR for the rank |
icon | Not used yet. Changing it has no effect |
colour | Not 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
| Lifetime | This season |
|---|---|
| Wins, losses and draws (every duel) | MMR |
| Total duels | Ranked wins |
| Ranked wins, ranked losses and ranked games | Ranked losses |
| Highest MMR ever | Ranked games |
| Best rank ever | Best MMR this season |
| Best leaderboard position ever | Best 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: trueOnly 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]| Key | What it does | Default |
|---|---|---|
block-same-ip | No ranked between two players on the same IP. Unranked still works | true |
same-opponent-limit | Most ranked games against the same opponent inside the window. After that only unranked is allowed until the window passes. 0 turns the limit off | 3 |
same-opponent-window-hours | Length of the rolling window | 24 |
repeat-reduction-enabled | Shrink MMR changes for repeat games against the same opponent inside the window | false |
repeat-multipliers | Multiplier 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
| Command | What 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.