Skip to content

Commit

Permalink
Use actual sliderends dropped instead of estimating
Browse files Browse the repository at this point in the history
Score data for non-CL scores includes sliderends dropped, meaning no need to estimate.

CL scores are still estimated.
  • Loading branch information
Finadoggie committed Mar 22, 2024
1 parent 970e45f commit 4db6f28
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class OsuPerformanceCalculator : PerformanceCalculator
private int countOk;
private int countMeh;
private int countMiss;
private int countSliderEndsDropped;

private double effectiveMissCount;

Expand All @@ -39,6 +40,7 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s
countOk = score.Statistics.GetValueOrDefault(HitResult.Ok);
countMeh = score.Statistics.GetValueOrDefault(HitResult.Meh);
countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss);
countSliderEndsDropped = score.Statistics.GetValueOrDefault(HitResult.SmallTickMiss);
effectiveMissCount = calculateEffectiveMissCount(osuAttributes);

double multiplier = PERFORMANCE_BASE_MULTIPLIER;
Expand Down Expand Up @@ -123,7 +125,11 @@ private double computeAimValue(ScoreInfo score, OsuDifficultyAttributes attribut
if (attributes.SliderCount > 0)
{
double estimateSliderEndsDropped = Math.Clamp(Math.Min(countOk + countMeh + countMiss, attributes.MaxCombo - scoreMaxCombo), 0, estimateDifficultSliders);
double sliderNerfFactor = (1 - attributes.SliderFactor) * Math.Pow(1 - estimateSliderEndsDropped / estimateDifficultSliders, 3) + attributes.SliderFactor;
double sliderNerfFactor = 0;
if (!score.Mods.Any(h => h is OsuModClassic cl && cl.NoSliderHeadAccuracy.Value))
sliderNerfFactor = (1 - attributes.SliderFactor) * Math.Pow(1 - countSliderEndsDropped / estimateDifficultSliders, 3) + attributes.SliderFactor;
else
sliderNerfFactor = (1 - attributes.SliderFactor) * Math.Pow(1 - estimateSliderEndsDropped / estimateDifficultSliders, 3) + attributes.SliderFactor;
aimValue *= sliderNerfFactor;
}

Expand Down

0 comments on commit 4db6f28

Please sign in to comment.