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 GetRateAdjustedDisplayDifficulty() (partially incorrectly) locally reimplementing difficulty range calculations #25762

Merged
merged 6 commits into from Dec 15, 2023

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Dec 14, 2023

As per #25759 (comment), I'm not sure how this passed review.

The GetRateAdjustedDisplayDifficulty() implementations now share the same sources of truths as the actual gameplay pieces that calculate AR / OD - whether it be constants that are then used to calculate TimePreempt for AD, or the hitwindow ranges from {Osu,Taiko}HitWindows.

Notably, this fixes a regression in the local catch reimplementation committed in a04f9aa (the condition changed from adjustedDifficulty.ApproachRate < 5 to adjustedDifficulty.ApproachRate < 6). This is covered by test cases added in 555559c.


@Givikap120 for your consideration.

@bdach bdach added type:code-quality area:ruleset-api next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! labels Dec 14, 2023
@bdach bdach requested a review from peppy December 14, 2023 19:47
@peppy
Copy link
Sponsor Member

peppy commented Dec 15, 2023

I will also say that the fact that {Osu,Catch}Ruleset locally reimplement the entirety of calculating preempt/hitwindow is pretty terrible. I'm not sure how this ever got merged.

Both smoogi and I were fine with this being local (and somewhat a mess) because it's used for display only and contains a whole heap of random calculations which take time to understand. I'd leave it up to the community to fix any issues because I don't have enough knowledge of what people expect with this stuff 🤷

Copy link
Sponsor Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

Will assume correct

@peppy peppy merged commit 23fbc75 into ppy:master Dec 15, 2023
15 of 17 checks passed
@bdach bdach deleted the if-i-speak-i-am-in-big-trouble-pt-2 branch December 15, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ruleset-api next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! size/L type:code-quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants