This change refactors `GetAdjustedDisplayDifficulty()` and
`GetBeatmapAttributesToDisplay()` in two ways:
- Both methods now accept `IBeatmapInfo` instead of
`IBeatmapDifficultyInfo`. This is done in order to make mania key
count display to work, wherein `IBeatmapDifficultyInfo` is not enough
to calculate the final key count.
- `GetAdjustedDisplayDifficulty()` now applies all
`IApplicableToDifficulty` mods itself. I did this after noticing that
every real consumer of this method had to do that themselves for very
little reason.
In stable mania, Hard Rock and Easy mods do not work the same way as
they do on all of the rulesets. The difference is that mania HR and EZ,
rather than apply a multiplier to the map's original Overall Difficulty,
apply multipliers to *the durations of hit windows themselves*.
Prior to the last release, lazer was oblivious to this reality and just
treated mania HR / EZ as it did every other ruleset. Last release, for
the sake for gameplay parity across rulesets, the mods in question were
adjusted to match stable, but in the process, it started looking like HR
/ EZ did not change OD anymore.
The problem is that they do, but applying a multiplier to the map's OD
and applying a multiplier to the hit window duration is not the same
thing. The second thing is actually *much harsher* in magnitude, to the
point where applying HR to any map is almost guaranteed to exceed "the
effective OD" of 10, and applying EZ to any map is almost guaranteed to
result in "negative effective OD".
This change attempts to convey that reality by displaying "effective
OD", similar to what's already done in other rulesets when rate-changing
mods are active. Note that the values this will display *do not match*
stable *and that is correct*, because stable song select *lies* about
the actual impact on OD by just assuming it can treat all rulesets in
the same way.
---
Would close https://github.com/ppy/osu/issues/34150 I guess.
And yes I would like *all of the above* to land on the changelog if
possible if this is merged.
For further convincing that this makes any semblance of sense please see
the following: https://www.desmos.com/calculator/yigt7jycdv
It was doing a "if I touch the game in this very specific manner
everything works" which will light up in very nice green colours but is
actually useless for preventing regressions.
The replay stability tests needed adjustments because hit windows have
been materially changed with the previous commit. What matters in the
replay stability tests is covering the time instants near the hit window
edges and ensuring that re-encode doesn't mutate the resulting
judgements, not what the particular numbers used are.
This is a "two-birds-with-one-stone" change, which addresses both
https://github.com/ppy/osu/issues/28744 and
https://github.com/ppy/osu/issues/11311 simultaneously.
- The replay stability issue caused by time instants being rounded to
nearest integer is fixed by this, because flooring and
subtracting/adding 0.5 from the hit window threshold makes it
impossible for a judgement to switch to anything else after replay
rounding is applied - all hit windows are always a full integer plus
0.5 milliseconds, which immunizes them to rounding-to-full-ms issues.
- The direction of applying the 0.5 adjustment additionally fixes the
disparity with stable - in osu! and taiko 0.5 is subtracted as
hit window ranges in those rulesets are exclusive on stable, while in
mania 0.5 is added, as the hit window ranges there are *inclusive* on
stable.
As should be obvious, this materially changes hit windows. To what degree
this is a *significant* change is up for discussion; I would say "no"
since hitting half a millisecond changes would require 2000fps input
recording, and we're still timestamping inputs using the update thread's
clock, that gives a 1ms resolution at best.
In the worst case, in osu! and taiko, this can change a hit window range
by 1.5ms (e.g. 300.9ms -> floored to 300ms -> 299.5ms after subtraction
of the half). It's more than the best-case resolution of input
timestamps, but not by much. Considering how cleanly this resolves the
issues in question, I see it as an acceptable tradeoff.
This change pulls back a significant degree of overspecialisation and
rigidity in the class structure of `HitWindows` to make subsequent
changes to hit windows, whose purpose is to improve replay playback
accuracy, possible to do cleanly.
Notably:
- `HitWindows` is full abstract now. In a few use cases, and as a
reference for ruleset implementors, `DefaultHitWindows` is provided as
a separate class instead.
This fixes the weirdness wherein `HitWindows` always declared 6 fields
for result types but some of them would never be set to a non-zero
value or read.
- `HitWindow.GetRanges()` is deleted because it is overspecialised and
prevents being able to adjust hitwindows by ±0.5ms cleanly which will
be required later.
The fallout of this is that the assertion that used `GetRanges()` in
the `HitWindows` ctor must use something else now, and the closest
thing to it was `GetAllAvailableWindows()`, which didn't return
the miss window - so I made it return the miss window and fixed the
one consumer that didn't want it (bar hit error meter) to skip it.
- Diff also contains some clean-up around `DifficultyRange` to unify
handling of it.
The gameplay clock runs at 1000 ms intervals, and the previous duration
meant that the "store" step could cause a missed spinning check in a bad
case scenario.
cd4ab9307c made these tests fail because
they were basically pressing and releasing a key in a single frame,
which hopefully never actually happens in real scenarios. (It's a bit
tricky to determine if it can.)
This continues on https://github.com/ppy/osu/pull/32770 via adding test
cases which cover treatment of hit windows in stable in osu!, taiko, and
mania. The test cases are exportable to beatmap `.osu` files and replay
`.osr` files for stable crosscheck by setting `ExportLocation` on the
test scene classes to a non-null path.
For the most part, osu! and taiko ground truth matches previous findings
- hit windows in those rulesets are floored to the nearest integer.
The real "star" of this diff is mania, because:
- The hit windows in mania depend on:
- overall difficulty (as expected)
- whether Score V2 is active
- if Score V2 is not active, the hit windows also depend on whether
the map was converted from another ruleset or not
- Regardless of all aforementioned factors, mania hitwindows are *not
symmetrical*. Due to what *appears* to be a straight-up bug, it is
*not possible to achieve a MEH / 50 hit result when hitting late*.
There is specific code that coerces late hits beyond 100 hit window
range to full misses:
https://github.com/peppy/osu-stable-reference/blob/996648fba06baf4e7d2e0b248959399444017895/osu!/GameplayElements/HitObjectManagerMania.cs#L737-L751
Note that despite the fact that I'm PRing these test cases, none of this
is a promise that all of stable behaviours will be returning unchanged
when I PR something to actually do something about this and the other
issue of replay instability. This is just coverage, to be used for
awareness of what's still broken. The extent of how much stable is going
to be humored here going forward will be subject to negotiation.
Closes https://github.com/ppy/osu/issues/32420.
The failure cause here is that in editor the beatmap version for the
beatmap affected (or... any beatmap, really), is 0 (ZERO). That is
probably a regression from https://github.com/ppy/osu/pull/32315, but
like... can we universally agree that calling that change "a regression"
in any capacity is dumb? Like what was that code *doing* playing dumb
reference games and copying stuff into an arbitrary instance that could
get or not get used later on? And now you have a 50/50 chance of
accessing the *correct* model's field, depending on whether you go via
`BeatmapInfo` or `Beatmap.BeatmapInfo`?
Moving the field to `IBeatmap`, i.e. what is by now - by consensus,
since https://github.com/ppy/osu/pull/28473 - supposed to be the "decoded
and materialised" beatmap, fixes this issue.
I probably should have done this as part of
https://github.com/ppy/osu/pull/28473 but it slipped my mind. Probably
for the better too because this change has rather large chances of
breaking stuff so maybe better to examine it in isolation (via diffcalc
runs or whatever).
For added humour points, you'd say that the field on `BeatmapInfo` was
not `[Ignore]`d, so this is a realm schema change, right? No. As far as
I can tell, it's not. I opened realm studio and `BeatmapVersion` *is not
a listed column` on `Beatmap` models.
I'm also not gonna get into the fact that I think `EditorBeatmap` doing
dumb games with juggling two `BeatmapInfo` references since
https://github.com/ppy/osu/pull/15075 is bad, because I don't think I
have the mental capacity to hotfix this by going down that train of
thought.