From e6f1a4067d2e2a079e1099be238eb9d59b34d7ad Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Mon, 12 Feb 2024 19:55:52 +0200 Subject: [PATCH] Change scaling to make high AR woth more on low SR --- .../Evaluators/ReadingHighAREvaluator.cs | 39 ++++++++++--------- .../Difficulty/Skills/ReadingHighAR.cs | 27 ++++++++----- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/Evaluators/ReadingHighAREvaluator.cs b/osu.Game.Rulesets.Osu/Difficulty/Evaluators/ReadingHighAREvaluator.cs index aea7f15ab2..c320b4c118 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Evaluators/ReadingHighAREvaluator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Evaluators/ReadingHighAREvaluator.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators { var currObj = (OsuDifficultyHitObject)current; - double result = highArCurve(currObj.Preempt); + double result = GetDifficulty(currObj.Preempt); if (applyAdjust) { @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators // follow lines make high AR easier, so apply nerf if object isn't new combo inpredictability *= 1 + 0.1 * (800 - currObj.FollowLineTime) / 800; - result *= 0.85 + 1 * inpredictability; + result *= 0.9 + 1 * inpredictability; result *= 1.05 - 0.4 * EvaluateFieryAnglePunishmentOf(current); } @@ -119,29 +119,32 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators return zeroFactor * angleSimilarityFactor * angleSharpnessFactor; } - public static double EvaluateLowDensityBonusOf(DifficultyHitObject current) - { - //var currObj = (OsuDifficultyHitObject)current; - - //// Density = 2 in general means 3 notes on screen (it's not including current note) - //double density = CalculateDenstityOf(currObj); - - //// We are considering density = 1.5 as starting point, 1.0 is noticably uncomfy and 0.5 is severely uncomfy - //double bonus = 1.5 - density; - //if (bonus <= 0) return 0; - - //return Math.Pow(bonus, 2); - return 0; - } - + // High AR curve // https://www.desmos.com/calculator/hbj7swzlth - private static double highArCurve(double preempt) + public static double GetDifficulty(double preempt) { double value = Math.Pow(3, 3 - 0.01 * preempt); // 1 for 300ms, 0.25 for 400ms, 0.0625 for 500ms value = softmin(value, 2, 1.7); // use softmin to achieve full-memory cap, 2 times more than AR11 (300ms) return value; } + // This is very accurate on preempt > 300ms, breaking starting somewhere around 120ms + public static double GetPreempt(double difficulty) + { + double fixCoef = difficulty / GetDifficulty(highArCurveReversed(difficulty)); + return highArCurveReversed(difficulty * fixCoef); + } + + // This is an approximation cuz high AR curve is unsolvable + // https://www.desmos.com/calculator/n9vk18bcyh + private static double highArCurveReversed(double value) + { + double helperValue = value / Math.Pow(1 - Math.Pow(1.7, value - 2), 0.45); + double preempt = -(Math.Log(helperValue, 3) - 3) / 0.01; + + return preempt; + } + // We are using mutiply and divide instead of add and subtract, so values won't be negative // https://www.desmos.com/calculator/fv5xerwpd2 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); diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/ReadingHighAR.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/ReadingHighAR.cs index 114fb2d548..5c070242e4 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Skills/ReadingHighAR.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/ReadingHighAR.cs @@ -29,9 +29,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills private readonly List difficulties = new List(); private int objectsCount = 0; + private double preempt = -1; public override void Process(DifficultyHitObject current) { + if (preempt < 0) preempt = ((OsuDifficultyHitObject)current).Preempt; + aimComponent.Process(current); speedComponent.Process(current); @@ -61,9 +64,16 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills } public override double DifficultyValue() { - Console.WriteLine($"Degree of High AR Complexity = {aimComponent.DifficultyValue() / aimComponentNoAdjust.DifficultyValue():0.##}"); + // Get number how much high AR adjust changed difficulty + double difficultyRatio = aimComponent.DifficultyValue() / aimComponentNoAdjust.DifficultyValue(); - // Simulating summing + // Calculate how much preempt should change to account for high AR adjust + double difficulty = ReadingHighAREvaluator.GetDifficulty(preempt) * difficultyRatio; + double adjustedPreempt = ReadingHighAREvaluator.GetPreempt(difficulty); + + Console.WriteLine($"Degree of High AR Complexity = {difficultyRatio:0.##}, {preempt:0} -> {adjustedPreempt:0}"); + + // Simulating summing to get the most correct value possible double aimValue = Math.Sqrt(aimComponent.DifficultyValue()) * OsuDifficultyCalculator.DIFFICULTY_MULTIPLIER; double speedValue = Math.Sqrt(speedComponent.DifficultyValue()) * OsuDifficultyCalculator.DIFFICULTY_MULTIPLIER; @@ -78,8 +88,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills totalPerformance *= lengthBonus; double adjustedDifficulty = OsuStrainSkill.PerformanceToDifficulty(totalPerformance); + double difficultyValue = Math.Pow(adjustedDifficulty / OsuDifficultyCalculator.DIFFICULTY_MULTIPLIER, 2.0); - return Math.Pow(adjustedDifficulty / OsuDifficultyCalculator.DIFFICULTY_MULTIPLIER, 2.0); + return 75 * Math.Sqrt(difficultyValue * difficulty); + // return difficultyValue; } } @@ -94,7 +106,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills private bool adjustHighAR; private double currentStrain; - private double skillMultiplier => 19; + private double skillMultiplier => 18.5; private double strainDecayBase => 0.15; private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000); @@ -109,14 +121,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills aimDifficulty *= ReadingHighAREvaluator.EvaluateDifficultyOf(current, adjustHighAR); aimDifficulty *= skillMultiplier; - double totalStrain = currentStrain; - currentStrain += aimDifficulty; - totalStrain += aimDifficulty; - // Console.WriteLine($"{current.BaseObject.StartTime},{aimDifficulty:0.#}"); - - return totalStrain; + return currentStrain; } }