mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 07:32:58 +08:00
Wave of changes
This commit is contained in:
parent
ec543c1c48
commit
d8f18661d3
@ -17,9 +17,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
var currObj = (OsuDifficultyHitObject)current;
|
var currObj = (OsuDifficultyHitObject)current;
|
||||||
double noteDensity = 1.0;
|
double currVelocity = currObj.LazyJumpDistance / currObj.StrainTime;
|
||||||
|
|
||||||
double difficulty = 0.0;
|
double noteDensity = 1.0;
|
||||||
|
|
||||||
// This loop sucks so much lol.
|
// This loop sucks so much lol.
|
||||||
// Will be replaced in conjuction with the "objects with current visible" and the "currently visible objects" lists
|
// Will be replaced in conjuction with the "objects with current visible" and the "currently visible objects" lists
|
||||||
@ -47,18 +47,26 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
|||||||
noteDensity += opacity;
|
noteDensity += opacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
double noteDensityDifficulty = 0;
|
double noteDensityDifficulty = Math.Pow(Math.Max(0, noteDensity - 3), 2.5);
|
||||||
|
|
||||||
|
double hiddenDifficulty = 0;
|
||||||
|
|
||||||
if (hidden)
|
if (hidden)
|
||||||
noteDensityDifficulty = Math.Pow(noteDensity, 2.5) * 1.2;
|
{
|
||||||
|
noteDensityDifficulty *= 3.2;
|
||||||
|
|
||||||
difficulty += noteDensityDifficulty;
|
// Really not sure about this, but without this a lot of normal HD plays become underweight.
|
||||||
|
hiddenDifficulty = 11 * currObj.LazyJumpDistance / currObj.StrainTime;
|
||||||
|
}
|
||||||
|
|
||||||
double preemptDifficulty = 0.0;
|
double preemptDifficulty = 0.0;
|
||||||
if (currObj.preempt < 400)
|
if (currObj.preempt < 400)
|
||||||
preemptDifficulty += Math.Pow(400 - currObj.preempt, 1.5) / 7;
|
preemptDifficulty += Math.Pow(400 - currObj.preempt, 1.5) / 14;
|
||||||
|
|
||||||
difficulty += preemptDifficulty;
|
// Buff rhythm on high AR.
|
||||||
|
preemptDifficulty *= RhythmEvaluator.EvaluateDifficultyOf(current, 30);
|
||||||
|
|
||||||
|
double difficulty = Math.Max(preemptDifficulty, hiddenDifficulty) + noteDensityDifficulty;
|
||||||
|
|
||||||
return difficulty;
|
return difficulty;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
||||||
@ -16,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|||||||
{
|
{
|
||||||
private readonly List<double> difficulties = new List<double>();
|
private readonly List<double> difficulties = new List<double>();
|
||||||
private readonly bool hasHiddenMod;
|
private readonly bool hasHiddenMod;
|
||||||
private const double skill_multiplier = 17000;
|
private const double skill_multiplier = 2.4;
|
||||||
|
|
||||||
public Cognition(Mod[] mods)
|
public Cognition(Mod[] mods)
|
||||||
: base(mods)
|
: base(mods)
|
||||||
@ -30,12 +29,20 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|||||||
{
|
{
|
||||||
double difficulty = 0;
|
double difficulty = 0;
|
||||||
|
|
||||||
for (int i = 0; i < difficulties.Count; i++)
|
// Sections with 0 difficulty are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
|
||||||
difficulty += difficulties[i] * weight(i);
|
// These sections will not contribute to the difficulty.
|
||||||
|
var peaks = difficulties.Where(p => p > 0);
|
||||||
|
|
||||||
return Math.Pow(difficulty, 1.0 / 3.0);
|
List<double> values = peaks.OrderByDescending(d => d).ToList();
|
||||||
|
|
||||||
|
// Difficulty is the weighted sum of the highest strains from every section.
|
||||||
|
// We're sorting from highest to lowest strain.
|
||||||
|
for (int i = 0; i < values.Count; i++)
|
||||||
|
{
|
||||||
|
difficulty += values[i] / (i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double weight(int x) => x / (x + 100.0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user