1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Update with the rebalance changes

This commit is contained in:
smoogipoo 2018-05-16 01:34:07 +09:00
parent 4019683f6c
commit 1fdc77d579

View File

@ -14,6 +14,10 @@ namespace osu.Game.Rulesets.Mania.Difficulty
public class ManiaPerformanceCalculator : PerformanceCalculator
{
private Mod[] mods;
// Score after being scaled by non-difficulty-increasing mods
private double scaledScore;
private int countGeki;
private int countKatu;
private int count300;
@ -29,6 +33,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
{
mods = Score.Mods;
scaledScore = Score.TotalScore;
countGeki = Convert.ToInt32(Score.Statistics[HitResult.Perfect]);
countKatu = Convert.ToInt32(Score.Statistics[HitResult.Ok]);
count300 = Convert.ToInt32(Score.Statistics[HitResult.Great]);
@ -39,8 +44,18 @@ namespace osu.Game.Rulesets.Mania.Difficulty
if (mods.Any(m => !m.Ranked))
return 0;
// Custom multipliers for NoFail
double multiplier = 1.1; // This is being adjusted to keep the final pp value scaled around what it used to be when changing things
IEnumerable<Mod> scoreIncreaseMods = new ManiaRuleset().GetModsFor(ModType.DifficultyIncrease);
double scoreMultiplier = 1.0;
foreach (var m in mods.Where(m => !scoreIncreaseMods.Contains(m)))
scoreMultiplier *= m.ScoreMultiplier;
// Scale score up, so it's comparable to other keymods
scaledScore *= 1.0 / scoreMultiplier;
// Arbitrary initial value for scaling pp in order to standardize distributions across game modes.
// The specific number has no intrinsic meaning and can be adjusted as needed.
double multiplier = 0.8;
if (mods.Any(m => m is ModNoFail))
multiplier *= 0.9;
@ -48,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
multiplier *= 0.5;
double strainValue = computeStrainValue();
double accValue = computeAccuracyValue();
double accValue = computeAccuracyValue(strainValue);
double totalValue =
Math.Pow(
Math.Pow(strainValue, 1.1) +
@ -67,20 +82,8 @@ namespace osu.Game.Rulesets.Mania.Difficulty
private double computeStrainValue()
{
IEnumerable<Mod> scoreIncreaseMods = new ManiaRuleset().GetModsFor(ModType.DifficultyIncrease);
double scoreMultiplier = 1.0;
foreach (var m in mods.Where(m => !scoreIncreaseMods.Contains(m)))
scoreMultiplier *= m.ScoreMultiplier;
// Score after being scaled by non-difficulty-increasing mods
double scaledScore = Score.TotalScore;
// Scale score up, so it's comparable to other keymods
scaledScore *= 1.0 / scoreMultiplier;
// Obtain strain difficulty
double strainValue = Math.Pow(5 * Math.Max(1, Attributes["Strain"] / 0.0825) - 4.0, 3.0) / 110000.0;
double strainValue = Math.Pow(5 * Math.Max(1, Attributes["Strain"] / 0.2) - 4.0, 2.2) / 135.0;
// Longer maps are worth more
strainValue *= 1.0 + 0.1 * Math.Min(1.0, totalHits / 1500.0);
@ -90,18 +93,18 @@ namespace osu.Game.Rulesets.Mania.Difficulty
else if (scaledScore <= 600000)
strainValue *= (scaledScore - 500000) / 100000 * 0.3;
else if (scaledScore <= 700000)
strainValue *= 0.3 + (scaledScore - 600000) / 100000 * 0.35;
strainValue *= 0.3 + (scaledScore - 600000) / 100000 * 0.25;
else if (scaledScore <= 800000)
strainValue *= 0.65 + (scaledScore - 700000) / 100000 * 0.20;
strainValue *= 0.55 + (scaledScore - 700000) / 100000 * 0.20;
else if (scaledScore <= 900000)
strainValue *= 0.85 + (scaledScore - 800000) / 100000 * 0.1;
strainValue *= 0.75 + (scaledScore - 800000) / 100000 * 0.15;
else
strainValue *= 0.95 + (scaledScore - 900000) / 100000 * 0.05;
strainValue *= 0.90 + (scaledScore - 900000) / 100000 * 0.1;
return strainValue;
}
private double computeAccuracyValue()
private double computeAccuracyValue(double strainValue)
{
double hitWindow300 = (Beatmap.HitObjects.First().HitWindows.Great / 2 - 0.5) / TimeRate;
if (hitWindow300 <= 0)
@ -109,10 +112,12 @@ namespace osu.Game.Rulesets.Mania.Difficulty
// Lots of arbitrary values from testing.
// Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
double accuracyValue = Math.Pow(150.0 / hitWindow300 * Math.Pow(Score.Accuracy, 16), 1.8) * 2.5;
double accuracyValue = Math.Max(0.0, 0.2 - (hitWindow300 - 34) * 0.006667)
* strainValue
* Math.Pow(Math.Max(0.0, scaledScore - 960000) / 40000, 1.1);
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer
accuracyValue *= Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3));
// accuracyValue *= Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3));
return accuracyValue;
}