1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 13:42:56 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Difficulty/Evaluators/ReadingEvaluator.cs

44 lines
1.8 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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;
}
}
/// <summary>
/// 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.
/// </summary>
/// <param name="noteObject">The hit object to evaluate.</param>
/// <returns>The reading difficulty value for the given hit object.</returns>
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));
}
}
}