1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

many HD-related changes

This commit is contained in:
Givikap120 2024-04-18 22:02:24 +03:00
parent 6a4bd648f6
commit 463a6cec1e
4 changed files with 42 additions and 39 deletions

View File

@ -294,15 +294,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
double density = ReadingEvaluator.EvaluateDensityOf(current, false);
// Consider that density matters only starting from 3rd note on the screen
double densityFactor = Math.Max(0, density - 1) / 4;
// This is kinda wrong cuz it returns value bigger than preempt
// double timeSpentInvisible = getDurationSpentInvisible(currObj) / 1000 / currObj.ClockRate;
// The closer timeSpentInvisible is to 0 -> the less difference there are between NM and HD
// So we will reduce base according to this
double invisibilityFactor = logistic(currObj.Preempt / 180 - 3.5);
double densityFactor = Math.Max(0, density - 1) / 5;
double invisibilityFactor = currObj.Preempt / 1000;
double hdDifficulty = invisibilityFactor + densityFactor;
// Scale by inpredictability slightly
@ -310,7 +303,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
return hdDifficulty;
}
private static double logistic(double x) => 1 / (1 + Math.Exp(-x));
}
public static class ReadingHighAREvaluator

View File

@ -25,7 +25,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty
public const double DIFFICULTY_MULTIPLIER = 0.0668;
public const double SUM_POWER = 1.1;
public const double FL_SUM_POWER = 1.5;
public const double AR_SUM_POWER = 1.0;
public override int Version => 20220902;
public OsuDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
@ -42,12 +41,13 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double speedNotes = ((Speed)skills[2]).RelevantNoteCount();
double flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double hiddenFlashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double readingLowARRating = Math.Sqrt(skills[4].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double readingHighARRating = Math.Sqrt(skills[5].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double hiddenRating = Math.Sqrt(skills[6].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double hiddenFlashlightRating = Math.Sqrt(skills[7].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
double hiddenRating = 0;
double flashlightRating = 0;
double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;
@ -68,19 +68,28 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double baseSpeedPerformance = OsuStrainSkill.DifficultyToPerformance(speedRating);
// Cognition
double baseFlashlightPerformance = 0.0;
if (mods.Any(h => h is OsuModFlashlight))
baseFlashlightPerformance = Flashlight.DifficultyToPerformance(flashlightRating);
double baseReadingLowARPerformance = ReadingLowAR.DifficultyToPerformance(readingLowARRating);
double baseReadingHighARPerformance = OsuStrainSkill.DifficultyToPerformance(readingHighARRating); // WARNING, this is purely visual change to reduce SR inflation on high-end
double baseReadingARPerformance = Math.Pow(Math.Pow(baseReadingLowARPerformance, AR_SUM_POWER) + Math.Pow(baseReadingHighARPerformance, AR_SUM_POWER), 1.0 / AR_SUM_POWER);
double baseFlashlightARPerformance = Math.Pow(Math.Pow(baseFlashlightPerformance, FL_SUM_POWER) + Math.Pow(baseReadingARPerformance, FL_SUM_POWER), 1.0 / FL_SUM_POWER);
int flIndex = 6;
double baseReadingHiddenPerformance = 0;
if (mods.Any(h => h is OsuModHidden))
{
hiddenRating = Math.Sqrt(skills[6].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
baseReadingHiddenPerformance = ReadingHidden.DifficultyToPerformance(hiddenRating);
flIndex++;
}
double baseFlashlightPerformance = 0.0;
if (mods.Any(h => h is OsuModFlashlight))
{
flashlightRating = Math.Sqrt(skills[flIndex].DifficultyValue()) * DIFFICULTY_MULTIPLIER;
baseFlashlightPerformance = Flashlight.DifficultyToPerformance(flashlightRating);
}
double baseReadingLowARPerformance = ReadingLowAR.DifficultyToPerformance(readingLowARRating);
double baseReadingHighARPerformance = OsuStrainSkill.DifficultyToPerformance(readingHighARRating);
double baseReadingARPerformance = Math.Pow(Math.Pow(baseReadingLowARPerformance, SUM_POWER) + Math.Pow(baseReadingHighARPerformance, SUM_POWER), 1.0 / SUM_POWER);
double baseFlashlightARPerformance = Math.Pow(Math.Pow(baseFlashlightPerformance, FL_SUM_POWER) + Math.Pow(baseReadingARPerformance, FL_SUM_POWER), 1.0 / FL_SUM_POWER);
double preempt = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;
@ -156,16 +165,16 @@ namespace osu.Game.Rulesets.Osu.Difficulty
new Aim(mods, true),
new Aim(mods, false),
new Speed(mods),
new Flashlight(mods),
new HiddenFlashlight(mods),
new ReadingLowAR(mods),
new ReadingHighAR(mods),
new ReadingHidden(mods),
new HiddenFlashlight(mods),
};
// Why adding flashlight one more time????
//if (mods.Any(h => h is OsuModFlashlight))
// skills.Add(new Flashlight(mods));
if (mods.Any(h => h is OsuModHidden))
skills.Add(new ReadingHidden(mods));
if (mods.Any(h => h is OsuModFlashlight))
skills.Add(new Flashlight(mods));
return skills.ToArray();
}

View File

@ -84,8 +84,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double lowARValue = computeReadingLowARValue(score, osuAttributes);
double highARValue = computeReadingHighARValue(score, osuAttributes);
double arPower = OsuDifficultyCalculator.AR_SUM_POWER;
double readingARValue = Math.Pow(Math.Pow(lowARValue, arPower) + Math.Pow(highARValue, arPower), 1.0 / arPower);
double readingARValue = Math.Pow(Math.Pow(lowARValue, power) + Math.Pow(highARValue, power), 1.0 / power);
double readingHDValue = computeReadingHiddenValue(score, osuAttributes);
@ -348,6 +347,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double rawReading = attributes.HiddenDifficulty;
double hiddenValue = ReadingHidden.DifficultyToPerformance(attributes.HiddenDifficulty);
double lengthBonus = CalculateDefaultLengthBonus(totalHits);
hiddenValue *= lengthBonus;
// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
if (effectiveMissCount > 0)
hiddenValue *= 0.97 * Math.Pow(1 - Math.Pow(effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));
@ -388,12 +390,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty
// Assuming that less than 25 mechanical pp is not worthy for memory
double capPerformance = mechanicalPerformance + flaslightPerformance + 25;
// This thing is kinda unpredictable on cognitionPerformance > capPerformance, because it isn't really a soft min
// But it works well on cognitionPerformance < capPerformance so i will take it
double ratio = capPerformance / cognitionPerformance;
ratio = softmin(ratio, 1, 10);
double ratio = cognitionPerformance / capPerformance;
if (ratio > 50) return capPerformance;
return ratio * cognitionPerformance;
ratio = softmin(ratio * 10, 10, 5) / 10;
return ratio * capPerformance;
}
private static double softmin(double a, double b, double power = Math.E) => a * b / Math.Log(Math.Pow(power, a) + Math.Pow(power, b), power);

View File

@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
public static double DifficultyToPerformance(double difficulty) => Math.Max(
Math.Max(Math.Pow(difficulty, 1) * 13.0, Math.Pow(difficulty, 2) * 13.0),
Math.Max(Math.Pow(difficulty, 3) * 9.0, Math.Pow(difficulty, 4) * 6.0));
Math.Max(Math.Pow(difficulty, 3) * 9.00, Math.Pow(difficulty, 4) * 6.0));
}
public class ReadingHidden : Aim
@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
: base(mods, false)
{
}
protected new double SkillMultiplier => 3.8;
protected new double SkillMultiplier => 7.2;
protected override double StrainValueAt(DifficultyHitObject current)
{
@ -112,7 +112,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
return CurrentStrain;
}
public new static double DifficultyToPerformance(double difficulty) => Math.Pow(difficulty, 1.8) * 28.0;
public new static double DifficultyToPerformance(double difficulty) => Math.Max(
Math.Max(difficulty * 16, Math.Pow(difficulty, 2) * 10), Math.Pow(difficulty, 3) * 4);
}
public class ReadingHighAR : GraphSkill