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 gameplay PP counter not matching results screen #27808

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Apr 8, 2024

Fixes #27798

The issue is that CreateDifficultyAttributes generally expects the original beatmap to be present for, for example, computing the max combo. Peeking into the implementation of CatchDifficultyCalculator makes it evident as to why it expects nested hitobjects to not be present in the beatmap:

MaxCombo = beatmap.HitObjects.Count(h => h is Fruit) + beatmap.HitObjects.OfType<JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet)),

This implementation works ensures that the progressive beatmap only contains hitobjects from the original beatmap.

@bdach
Copy link
Collaborator

bdach commented Apr 9, 2024

Can you explain what the actual issue is? I'm looking at the diff and I don't get it. How does a "parenting" mapping fix anything? (What does the notion of a "parent" even mean here, too?)

I see something about "difficulty hitobjects not corresponding 1:1 to real hitobjects", but I don't get what that has to do with the report. This came up before, by the way, but I don't believe the problem described therein would be fixed by this.

@pull-request-size pull-request-size bot added size/L and removed size/S labels Apr 11, 2024
@smoogipoo
Copy link
Contributor Author

Can you explain what the actual issue is? I'm looking at the diff and I don't get it. How does a "parenting" mapping fix anything? (What does the notion of a "parent" even mean here, too?)

Whoops. My bad. I went through two implementations here and the original one was much simpler (but also didn't work correctly).
I've updated the description.

This came up before, by the way,

This is a very good point which I didn't account for. I've fixed that case also by adding all intermediate parenting objects.

I've also added a very rough test for all of this.

// Implementations expect the progressive beatmap to only contain top-level objects from the original beatmap.
// At the same time, we also need to consider the possibility DHOs may not be generated for any given object,
// so we'll add all remaining objects up to the current point in time to the progressive beatmap.
for (int i = progressiveBeatmap.HitObjects.Count; i < Beatmap.HitObjects.Count; i++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a little better but there is still a bit of a problem with this implementation (related to #17964 moreso than to the issue this was originally trying to resolve), although it's only obvious at the point of usage of the method.

Most difficulty calculators skip the first several objects (because they need multiple to work with). This means that for the first object (possibly more, depending on ruleset), the pp calculator will use the TimedDifficultyCalculator for the first difficulty object, which may actually be the second or third or fourth actual object.

I'm not sure how much this matters, I guess I'd be willing to let it slide for another day, but given you've already spent time to attempt to fix #17964 with the recent changes too I figure I should at least bring this up before proceeding further...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there actually an issue with that? Logically I wouldn't think so because it would round to 0pp no matter what.

I'm not sure how to handle that if there is an issue. Perhaps it would be handled in the counter directly rather than clamping to 0.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's probably fine, but I'll give it another check.

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.

seems okay

@bdach bdach merged commit 1f010c4 into ppy:master Apr 23, 2024
14 of 17 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.

None yet

2 participants