Skip to content

Commit

Permalink
Fix failed scores with no hits on beatmaps with ridiculous mod combin…
Browse files Browse the repository at this point in the history
…ations showing hundreds of pp points awarded (#31741)

See
https://discord.com/channels/188630481301012481/1097318920991559880/1334716356582572074.

On `master` this is actually worse and shows thousands of pp points, so
I guess `pp-dev` is a comparable improvement, but still flagrantly
wrong. The reason why `pp-dev` is better is the `speedDeviation == null`
guard at the start of `computeSpeedValue()` which turns off the rest of
the calculation, therefore not exposing the bug where
`relevantTotalDiff` can go negative. I still guarded it in this commit
just for safety's sake given it is clear it can do very wrong stuff.
  • Loading branch information
bdach authored Feb 14, 2025
1 parent afdcf40 commit 4e66536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private double computeSpeedValue(ScoreInfo score, OsuDifficultyAttributes attrib
speedValue *= speedHighDeviationMultiplier;

// Calculate accuracy assuming the worst case scenario
double relevantTotalDiff = totalHits - attributes.SpeedNoteCount;
double relevantTotalDiff = Math.Max(0, totalHits - attributes.SpeedNoteCount);
double relevantCountGreat = Math.Max(0, countGreat - relevantTotalDiff);
double relevantCountOk = Math.Max(0, countOk - Math.Max(0, relevantTotalDiff - countGreat));
double relevantCountMeh = Math.Max(0, countMeh - Math.Max(0, relevantTotalDiff - countGreat - countOk));
Expand All @@ -297,7 +297,7 @@ private double computeAccuracyValue(ScoreInfo score, OsuDifficultyAttributes att
amountHitObjectsWithAccuracy += attributes.SliderCount;

if (amountHitObjectsWithAccuracy > 0)
betterAccuracyPercentage = ((countGreat - (totalHits - amountHitObjectsWithAccuracy)) * 6 + countOk * 2 + countMeh) / (double)(amountHitObjectsWithAccuracy * 6);
betterAccuracyPercentage = ((countGreat - Math.Max(totalHits - amountHitObjectsWithAccuracy, 0)) * 6 + countOk * 2 + countMeh) / (double)(amountHitObjectsWithAccuracy * 6);
else
betterAccuracyPercentage = 0;

Expand Down

0 comments on commit 4e66536

Please sign in to comment.