---
url: https://milthm.cn/wiki/en/manual/mechanics/judgment/definitions.md
description: >-
  Formal judgment windows, mapping, sequences, and Lightning statistics for
  Milthm.
---

# Judgment Definitions

This document defines the ordinary judgment model consumed by [Scoring V3](https://milthm.cn/wiki/en/manual/mechanics/scoring-v3.md) and [Accuracy V2](https://milthm.cn/wiki/en/manual/mechanics/accuracy-v2.md).

## Notation Summary

| Symbol | Name | Meaning |
|--------|------|---------|
| $\delta$ | Hit timing bias | Time difference between a player action and its ordinary judgment point. |
| $\mathcal{J}$ | Ordinary judgment set | Set of ordinary judgment grades, including the default Miss element $m = \varnothing$. |
| $J$ | Judgment mapping | Function that maps a hit timing bias to an ordinary judgment grade. |
| $\Sigma$ | Ordinary judgment point sequence | Ordered sequence of ordinary judgment points in a chart. |
| $N$ | Ordinary judgment count | Length of $\Sigma$ in this specification. Lightning notes are excluded. |
| $\Delta$ | Hit offset sequence | Ordered sequence of hit timing biases. |
| $\Xi$ | Ordinary judgment sequence | Ordered sequence of ordinary judgment results. |
| $\mathcal{J}\_f$ | Lightning judgment set | Dedicated judgment set for Lightning notes. |
| $\Phi$ | Lightning judgment sequence | Ordered sequence of Lightning judgment results. |
| $F_s$ | Lightning Exact count | Number of Lightning Exact results. |
| $F_m$ | Lightning Miss count | Number of Lightning Miss results. |
| $H_f$ | Lightning HP | Lightning-specific reserve consumed by Lightning Miss results. |
| $O_f$ | Lightning overflow | Lightning Miss damage that exceeds remaining Lightning HP. |

## Terms

An **ordinary note** is a Dew, Drizzle, or Raindrop Note. Ordinary notes produce ordinary judgments.

An **ordinary judgment** is a judgment result produced by an ordinary note. Ordinary judgments form the sequence $\Xi$ and are used by ScoreV3, AccV2, ordinary combo, All Perfect, and All Combo conditions.

Lightning Notes produce **Lightning judgments**. Lightning judgments form the separate sequence $\Phi$ and are excluded from $\Xi$ and the ordinary judgment count $N$.

An **ordinary judgment point** is a reference time used to judge a specific ordinary player action.

A **hit timing bias** is the time difference, in milliseconds, between the player action and the ordinary judgment point. Negative values indicate early hits; positive values indicate late hits.

A judgment grade is a union of continuous time intervals on the real line. For a judgment grade $l$:

$$
l = \bigcup\_{i = 1}^{n} I_i
$$

where each $I_i$ is a continuous interval on $\mathbb{R}$.

The ordinary judgment set $\mathcal{J}$ contains all ordinary judgment grades and the default element $m = \varnothing$, which represents no produced judgment. Distinct judgment grades do not overlap, and the union of ordinary hit windows is continuous.

## Judgment Windows

*Milthm* uses the following ordinary judgment windows.

| Grade | Name | Hit timing bias interval | Window width |
|-------|------|--------------------------|--------------|
| $s$ | Exact | $\[-35, 35]$ ms | $70$ ms |
| $p$ | Perfect | $\[-70, -35) \cup (35, 70]$ ms | $70$ ms |
| $g$ | Great | $\[-105, -70) \cup (70, 105]$ ms | $70$ ms |
| $n$ | Good | $\[-140, -105) \cup (105, 140]$ ms | $70$ ms |
| $b$ | Bad | $\[-155, -140) \cup (140, 155]$ ms | $30$ ms |
| $m$ | Miss | $\varnothing$ | Not applicable |

The judgment mapping $J: \mathbb{R} \to \mathcal{J}$ is:

$$
J(\delta) =
\begin{cases}
j, & \exists j \in \mathcal{J} \left(\delta \in j\right), \\
m, & \text{otherwise.}
\end{cases}
$$

## Judgment Sequence

Let the sequence of ordinary judgment points be:

$$
\Sigma = {\sigma_1, \sigma_2, \cdots, \sigma_N}
$$

where $\Sigma$ is finite and non-decreasing. In this document, the ordinary judgment count $N$ is the length of this sequence. Lightning notes are excluded from $N$.

The hit offset sequence is:

$$
\Delta = {\delta_1, \delta_2, \cdots, \delta_N}
$$

The ordinary judgment sequence is:

$$
\Xi = {\xi_1, \xi_2, \cdots, \xi_N}, \qquad \xi_i = J(\delta_i)
$$

## Lightning Statistics

Lightning notes use a dedicated statistic judgment set:

$$
\mathcal{J}\_f = {f_s, f_m}
$$

where $f_s$ is Lightning Exact and $f_m$ is Lightning Miss.

Let the Lightning judgment sequence be:

$$
\Phi = {\phi_1, \phi_2, \cdots, \phi_M}, \qquad \phi_k \in \mathcal{J}\_f
$$

Lightning statistics use the following state variables.

| Symbol | Name | Meaning | Initial value |
|--------|------|---------|---------------|
| $F_s$ | Lightning Exact count | Cumulative number of Lightning Exact results. | $0$ |
| $F_m$ | Lightning Miss count | Cumulative number of Lightning Miss results. | $0$ |
| $H_f$ | Lightning HP | Reserve value that absorbs Lightning Miss damage. | $256$ |
| $O_f$ | Lightning overflow | Overflow damage from the current Lightning Miss after Lightning HP is exhausted. | $0$ |

At the beginning of a chart:

$$
F_s = 0, \qquad F_m = 0, \qquad H_f = 256
$$

Lightning HP is capped at $256$. Ordinary Exact and Perfect judgments recover Lightning HP:

$$
H_f \leftarrow
\begin{cases}
\min(H_f + 2, 256), & \xi_i = s, \\
\min(H_f + 1, 256), & \xi_i = p, \\
H_f, & \text{otherwise.}
\end{cases}
$$

Lightning Exact does not recover Lightning HP. For each Lightning judgment:

$$
\begin{aligned}
f_s &: F_s \leftarrow F_s + 1, \\
f_m &: F_m \leftarrow F_m + 1.
\end{aligned}
$$

Each Lightning Miss deals $64$ Lightning HP damage. Let $H_f^-$ be the Lightning HP before the damage is applied. The overflow damage is:

$$
O_f = \max(64 - H_f^-, 0)
$$

and the remaining Lightning HP is:

$$
H_f \leftarrow \max(H_f^- - 64, 0)
$$

If $O_f > 0$, the overflow is applied to the ScoreV3 combo score state and can reduce the final score. See [Scoring V3](https://milthm.cn/wiki/en/manual/mechanics/scoring-v3.md).

Lightning judgments are counted only in Lightning-specific counters and are not added to the ordinary judgment sequence $\Xi$.

Lightning judgments, Lightning HP, and Lightning overflow do not affect All Perfect or All Combo conditions. These conditions are evaluated only from ordinary judgment counters.

When a Lightning Note and ordinary notes are judged at the same time, the Lightning Note is judged after the ordinary notes. If a Drizzle Note is already active, the Lightning judgment does not break the active Drizzle.
