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

Implement "max pp" beatmap difficulty attribute text #30322

Merged
merged 12 commits into from
Nov 14, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Oct 17, 2024

Prereqs:

2024-10-17.20-07-37.mp4

This is the second part of #29151 Whether it's agreed upon is likely up for discussion, and likely needs @peppy 's input.

Because the overhead of computing PP is very small, I've merged PerformanceBreakdownCalculator's main logic into BeatmapDifficultyCache and is now computed alongside star difficulty. It makes a lot of contextual sense and removes the double async logic.

Also it now uses the ScoreProcessor for score statistics + max combo, which are guaranteed to be accurate. There was a "todo: Get max combo from difficulty calculator" in PerformanceBreakdownCalculator's implementation which has been removed - if this leads to incorrect values then live values would be wrong, hence I believe this is the correct change to make.

/// A working beatmap that caches its playable representation.
/// This is intended as single-use for when it is guaranteed that the playable beatmap can be reused.
/// </summary>
private class PlayableCachedWorkingBeatmap : IWorkingBeatmap
Copy link
Contributor Author

@smoogipoo smoogipoo Oct 17, 2024

Choose a reason for hiding this comment

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

This is a hack because DifficultyCalculator only accepts an IWorkingBeatmap and I want to avoid double-fetching the playable beatmap. I'm not sure if there's a future where DifficultyCalculator accepts a playable beatmap, but it can be experimented with when it gets rewritten (something I'm in the progress of).

Though, perhaps we're already doing too many GetPlayableBeatmap() fetches elsewhere in the game (ahem - BeatmapInfoWedge) so this needs a more systematic solution at some point.

@Shavixinio
Copy link

Would be nice to potentially also add a preview for 99% FC, 98% FC etc. like the pp calculator extension has.

@smoogipoo
Copy link
Contributor Author

No thanks. You can use other tools for that.

@Shavixinio
Copy link

Can you elaborate more about this decision? You can use other tools for the max pp value as well, which makes me confused why my idea is rejected.

@Givikap120
Copy link
Contributor

Can you elaborate more about this decision? You can use other tools for the max pp value as well, which makes me confused why my idea is rejected.

Because it adds a lot of extra complexity for questionable benefit
If you want to be very precise with simulating score - you can always use external tools like osu-tools

@Shavixinio
Copy link

That's a much better answer

@huyenden
Copy link

Finally the day I've been waiting for max pp to go live has come. Awesome 🙌

@pull-request-size pull-request-size bot added size/L and removed size/XL labels Nov 1, 2024
@bdach bdach self-requested a review November 1, 2024 12:14
Comment on lines 51 to 58
Attributes = null;
DifficultyAttributes = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Completely irrelevant to anything but I'm not sure what this was even doing, looks 100% redundant to me 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rename or the property itself? It does appear to be used in a few locations if that's what you were referring to.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant the null initialisation specifically.

@@ -225,6 +228,9 @@ private LocalisableString getValueString(BeatmapAttribute attribute)
case BeatmapAttribute.StarRating:
return (starDifficulty?.Stars ?? 0).ToLocalisableString(@"F2");

case BeatmapAttribute.MaxPP:
return (starDifficulty?.PerformanceAttributes?.Total ?? 0).ToLocalisableString(@"F2");
Copy link
Collaborator

@bdach bdach Nov 1, 2024

Choose a reason for hiding this comment

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

I find it a bit weird how this is rounded to 2 digits when the rolling pp counter that you can add to HUD rounds to full points. This leads to funky situations wherein you seem to get "more pp than the maximum" which actually is just a rounding artifact:

osu_2024-11-01_13-28-05

This is also the only display in the entire game that displays fractional performance points as far as I can tell. HUD counter doesn't, results screen display doesn't, performance breakdown doesn't. Even web views don't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. I've rounded it.

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.

I remain in firm ideological opposition to the basic premise of this feature but I have no technical objections. I have one UX objection (see above) but maybe it's minor and can be disregarded.

Will leave final go/no go call to @peppy.

smoogipoo and others added 3 commits November 1, 2024 22:43
The rounding matches the implementation of `PerformancePointsCounter`.
@peppy peppy self-requested a review November 14, 2024 04:36
@peppy peppy enabled auto-merge November 14, 2024 04:45
@peppy peppy merged commit 5cc1cbe into ppy:master Nov 14, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants