1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 06:22:56 +08:00

add estimated sliderbreaks to performance attributes

This commit is contained in:
TextAdventurer12 2025-01-17 14:50:19 +13:00
parent ceda902ee6
commit 6ac1067553
2 changed files with 21 additions and 4 deletions

View File

@ -27,6 +27,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty
[JsonProperty("speed_deviation")]
public double? SpeedDeviation { get; set; }
[JsonProperty("estimated_aim_sliderbreaks")]
public double EstimatedAimSliderbreaks { get; set; }
[JsonProperty("estimated_speed_sliderbreaks")]
public double EstimatedSpeedSliderbreaks { get; set; }
public override IEnumerable<PerformanceDisplayAttribute> GetAttributesForDisplay()
{
foreach (var attribute in base.GetAttributesForDisplay())

View File

@ -42,6 +42,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty
/// </summary>
private double effectiveMissCount;
/// <summary>
/// estimated number of sliderbreaks from aim difficulty
/// </summary>
private double estimatedAimSliderbreaks;
/// <summary>
/// estimated number of sliderbreaks from speed difficulty
/// </summary>
private double estimatedSpeedSliderbreaks;
private double? speedDeviation;
public OsuPerformanceCalculator()
@ -93,6 +102,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty
effectiveMissCount = Math.Max(countMiss, effectiveMissCount);
effectiveMissCount = Math.Min(totalHits, effectiveMissCount);
estimatedAimSliderbreaks = calculateEstimatedSliderbreaks(osuAttributes.AimTopWeightedSliderFactor, osuAttributes);
estimatedSpeedSliderbreaks = calculateEstimatedSliderbreaks(osuAttributes.SpeedTopWeightedSliderFactor, osuAttributes);
double multiplier = PERFORMANCE_BASE_MULTIPLIER;
@ -137,6 +148,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty
Flashlight = flashlightValue,
EffectiveMissCount = effectiveMissCount,
SpeedDeviation = speedDeviation,
EstimatedAimSliderbreaks = estimatedAimSliderbreaks,
EstimatedSpeedSliderbreaks = estimatedSpeedSliderbreaks,
Total = totalValue
};
}
@ -177,8 +190,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
if (effectiveMissCount > 0)
{
double estimatedSliderbreaks = calculateEstimatedSliderbreaks(attributes.AimTopWeightedSliderFactor, attributes);
aimValue *= calculateMissPenalty(effectiveMissCount + estimatedSliderbreaks, attributes.AimDifficultStrainCount);
aimValue *= calculateMissPenalty(effectiveMissCount + estimatedAimSliderbreaks, attributes.AimDifficultStrainCount);
}
double approachRateFactor = 0.0;
@ -220,8 +232,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
if (effectiveMissCount > 0)
{
double estimatedSliderbreaks = calculateEstimatedSliderbreaks(attributes.SpeedTopWeightedSliderFactor, attributes);
speedValue *= calculateMissPenalty(effectiveMissCount + estimatedSliderbreaks, attributes.SpeedDifficultStrainCount);
speedValue *= calculateMissPenalty(effectiveMissCount + estimatedSpeedSliderbreaks, attributes.SpeedDifficultStrainCount);
}
double approachRateFactor = 0.0;