// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Difficulty.Utils; using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing; namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators { public static class ReadingEvaluator { private readonly struct VelocityRange { public double Min { get; } public double Max { get; } public double Center => (Max + Min) / 2; public double Range => Max - Min; public VelocityRange(double min, double max) { Min = min; Max = max; } } /// /// Calculates the influence of higher slider velocities on hitobject difficulty. /// The bonus is determined based on the EffectiveBPM, shifting within a defined range /// between the upper and lower boundaries to reflect how increased slider velocity impacts difficulty. /// /// The hit object to evaluate. /// The reading difficulty value for the given hit object. public static double EvaluateDifficultyOf(TaikoDifficultyHitObject noteObject) { double effectiveBPM = noteObject.EffectiveBPM; var highVelocity = new VelocityRange(480, 640); var midVelocity = new VelocityRange(360, 480); return 1.0 * DifficultyCalculationUtils.Logistic(effectiveBPM, highVelocity.Center, 1.0 / (highVelocity.Range / 10)) + 0.5 * DifficultyCalculationUtils.Logistic(effectiveBPM, midVelocity.Center, 1.0 / (midVelocity.Range / 10)); } } }