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

Change strain reduction to be on first chronological strains #31181

Open
wants to merge 12 commits into
base: pp-dev
Choose a base branch
from
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu/Difficulty/Evaluators/AimEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
public static class AimEvaluator
{
private const double wide_angle_multiplier = 1.5;
private const double acute_angle_multiplier = 2.7;
private const double acute_angle_multiplier = 2.6;
private const double slider_multiplier = 1.35;
private const double velocity_change_multiplier = 0.75;
private const double wiggle_multiplier = 1.02;
Expand Down Expand Up @@ -90,7 +90,7 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, bool with
// Penalize wide angles if they're repeated, reducing the penalty as the lastAngle gets more acute.
wideAngleBonus *= angleBonus * (1 - Math.Min(wideAngleBonus, Math.Pow(calcWideAngleBonus(lastAngle), 3)));
// Penalize acute angles if they're repeated, reducing the penalty as the lastAngle gets more obtuse.
acuteAngleBonus *= 0.03 + 0.97 * (1 - Math.Min(acuteAngleBonus, Math.Pow(calcAcuteAngleBonus(lastAngle), 3)));
acuteAngleBonus *= 0.05 + 0.95 * (1 - Math.Min(acuteAngleBonus, Math.Pow(calcAcuteAngleBonus(lastAngle), 3)));

// Apply wiggle bonus for jumps that are [radius, 3*diameter] in distance, with < 110 angle
// https://www.desmos.com/calculator/dp0v0nvowc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class SpeedEvaluator
private const double single_spacing_threshold = OsuDifficultyHitObject.NORMALISED_DIAMETER * 1.25; // 1.25 circles distance between centers
private const double min_speed_bonus = 200; // 200 BPM 1/4th
private const double speed_balancing_factor = 40;
private const double distance_multiplier = 0.94;
private const double distance_multiplier = 0.9;

/// <summary>
/// Evaluates the difficulty of tapping the current object, based on:
Expand Down
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 @@ -160,7 +160,7 @@ private double computeAimValue(ScoreInfo score, OsuDifficultyAttributes attribut

double aimValue = OsuStrainSkill.DifficultyToPerformance(aimDifficulty);

double lengthBonus = 0.95 + 0.4 * Math.Min(1.0, totalHits / 2000.0) +
double lengthBonus = 1 + 0.35 * Math.Min(1.0, totalHits / 2000.0) +
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);
aimValue *= lengthBonus;

Expand Down Expand Up @@ -200,7 +200,7 @@ private double computeSpeedValue(ScoreInfo score, OsuDifficultyAttributes attrib

double speedValue = OsuStrainSkill.DifficultyToPerformance(attributes.SpeedDifficulty);

double lengthBonus = 0.95 + 0.4 * Math.Min(1.0, totalHits / 2000.0) +
double lengthBonus = 1 + 0.35 * Math.Min(1.0, totalHits / 2000.0) +
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);
speedValue *= lengthBonus;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Aim(Mod[] mods, bool withSliders)

private double currentStrain;

private double skillMultiplier => 25.18;
private double skillMultiplier => 23.0;
private double strainDecayBase => 0.15;

private readonly List<double> sliderStrains = new List<double>();
Expand Down
15 changes: 8 additions & 7 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
public abstract class OsuStrainSkill : StrainSkill
{
/// <summary>
/// The number of sections with the highest strains, which the peak strain reductions will apply to.
/// This is done in order to decrease their impact on the overall difficulty of the map for this skill.
/// The duration strain reduction will apply to.
/// We assume that the first seconds of the map are always easier than calculated difficulty due to them being free to retry.
/// </summary>
protected virtual int ReducedSectionCount => 10;
protected virtual int ReducedDuration => 40;

/// <summary>
/// The baseline multiplier applied to the section with the biggest strain.
Expand All @@ -37,12 +37,13 @@
// These sections will not contribute to the difficulty.
var peaks = GetCurrentStrainPeaks().Where(p => p > 0);

List<double> strains = peaks.OrderDescending().ToList();
List<double> strains = peaks.ToList();

// We are reducing the highest strains first to account for extreme difficulty spikes
for (int i = 0; i < Math.Min(strains.Count, ReducedSectionCount); i++)
double reducedSectionCount = ReducedDuration * 1000.0 / SectionLength;

for (int i = 0; i < Math.Min(strains.Count, reducedSectionCount); i++)
{
double scale = Math.Log10(Interpolation.Lerp(1, 10, Math.Clamp((float)i / ReducedSectionCount, 0, 1)));
double scale = Math.Log10(Interpolation.Lerp(1, 10, Math.Clamp((float)i / reducedSectionCount, 0, 1)));

Check failure on line 46 in osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Cast is redundant. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0004)

Check failure on line 46 in osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Cast is redundant. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0004)
strains[i] *= Interpolation.Lerp(ReducedStrainBaseline, 1.0, scale);
}

Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary>
public class Speed : OsuStrainSkill
{
private double skillMultiplier => 1.430;
private double skillMultiplier => 1.44;
private double strainDecayBase => 0.3;

private double currentStrain;
private double currentRhythm;

protected override int ReducedSectionCount => 5;

public Speed(Mod[] mods)
: base(mods)
{
Expand Down
Loading