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 @@ public override bool Equals(object? obj)
}
}
private const int history_time_max = 5 * 1000; // 5 seconds of calculatingRhythmBonus max.
private const int history_objects_max = 32;
private const int history_time_max = 4 * 1000; // 5 seconds of calculatingRhythmBonus max.
private const int history_objects_max = 24;
private const double rhythm_multiplier = 1.32;
/// <summary>
/// Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current <see cref="OsuDifficultyHitObject"/>.
/// </summary>
public static double EvaluateDifficultyOf(DifficultyHitObject current, double clockRate)
public static double EvaluateDifficultyOf(DifficultyHitObject current)
{
if (current.BaseObject is Spinner)
return 0;
@ -81,18 +81,15 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, double cl
var previousIsland = new Island(deltaDifferenceEpsilon);
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
bool firstDeltaSwitch = false;
int historicalNoteCount = Math.Min(current.Index, historyObjectsMaxAdjusted);
int historicalNoteCount = Math.Min(current.Index, history_objects_max);
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++;
OsuDifficultyHitObject prevObj = (OsuDifficultyHitObject)current.Previous(rhythmStart);
@ -103,7 +100,7 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, double cl
{
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.

View File

@ -134,7 +134,7 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo
{
new Aim(mods, true),
new Aim(mods, false),
new Speed(mods, clockRate)
new Speed(mods)
};
if (mods.Any(h => h is OsuModFlashlight))

View File

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