Skip to content

Commit

Permalink
Resolve conflicts with recent slider hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
MBmasher committed Nov 12, 2021
1 parent 131e64e commit 5a3be77
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
15 changes: 10 additions & 5 deletions osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
return new OsuDifficultyAttributes { Mods = mods, Skills = skills };

double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;
double speedRating = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
double flashlightRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
double flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier;

double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;

if (mods.Any(h => h is OsuModRelax))
speedRating = 0.0;
Expand Down Expand Up @@ -75,6 +78,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
AimStrain = aimRating,
SpeedStrain = speedRating,
FlashlightRating = flashlightRating,
SliderFactor = sliderFactor,
ApproachRate = preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5,
OverallDifficulty = (80 - hitWindowGreat) / 6,
DrainRate = drainRate,
Expand Down Expand Up @@ -111,7 +115,8 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo

return new Skill[]
{
new Aim(mods),
new Aim(mods, true),
new Aim(mods, false),
new Speed(mods, hitWindowGreat),
new Flashlight(mods, preempt)
};
Expand All @@ -124,7 +129,7 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo
new OsuModEasy(),
new OsuModHardRock(),
new OsuModFlashlight(),
new OsuModHidden(),
new OsuModHidden()
};
}
}
}
10 changes: 10 additions & 0 deletions osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ private double computeAimValue()
aimValue *= 1.0 + 0.04 * (12.0 - Attributes.ApproachRate);
}

// We assume 15% of sliders in a map are difficult since there's no way to tell from the performance calculator.
double estimateDifficultSliders = Attributes.SliderCount * 0.15;

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;
aimValue *= sliderNerfFactor;
}

aimValue *= accuracy;
// It is important to also consider accuracy difficulty when doing that.
aimValue *= 0.98 + Math.Pow(Attributes.OverallDifficulty, 2) / 2500;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
Expand Down

0 comments on commit 5a3be77

Please sign in to comment.