Skip to content

Commit

Permalink
Merge pull request #29291 from Givikap120/pp_refactoring_osustrainskill
Browse files Browse the repository at this point in the history
Pp Refactoring: Removing `DEFAULT_DIFFICULTY_MULTIPLIER` from `OsuStrainSkill`
  • Loading branch information
smoogipoo authored Sep 13, 2024
2 parents 1beae4b + d54c6ae commit 6f14309
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
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 @@ -23,7 +23,7 @@ public Aim(Mod[] mods, bool withSliders)

private double currentStrain;

private double skillMultiplier => 23.55;
private double skillMultiplier => 24.963;
private double strainDecayBase => 0.15;

private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Flashlight(Mod[] mods)
hasHiddenMod = mods.Any(m => m is OsuModHidden);
}

private double skillMultiplier => 0.052;
private double skillMultiplier => 0.05512;
private double strainDecayBase => 0.15;

private double currentStrain;
Expand All @@ -41,7 +41,7 @@ protected override double StrainValueAt(DifficultyHitObject current)
return currentStrain;
}

public override double DifficultyValue() => GetCurrentStrainPeaks().Sum() * OsuStrainSkill.DEFAULT_DIFFICULTY_MULTIPLIER;
public override double DifficultyValue() => GetCurrentStrainPeaks().Sum();

public static double DifficultyToPerformance(double difficulty) => 25 * Math.Pow(difficulty, 2);
}
Expand Down
13 changes: 1 addition & 12 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
public abstract class OsuStrainSkill : StrainSkill
{
/// <summary>
/// The default multiplier applied by <see cref="OsuStrainSkill"/> to the final difficulty value after all other calculations.
/// May be overridden via <see cref="DifficultyMultiplier"/>.
/// </summary>
public const double DEFAULT_DIFFICULTY_MULTIPLIER = 1.06;

/// <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.
Expand All @@ -29,11 +23,6 @@ public abstract class OsuStrainSkill : StrainSkill
/// </summary>
protected virtual double ReducedStrainBaseline => 0.75;

/// <summary>
/// The final multiplier to be applied to <see cref="DifficultyValue"/> after all other calculations.
/// </summary>
protected virtual double DifficultyMultiplier => DEFAULT_DIFFICULTY_MULTIPLIER;

protected OsuStrainSkill(Mod[] mods)
: base(mods)
{
Expand Down Expand Up @@ -65,7 +54,7 @@ public override double DifficultyValue()
weight *= DecayWeight;
}

return difficulty * DifficultyMultiplier;
return difficulty;
}

public static double DifficultyToPerformance(double difficulty) => Math.Pow(5.0 * Math.Max(1.0, difficulty / 0.0675) - 4.0, 3.0) / 100000.0;
Expand Down
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary>
public class Speed : OsuStrainSkill
{
private double skillMultiplier => 1.375;
private double skillMultiplier => 1.430;
private double strainDecayBase => 0.3;

private double currentStrain;
private double currentRhythm;

protected override int ReducedSectionCount => 5;
protected override double DifficultyMultiplier => 1.04;

private readonly List<double> objectStrains = new List<double>();

Expand Down

0 comments on commit 6f14309

Please sign in to comment.