mirror of
https://github.com/ppy/osu.git
synced 2026-05-31 08:29:57 +08:00
3165b147ee
* scale misscount by proportion of difficult sliders * cap sliderbreak count at count100 + count50 * use countMiss instead of effectiveMissCount as the base for sliderbreaks * make code inspector happy + cleanup * refactor to remove unnecesary calculation and need for new tuple * scale sliderbreaks with combo * use aimNoSliders for sliderbreak factor * code cleanup * make inspect code happy * use diffcalcutils * fix errors (oops) * scaling changes * fix div by zeros * Fix compilation error * Add online attributes for new difficulty attributes * Formatting * Rebase fixes * Make `CountTopWeightedSliders` to remove weird protected `SliderStrains` list * Prevent top weighted slider factor from being Infinity --------- Co-authored-by: tsunyoku <tsunyoku@gmail.com>
27 lines
975 B
C#
27 lines
975 B
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 System.Collections.Generic;
|
|
using System.Linq;
|
|
using osu.Game.Rulesets.Difficulty.Utils;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Difficulty.Utils
|
|
{
|
|
public static class OsuStrainUtils
|
|
{
|
|
public static double CountTopWeightedSliders(IReadOnlyCollection<double> sliderStrains, double difficultyValue)
|
|
{
|
|
if (sliderStrains.Count == 0)
|
|
return 0;
|
|
|
|
double consistentTopStrain = difficultyValue / 10; // What would the top strain be if all strain values were identical
|
|
|
|
if (consistentTopStrain == 0)
|
|
return 0;
|
|
|
|
// Use a weighted sum of all strains. Constants are arbitrary and give nice values
|
|
return sliderStrains.Sum(s => DifficultyCalculationUtils.Logistic(s / consistentTopStrain, 0.88, 10, 1.1));
|
|
}
|
|
}
|
|
}
|