-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13483 from emu1337/diffspike-balance
Spike difficulty / AR&FL adjustments
- Loading branch information
Showing
6 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Difficulty.Skills; | ||
using osu.Game.Rulesets.Mods; | ||
using System.Linq; | ||
using osu.Framework.Utils; | ||
|
||
namespace osu.Game.Rulesets.Osu.Difficulty.Skills | ||
{ | ||
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. | ||
/// </summary> | ||
protected virtual int ReducedSectionCount => 10; | ||
|
||
/// <summary> | ||
/// The baseline multiplier applied to the section with the biggest strain. | ||
/// </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 => 1.06; | ||
|
||
protected OsuStrainSkill(Mod[] mods) | ||
: base(mods) | ||
{ | ||
} | ||
|
||
public override double DifficultyValue() | ||
{ | ||
double difficulty = 0; | ||
double weight = 1; | ||
|
||
List<double> strains = GetCurrentStrainPeaks().OrderByDescending(d => d).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 scale = Math.Log10(Interpolation.Lerp(1, 10, Math.Clamp((float)i / ReducedSectionCount, 0, 1))); | ||
strains[i] *= Interpolation.Lerp(ReducedStrainBaseline, 1.0, scale); | ||
} | ||
|
||
// Difficulty is the weighted sum of the highest strains from every section. | ||
// We're sorting from highest to lowest strain. | ||
foreach (double strain in strains.OrderByDescending(d => d)) | ||
{ | ||
difficulty += strain * weight; | ||
weight *= DecayWeight; | ||
} | ||
|
||
return difficulty * DifficultyMultiplier; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters