1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 11:42:54 +08:00

Reduce history max overall instead of using clock rate

This commit is contained in:
StanR 2024-09-16 00:49:36 +05:00
parent 145731bdef
commit bee18b03e7
3 changed files with 9 additions and 14 deletions

View File

@ -61,14 +61,14 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
} }
} }
private const int history_time_max = 5 * 1000; // 5 seconds of calculatingRhythmBonus max. private const int history_time_max = 4 * 1000; // 5 seconds of calculatingRhythmBonus max.
private const int history_objects_max = 32; private const int history_objects_max = 24;
private const double rhythm_multiplier = 1.32; private const double rhythm_multiplier = 1.32;
/// <summary> /// <summary>
/// Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current <see cref="OsuDifficultyHitObject"/>. /// Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current <see cref="OsuDifficultyHitObject"/>.
/// </summary> /// </summary>
public static double EvaluateDifficultyOf(DifficultyHitObject current, double clockRate) public static double EvaluateDifficultyOf(DifficultyHitObject current)
{ {
if (current.BaseObject is Spinner) if (current.BaseObject is Spinner)
return 0; return 0;
@ -81,18 +81,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
var previousIsland = new Island(deltaDifferenceEpsilon); var previousIsland = new Island(deltaDifferenceEpsilon);
Dictionary<Island, int> islandCounts = new Dictionary<Island, int>(); Dictionary<Island, int> islandCounts = new Dictionary<Island, int>();
int historyTimeMaxAdjusted = (int)Math.Ceiling(history_time_max / clockRate);
int historyObjectsMaxAdjusted = (int)Math.Ceiling(history_objects_max / clockRate);
double startRatio = 0; // store the ratio of the current start of an island to buff for tighter rhythms double startRatio = 0; // store the ratio of the current start of an island to buff for tighter rhythms
bool firstDeltaSwitch = false; bool firstDeltaSwitch = false;
int historicalNoteCount = Math.Min(current.Index, historyObjectsMaxAdjusted); int historicalNoteCount = Math.Min(current.Index, history_objects_max);
int rhythmStart = 0; int rhythmStart = 0;
while (rhythmStart < historicalNoteCount - 2 && current.StartTime - current.Previous(rhythmStart).StartTime < historyTimeMaxAdjusted) while (rhythmStart < historicalNoteCount - 2 && current.StartTime - current.Previous(rhythmStart).StartTime < history_time_max)
rhythmStart++; rhythmStart++;
OsuDifficultyHitObject prevObj = (OsuDifficultyHitObject)current.Previous(rhythmStart); OsuDifficultyHitObject prevObj = (OsuDifficultyHitObject)current.Previous(rhythmStart);
@ -103,7 +100,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
{ {
OsuDifficultyHitObject currObj = (OsuDifficultyHitObject)current.Previous(i - 1); OsuDifficultyHitObject currObj = (OsuDifficultyHitObject)current.Previous(i - 1);
double currHistoricalDecay = (historyTimeMaxAdjusted - (current.StartTime - currObj.StartTime)) / historyTimeMaxAdjusted; // scales note 0 to 1 from history to now double currHistoricalDecay = (history_time_max - (current.StartTime - currObj.StartTime)) / history_time_max; // scales note 0 to 1 from history to now
currHistoricalDecay = Math.Min((double)(historicalNoteCount - i) / historicalNoteCount, currHistoricalDecay); // either we're limited by time or limited by object count. currHistoricalDecay = Math.Min((double)(historicalNoteCount - i) / historicalNoteCount, currHistoricalDecay); // either we're limited by time or limited by object count.

View File

@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
{ {
new Aim(mods, true), new Aim(mods, true),
new Aim(mods, false), new Aim(mods, false),
new Speed(mods, clockRate) new Speed(mods)
}; };
if (mods.Any(h => h is OsuModFlashlight)) if (mods.Any(h => h is OsuModFlashlight))

View File

@ -17,7 +17,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public class Speed : OsuStrainSkill public class Speed : OsuStrainSkill
{ {
private double skillMultiplier => 1.375; private double skillMultiplier => 1.375;
private readonly double clockRate;
private double strainDecayBase => 0.3; private double strainDecayBase => 0.3;
private double currentStrain; private double currentStrain;
@ -28,10 +27,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private readonly List<double> objectStrains = new List<double>(); private readonly List<double> objectStrains = new List<double>();
public Speed(Mod[] mods, double clockRate) public Speed(Mod[] mods)
: base(mods) : base(mods)
{ {
this.clockRate = clockRate;
} }
private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000); private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
@ -43,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
currentStrain *= strainDecay(((OsuDifficultyHitObject)current).StrainTime); currentStrain *= strainDecay(((OsuDifficultyHitObject)current).StrainTime);
currentStrain += SpeedEvaluator.EvaluateDifficultyOf(current) * skillMultiplier; currentStrain += SpeedEvaluator.EvaluateDifficultyOf(current) * skillMultiplier;
currentRhythm = RhythmEvaluator.EvaluateDifficultyOf(current, clockRate); currentRhythm = RhythmEvaluator.EvaluateDifficultyOf(current);
double totalStrain = currentStrain * currentRhythm; double totalStrain = currentStrain * currentRhythm;