Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "spinner" conversion for mania-specific beatmaps #30984

Merged
merged 11 commits into from
Dec 19, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Dec 6, 2024

Fixes #30836

PRing as draft for now until the diffcalc spreadsheet is generated and (hopefully) shows some more differences I can cross check.

Some commentary provided in individual commits. tl;dr: Spinners need to go through the conversion path rather than converted as simple hold notes.

A big part of these changes is refactoring, which is somewhat necessary
because it was previously implemented as two separate pathways which
in-fact need to be joined at the hip when handling spinners.

I've chosen to use `IHasLegacyHitObjectType` here because there's no
other flag that allows us to tell `ConvertHold` apart from
`ConvertSpinner`.
Better symbolises the intent of this generator which is to convert
hitobjects in their most simple forms - anything with an end time
converts to a hold or otherwise converts to a normal note.
In particular, the spinner one is the most relevant to this batch of
changes.
@smoogipoo smoogipoo added ruleset/osu!mania area:beatmap-parsing .osu file format parsing compatibility change Changes to be considered in the future which break compatibility with osu!stable scores. labels Dec 6, 2024
@smoogipoo
Copy link
Contributor Author

!diffcalc
RULESET=mania

@smoogipoo
Copy link
Contributor Author

!diffcalc
RULESET=mania
NO_CONVERTS=1

In particular, "EndTimeObject" is no longer correct - it's strictly used
for spinners and not holds.
Normally not an issue, but some tests create their own hitobjects
deriving from `ConvertHitObject`.
Also used in some tests (e.g. beatmaps containing `HitCircle`s).
Copy link

github-actions bot commented Dec 6, 2024

Copy link

github-actions bot commented Dec 6, 2024

Difficulty calculation failed: https://github.com/ppy/osu/actions/runs/12194988363

@smoogipoo
Copy link
Contributor Author

!diffcalc
RULESET=mania
GENERATORS=score

Copy link

github-actions bot commented Dec 7, 2024

@smoogipoo
Copy link
Contributor Author

!diffcalc
RULESET=mania
TOLERANCE=0

Copy link

github-actions bot commented Dec 9, 2024

@smoogipoo
Copy link
Contributor Author

smoogipoo commented Dec 9, 2024

Unless I'm doing something wrong I can't find any differences in ranked maps, neither with the spreadsheets above nor offline testing + custom code over the https://data.ppy.sh beatmap dumps (which finds the case in the added test). So this is likely an isolated scenario and I think the PR is ready to be merged with no further considerations made for existing scores.

@smoogipoo smoogipoo marked this pull request as ready for review December 9, 2024 08:37
@bdach
Copy link
Collaborator

bdach commented Dec 11, 2024

So I was going to do minimal review on this, just basically a baseline check of a few things, and probably get it in, but something doesn't look right here.

The two known-broken beatmaps given by the issue reporter are https://osu.ppy.sh/beatmapsets/814850#osu/1901200 and https://osu.ppy.sh/beatmapsets/2283436#mania/4869637. The first one is a bit annoying to do a cross-check on, so I checked the second, seeked to the first hold note, and... I'm not sure why but it's not the same?

stable master this PR
screenshot001 osu_2024-12-11_18-37-24 osu_2024-12-11_18-34-37

The hold note moved, but... not where it should...?

I even extracted conversion mappings for both maps and both are failing even on this branch, so I'm not sure what is going on...

In particular, mania-specific beatmaps that normally go via the
"passthrough" generator should not adjust the stored pattern value.

The "spinner" generator, which was previously intended to be used for
non-mania-specific beatmaps, is now valid even for mania-specific
beatmaps, and uses this value.

In other words, another way of writing this would be:
```csharp
if (conversion is SpinnerPatternGenerator || conversion is
PassThroughPatternGenerator) ? lastPattern : newPattern;
```
@smoogipoo
Copy link
Contributor Author

Good catch. Let's try this one again then...

As for https://osu.ppy.sh/beatmapsets/814850#osu/1901200, the beatmap uses negative spinner durations which we clamp to 0 to avoid exceptions in other places of the game. We can throw an exception as we do for every other parsed value exceeding limits, but I'm choosing to ignore this for the time being to avoid potentially throwing many errors into the user's notifications. It's not just spinners - break times have to be validated too and I'm not sure how large the scope of that is:

int drainTime = (int)(((lastObject?.StartTime ?? 0) - (firstObject?.StartTime ?? 0) - Beatmap.TotalBreakTime) / 1000);

@smoogipoo
Copy link
Contributor Author

!diffcalc
RULESET=mania
TOLERANCE=0
GENERATORS=pp,sr,score

Copy link

@smoogipoo
Copy link
Contributor Author

Well, the sheet is still empty. Not sure what to do other than merging at this point 😬

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging it is then I guess.

If the other beatmap uses negative spinner duration then I consider that to be unsupported and undefined-behaviour loved/aspire dumbness and thus no longer care.

@bdach bdach merged commit 1057aa8 into ppy:master Dec 19, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:beatmap-parsing .osu file format parsing compatibility change Changes to be considered in the future which break compatibility with osu!stable scores. ruleset/osu!mania size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

osu!Mania Converted Standard maps do not read Spinners correctly compared to Stable
2 participants