A judgement set decides how a press is graded: which tiers exist (Perfect, Great, Miss…), how wide each window is, how much a tier is worth and whether it breaks the combo. The game ships three sets and every one of them is an ordinary mod. A mod that only registers sets is a judgement pack: installed, its sets appear in the game's pickers without a restart.
A set only describes its tiers. The game judges natively: the accuracy formula and the hold rules are chosen by name (accuracy, holds) among the rules built into the game, and Rust validates everything your script returns. You never grade a press in TypeScript. This page assumes you have made a first mod.
A first set
This mod registers two sets. "Tight" has a parameter, width, that scales every window, and asymmetric windows. "Smooth" has no parameter, uses the native continuous accuracy and gives its first tier a gradient.
/// <reference path="../../../mods/sdk/modding.d.ts" />
// A judgement pack: two sets for the game's pickers (Settings → Game → Judgement, and the
// switch beside Play). A mod that only registers sets is shareable as is.
//
// "Tight" has one parameter, `width`, which scales every window, and asymmetric windows
// (`earlyMs` before the note, `lateMs` after it). "Smooth" has no parameter; its accuracy
// is the native `continuous` curve and its holds are judged head and tail separately.
export default defineMod({
id: "judgement-pack",
name: "Judgement Pack",
version: "1.0.0",
apiVersion: 2,
author: "You",
description: "Two judgement sets: a parametric one with asymmetric windows and a continuous one.",
setup() {
judgements.register({
id: "tight",
name: "Tight",
// The picker shows one slider per parameter. `short` prefixes the value where room
// is short ("W2"); without it the game writes the label and the value ("Width 2").
params: { width: { label: "Width", short: "W", min: 1, max: 3, step: 1, default: 2 } },
accuracy: "weights",
holds: "head",
// Called once per combination of parameters (here width = 1, 2, 3) right after
// `setup`: hit tiers from the tightest to the widest, then the miss.
tiers: ({ width }) => [
{ id: "perfect", name: "Perfect", color: "#7fffd4", earlyMs: 6 * width, lateMs: 8 * width, weight: 1 },
{ id: "good", name: "Good", color: "#ffe38a", earlyMs: 14 * width, lateMs: 18 * width, weight: 0.6 },
{ id: "bad", name: "Bad", color: "#ff9f6e", earlyMs: 24 * width, lateMs: 30 * width, weight: 0.2, breaksCombo: true },
// The miss window is the farthest press that still takes (and misses) a note.
{ id: "miss", name: "Miss", color: "#ff5a5a", windowMs: 30 * width, weight: 0 },
],
});
judgements.register({
id: "smooth",
name: "Smooth",
accuracy: "continuous",
holds: "separate",
tiers: () => [
{
id: "prism",
name: "Prism",
color: "#f3f0ff",
// 2 to 8 colours the text shows at once; `color` stays the plain fallback.
gradient: ["#ff8fcb", "#ffca80", "#91efad", "#8cddff"],
windowMs: 8,
weight: 1,
},
{ id: "great", name: "Great", color: "#93e69b", windowMs: 40, weight: 0.7 },
{ id: "ok", name: "Ok", color: "#89afff", windowMs: 90, weight: 0.2, breaksCombo: true },
{ id: "miss", name: "Miss", color: "#ff7185", windowMs: 130, weight: -1, breaksCombo: true },
],
});
},
});
Copy the folder judgement-pack into your mods folder (Mods page, Open folder). Then open Settings → Game → Judgement: both sets are listed under the mod's name, "Tight" with a slider for Width. The rest of this page explains each part.
The declaration
judgements.register is called from setup, and nowhere else: registering closes once the mods have loaded (the call then throws judgements.register is only available in a mod's setup, while the mods load). Only mods register sets, not skins or map scripts. A mod registers at most 8 sets.
| Field | Type | Rule |
|---|---|---|
id |
string | 1 to 32 characters among a-z, 0-9 and -, unique in the mod. The set's key is <modId>/<id>. |
name |
string | 1 to 64 characters, no control characters. Shown in the pickers. |
params |
object | Optional. At most 8 parameters, by name. |
accuracy |
string | osuScoreV1, wife3, weights or continuous: the native rule. |
holds |
string | osuCombined, etterna, head or separate: the native rule. |
tiers |
function | (params) => JudgementTier[]: the tiers. Synchronous. |
An unknown field makes the call throw (unknown field x, expected one of id, name, params, accuracy, holds, tiers). A tiers that is not a function throws tiers must be a function.
Parameters
A parameter is a number the player sets with a slider. Its name is the key in params, and your tiers function receives the values under the same names.
| Field | Rule |
|---|---|
| name (the key) | 1 to 32 ASCII letters and digits, starting with a letter (od, judge, width). |
label |
1 to 32 characters. Shown next to the slider. |
min, max, step, default |
Finite numbers with min < max, 0 < step <= max - min and min <= default <= max. Values are min plus a whole number of steps. |
short |
Optional, 1 to 8 characters, written right before the value where room is short: J gives J4. Without it the game writes the label, a space and the value (OD 8). |
The game normalizes the values before it calls tiers: every declared parameter is present, taken from the player's value when it is finite and from default otherwise, clamped to [min, max] and snapped to the step (od 8.34 becomes 8.3). Values for names you did not declare are dropped.
Tiers
tiers(params) returns the tiers from the tightest to the widest window, then the miss tier last. Between 2 and 33 tiers: at most 32 hit tiers plus the miss.
| Field | Type | Rule |
|---|---|---|
id |
string | 1 to 32 characters among a-z, 0-9 and -, unique in the set. Stable: replays and the player's symbols refer to it. |
name |
string | 1 to 32 characters. |
color |
string | #rgb, #rrggbb or #rrggbbaa, at most 9 characters. |
gradient |
string[] | Optional, 2 to 8 colours in the same hex forms. See colours. |
windowMs, earlyMs, lateMs |
number | Windows in milliseconds: see windows. |
weight |
number | Accuracy weight. Required for every tier unless accuracy is wife3, which takes none. |
breaksCombo |
boolean | Default false. The miss tier always breaks the combo, whatever you write. |
Windows
A window has two sides. earlyMs is the largest distance before the note that earns the tier (an early press has a negative offset), and lateMs the largest distance after it. A press is graded against the windows of its own side: an offset of −earlyMs or +lateMs still earns the tier (bounds are inclusive).
windowMs is the symmetric shorthand: it sets both sides. You can give windowMs and replace one side only, as in { windowMs: 20, lateMs: 25 }. A side with neither its own field nor windowMs is an error (tier a needs windowMs, or earlyMs and lateMs).
Each side must grow strictly from one hit tier to the next, independently of the other side. All windows are finite, above 0 and at most 1000 ms. The miss tier has no window of its own in the sense of a grade: its windows are the farthest presses, early and late, that still take a note and miss it. They must be at least as wide as the widest hit tier's window on the same side.
Weights, combo and the miss
Under osuScoreV1, weights and continuous, every tier, miss included, has a finite weight between −1000 and 1000. At least one hit tier has a positive weight, and the miss weight is at most the best hit weight. Under osuScoreV1 and weights, accuracy is the sum of the weights earned over the best weight times the number of notes judged. Under wife3 no tier has a weight: the curve is native.
continuous adds two rules: the first weight is positive and the weights never increase from one tier to the next, miss included.
breaksCombo: true on a tier means a press graded there resets the combo. Put it on the tiers you want to hurt; the miss does it by itself.
Accuracy rules
accuracy |
What the game does |
|---|---|
osuScoreV1 |
osu!mania ScoreV1. Offsets are rounded to the millisecond (a window W takes errors up to W + 0.499 ms), a late press counts up to the second widest tier, an early press takes the note up to the early window of the miss tier. Accuracy by weight. |
wife3 |
Etterna's Wife3 points per note. The curve is scaled by the mean of the first tier's early and late windows over 22.5 ms. Tiers take no weight. A press counts up to the miss window, on each side. |
weights |
Accuracy by weight. An early press counts up to the miss tier's early window, a late press up to the widest hit tier's late window. |
continuous |
Linear interpolation between the windows and weights you declare, separately on each side: a plateau at the first tier's weight inside its window, the miss penalty for a missed note. |
Hold rules
holds |
What the game does |
|---|---|
osuCombined |
One judgement from the head's and the release's errors together. Needs exactly 5 hit tiers. |
etterna |
The head's tier. The tail may be released up to 250 ms before its end. |
head |
The head's tier. The tail may be released up to the widest early window before its end; earlier is a miss. |
separate |
The head is judged at once and the release when the key is let go, as two score objects of equal weight. A tail held past the late limit expires as a miss; a missed head leaves no valid tail. |
Mines
A mine is not a note: it has no tier, never counts as a miss and never breaks the combo. It goes off when its lane's key is down as it crosses the receptors, or when a press that judges no note lands close to it; a mine left alone changes nothing. Your set decides two numbers with the optional mine field, for example mine: { weight: -2, windowMs: 60 }:
| Field | Meaning | Without it | Bounds |
|---|---|---|---|
weight |
Accuracy points a mine that goes off adds: zero or negative. | Five times your best tier weight, taken away; -7 under wife3. |
-5000 to 0 |
windowMs |
How far from the mine a press that judges no note sets it off. | 75 |
10 to 1000 |
The Prism set declares mine: { weight: -5 }: one mine costs five perfect notes. A value outside the bounds refuses the registration.
Colours, gradients and symbols
color is the tier's plain colour: graphs and simple markers use it. gradient lists 2 to 8 colours that text shows at the same time, without any animation (the PRISM tier of the Prism set does this). Each colour is #rgb, #rrggbb or #rrggbbaa; anything else, a wrong count or a name like red is refused (tier prism: gradient needs 2 to 8 hex colors). The gradient is kept in the resolved tables, in custom presets and in replays.
A symbol is not something a mod declares. The player can show a short text or an image instead of a tier's name in Settings → Game; the choice is stored under the key <set key>/<tier id> (pvng.osu/osu-mania/perfect, or custom/<preset name>/t2 for a custom preset). That is why your tier ids must stay stable. A HUD mod reads the text symbol in TierInfo.symbol; it is null when there is none.
The combination cache
Right after your setup, the mods thread runs tiers(params) once for every combination of your parameters: each parameter takes the values from min to max by step. osu!mania has 101 (OD 0 to 10 by 0.1), Etterna 9, a set without parameters 1. Rust checks each result and keeps it in compact tables that the game's play and the settings preview read directly, without calling your mod again. So tiers has no need to cache anything, and it must be a pure function of its argument.
| Limit | Value |
|---|---|
| Combinations resolved while loading | at most 4096 per set, and 1 s for all sets together |
| Beyond that | each remaining combination is resolved on first use (the player's choice, or the start of a map), once, then kept |
A combination whose tiers throws, returns something that is not tiers or fails the validation is unavailable: the pickers skip it and a play never uses it. Your mod receives one warning per set, for example judgement set judges/tight: 1 of 4 parameter combinations are unavailable (first: width=4: tiers failed: too wide). A set without any valid combination is not offered. A throwing tiers does not count towards the errors that disable a mod; exceeding the execution budget does.
What the game validates
Your tiers go through two checks. The mods thread checks the size and shape (resolve_tiers), then the game checks the resolved set (validate_set), the same check it applies to the set stored in a replay. The message names the tier by its position: "Tier 3" is the third tier, and the last one is the miss.
| Message | Cause |
|---|---|
tiers must return 2 to 33 tiers (hit tiers, then the miss), got 1 |
Fewer than 2 or more than 33 tiers. |
tier id must be 1 to 32 characters among a-z, 0-9 and -, got "A" |
An id outside the rule. |
Tier 2: the id "good" is used twice |
Two tiers share an id. |
tier a needs windowMs, or earlyMs and lateMs |
A side has no window. |
tier a: color "#ffffffffff" is too long |
A colour longer than 9 characters. |
Tier 2: "red" is not a #rgb, #rrggbb or #rrggbbaa color |
An unreadable colour. |
Tier 2: the early window must be above 0 and at most 1000 ms |
A window that is not finite, not positive or above 1000 ms. |
Tier 3: the late window must be above the previous one (18 ms) |
A hit window that does not grow. |
Miss tier: the early window must be at least the widest hit early window (24 ms) |
A miss window narrower than the widest hit window. |
Tier 2: this accuracy needs a weight on every tier |
A missing weight under osuScoreV1, weights or continuous. |
Tier 2: the weight must be between -1000 and 1000 |
A weight out of range. |
At least one tier needs a positive accuracy weight |
No positive hit weight. |
Miss tier: the weight must not exceed the best tier weight (1) |
A miss worth more than the best hit. |
Continuous accuracy weights must not increase, including the miss tier |
A weight that rises under continuous. |
Wife3 tiers take no weight |
A weight under wife3. |
osu!mania holds need exactly 5 hit tiers, not 4 |
osuCombined with another number of hit tiers. |
A mistake in the declaration itself fails the mod's setup:
| Message | Cause |
|---|---|
judgement set id must be 1 to 32 characters among a-z, 0-9 and -, got "Osu" |
An invalid set id. |
judgement set name must have 1 to 64 characters, got " " |
An empty or too long name. |
judgement set x declares 9 params; the limit is 8 |
Too many parameters. |
param names are 1 to 32 ASCII letters and digits starting with a letter, got "2od" |
An invalid parameter name. |
param od needs finite min < max, 0 < step <= max - min and min <= default <= max |
An impossible range. |
param judge short must have 1 to 8 characters, got "Judgement" |
A short that is too long (the same shape for label, up to 32). |
judgement set tight is registered twice |
Two sets with the same id in the mod. |
a mod registers at most 8 judgement sets |
The ninth set. |
The TypeScript SDK catches the typos before the game does. A value that is not one of the four rules is a type error:
judgements.register({
id: "tight",
name: "Tight",
accuracy: "weights",
holds: "heads",
tiers: () => [
{ id: "hit", name: "Hit", color: "#ffffff", windowMs: 20, weight: 1 },
{ id: "miss", name: "Miss", color: "#ff0000", windowMs: 40, weight: 0 },
],
});
The built-in sets
Prism, osu!mania and Etterna are mods in the game's mods folder, loaded like yours. They are the best examples to read: content/mods/prism/main.ts, content/mods/osu/main.ts and content/mods/etterna/main.ts.
| Set (key) | Mod, loadOrder |
Parameter | Tiers | accuracy |
holds |
|---|---|---|---|---|---|
Prism (pvng.prism/prism) |
pvng.prism, 5 |
none | PRISM, MARVELOUS, PERFECT, GREAT, GOOD, BAD, POOR, MISS | continuous |
separate |
osu!mania (pvng.osu/osu-mania) |
pvng.osu, 10 |
od, 0 to 10 by 0.1 (default 5) |
300g, 300, 200, 100, 50, 0 | osuScoreV1 |
osuCombined |
Etterna (pvng.etterna/etterna) |
pvng.etterna, 20 |
judge, 1 to 9, short J (default 4) |
Marvelous, Perfect, Great, Good, Bad, Miss | wife3 |
etterna |
Prism's windows are ±7, 18, 36, 64, 92, 120 and 145 ms, with weights 1, 0.98, 0.93, 0.65, 0.28, −0.10 and −0.75, and −1.5 for a miss. osu!mania's windows follow 300g 16 ms and 64 − 3 × OD, 97 − 3 × OD, 127 − 3 × OD, 151 − 3 × OD, 188 − 3 × OD, truncated to the millisecond. Etterna's J4 windows are 22.5, 45, 90, 135 and 180 ms; the other judges scale them (J5 to J9 by 0.84, 0.66, 0.5, 0.33, 0.2) and the Bad and Miss windows stay at 180 ms.
Players can also build a custom preset in the settings, without any mod: 1 to 32 tiers with their own early and late windows, colours, weights and combo rule, plus a miss tier. It is shared as a pvng-judgement-1: string or a .json file. A preset is not a set: it is stored in the player's settings, not registered by a mod.
How the player picks one
- Settings → Game → Judgement lists the sets grouped by mod name, in the host's order (
loadOrder, then modid), then the custom presets. The chosen set shows a slider and a field per parameter, a preview of the windows, and the buttons to start a preset from a model or to duplicate any set as a preset. - The song selection has a button beside Play that shows the judgement of the next play (
osu!mania · OD 8,Etterna · J4: theshortprefix of a parameter givesJ4) and opens a small picker with the same sets.
A fresh install, and a settings file that never chose a judgement, start on Prism. A choice the player made is never changed: osu!mania OD 8, Etterna J4 or a preset stays. If the chosen set disappears (its mod disabled, failing or uninstalled), the choice moves to the first set left in the host's order, Prism when it is installed, and the player is told. A play whose set cannot be resolved (a removed mod, an unavailable combination) is played with the first set that resolves, the default first, and the player sees why (Judgement set x: …. Playing with y instead.). With no set left, a play with a set chosen cannot start; custom presets keep working.
Replays, the local board and online
- Replays store the resolved set: the tiers with both windows, the weights,
accuracyandholds. A replay is rejudged without your mod, and later changes to your set never alter it. - The local leaderboard rejudges every replay of a chart with the player's current judgement, so changing the judgement changes the ranking of the same plays. Mods read it with
leaderboard.*. - Online, the game server rejudges every play under the Prism judgement (
pvng.prism/prism). The judgement a player picks locally changes their local play and board, never the online result.
Reacting to tiers in a HUD
A judgement pack often ships a HUD that follows the tiers. game.judgements() and the judgements field of game.songStart hold the active configuration: the preset name and every tier (index, id, name, color, gradient, earlyMs, lateMs, weight, breaksCombo), the miss last. Judgement events carry the tier index and counts per tier in the same order. The example judgement-colors registers a 15-tier set and draws a bar split by tier:
/// <reference path="../../../mods/sdk/modding.d.ts" />
// A shareable judgement pack: registers "Spectrum 15", a 15-tier judgement set, for
// the game's picker, and shows at the bottom of the screen a bar split into the
// tiers of whatever judgement the chart plays with, each segment as wide as its
// share of the judgements, in the tier's color.
const BAR_WIDTH = 0.8; // screen heights
const BAR_HEIGHT = 0.012;
// 15 windows from ±4 ms to ±150 ms, colors from cyan to red, weights from 1 to 0.
const WINDOWS = [4, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80, 94, 110, 128, 150];
const SPECTRUM = WINDOWS.map((windowMs, index) => {
const hue = 190 - (190 * index) / (WINDOWS.length - 1);
return {
id: `j${index + 1}`,
name: `J${index + 1}`,
windowMs,
color: hsl(hue),
weight: Math.round((1 - index / (WINDOWS.length - 1)) * 100) / 100,
breaksCombo: index >= WINDOWS.length - 2,
};
});
// `#rrggbb` of a fully saturated, half-light hue in degrees.
function hsl(hue: number): string {
const channel = (n: number) => {
const k = (n + hue / 30) % 12;
const value = 0.5 - 0.5 * Math.max(-1, Math.min(k - 3, 9 - k, 1));
return Math.round(value * 255).toString(16).padStart(2, "0");
};
return `#${channel(0)}${channel(8)}${channel(4)}`;
}
let tiers: TierInfo[] = [];
function build(config: JudgementConfig) {
tiers = config.tiers;
hud.clear();
hud.text({
id: "preset",
text: config.preset,
layout: { x: 0.5, y: 0.955, anchor: "bottom" },
style: { size: 0.02, color: "#ffffffaa" },
});
hud.group({
id: "bar",
flow: { direction: "row" },
layout: { x: 0.5, y: 0.975, width: BAR_WIDTH, height: BAR_HEIGHT, anchor: "bottom" },
style: { background: "#ffffff1a", radius: BAR_HEIGHT / 2 },
});
for (const tier of tiers) {
hud.box({
id: `segment-${tier.index}`,
parent: "bar",
layout: { width: 0, height: BAR_HEIGHT },
style: { background: tier.color, transitionMs: 120 },
});
}
}
export default defineMod({
id: "judgement-colors",
name: "Judgement Colors",
version: "1.1.0",
apiVersion: 2,
author: "PVNG",
description: "Spectrum 15 judgement set and a colored per-tier judgement bar.",
setup() {
// No parameters: `tiers` always returns the same 15 tiers, then the miss, whose
// window is the widest tier's.
judgements.register({
id: "spectrum-15",
name: "Spectrum 15",
accuracy: "weights",
holds: "head",
tiers: () => [
...SPECTRUM,
{ id: "miss", name: "Miss", color: "#ff2050", windowMs: 150, weight: 0, breaksCombo: true },
],
});
ctx.on("game.songStart", (start) => build(start.judgements));
ctx.on("game.judgement", (judgement) => {
const judged = judgement.counts.reduce((sum, count) => sum + count, 0);
for (const tier of tiers) {
const share = judged === 0 ? 0 : (judgement.counts[tier.index] ?? 0) / judged;
hud.update({ id: `segment-${tier.index}`, layout: { width: BAR_WIDTH * share } });
}
});
ctx.on("game.songEnd", () => hud.clear());
},
});
Pitfalls
- Return the miss last, with windows at least as wide as the widest hit tier's. An unsorted list fails the validation.
- Give every tier a weight under
weights,osuScoreV1andcontinuous, none underwife3. - Keep tier ids stable between versions of your mod: symbols, the HUD and your own code key on them.
- A
tiersthat depends on anything but its argument (a clock, a random number, a global) is run once per combination: the game keeps the first result and never calls it again. - Many parameters multiply: two parameters of 101 values are 10 201 combinations, more than the 4096 resolved while loading.
See also
judgements.registerand the typesJudgementSetDefinition,JudgementTierandJudgementParamin the SDK reference, or modding.d.ts.- Rate charts with a calculator: the performance calculator that goes with each accuracy rule.
- The local leaderboard and tabs.