mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Ignore zero-sections on a per-case basis
This commit is contained in:
parent
a555c47212
commit
637f817696
@ -38,7 +38,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|||||||
double difficulty = 0;
|
double difficulty = 0;
|
||||||
double weight = 1;
|
double weight = 1;
|
||||||
|
|
||||||
List<double> strains = GetCurrentStrainPeaks().OrderByDescending(d => d).ToList();
|
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
|
||||||
|
// These sections will not contribute to the difficulty.
|
||||||
|
var peaks = GetCurrentStrainPeaks().Where(p => p > 0);
|
||||||
|
|
||||||
|
List<double> strains = peaks.OrderByDescending(d => d).ToList();
|
||||||
|
|
||||||
// We are reducing the highest strains first to account for extreme difficulty spikes
|
// We are reducing the highest strains first to account for extreme difficulty spikes
|
||||||
for (int i = 0; i < Math.Min(strains.Count, ReducedSectionCount); i++)
|
for (int i = 0; i < Math.Min(strains.Count, ReducedSectionCount); i++)
|
||||||
|
@ -141,7 +141,13 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
double colourPeak = colourPeaks[i] * colour_skill_multiplier;
|
double colourPeak = colourPeaks[i] * colour_skill_multiplier;
|
||||||
double rhythmPeak = rhythmPeaks[i] * rhythm_skill_multiplier;
|
double rhythmPeak = rhythmPeaks[i] * rhythm_skill_multiplier;
|
||||||
double staminaPeak = (staminaRightPeaks[i] + staminaLeftPeaks[i]) * stamina_skill_multiplier * staminaPenalty;
|
double staminaPeak = (staminaRightPeaks[i] + staminaLeftPeaks[i]) * stamina_skill_multiplier * staminaPenalty;
|
||||||
peaks.Add(norm(2, colourPeak, rhythmPeak, staminaPeak));
|
|
||||||
|
double peak = norm(2, colourPeak, rhythmPeak, staminaPeak);
|
||||||
|
|
||||||
|
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
|
||||||
|
// These sections will not contribute to the difficulty.
|
||||||
|
if (peak > 0)
|
||||||
|
peaks.Add(peak);
|
||||||
}
|
}
|
||||||
|
|
||||||
double difficulty = 0;
|
double difficulty = 0;
|
||||||
|
@ -65,10 +65,6 @@ namespace osu.Game.Rulesets.Difficulty.Skills
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void saveCurrentPeak()
|
private void saveCurrentPeak()
|
||||||
{
|
{
|
||||||
// Ignore sections with 0 strain to avoid edge cases of long maps with a lot of spacing between objects (e.g. /b/2351871).
|
|
||||||
if (currentSectionPeak == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
strainPeaks.Add(currentSectionPeak);
|
strainPeaks.Add(currentSectionPeak);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,9 +100,13 @@ namespace osu.Game.Rulesets.Difficulty.Skills
|
|||||||
double difficulty = 0;
|
double difficulty = 0;
|
||||||
double weight = 1;
|
double weight = 1;
|
||||||
|
|
||||||
|
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
|
||||||
|
// These sections will not contribute to the difficulty.
|
||||||
|
var peaks = GetCurrentStrainPeaks().Where(p => p > 0);
|
||||||
|
|
||||||
// Difficulty is the weighted sum of the highest strains from every section.
|
// Difficulty is the weighted sum of the highest strains from every section.
|
||||||
// We're sorting from highest to lowest strain.
|
// We're sorting from highest to lowest strain.
|
||||||
foreach (double strain in GetCurrentStrainPeaks().OrderByDescending(d => d))
|
foreach (double strain in peaks.OrderByDescending(d => d))
|
||||||
{
|
{
|
||||||
difficulty += strain * weight;
|
difficulty += strain * weight;
|
||||||
weight *= DecayWeight;
|
weight *= DecayWeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user