From 1ca0223c7136b83e6f81a9ab9202e6917a1a506e Mon Sep 17 00:00:00 2001
From: mrowswares <83023433+mrowswares@users.noreply.github.com>
Date: Sun, 29 Aug 2021 17:19:26 +0100
Subject: [PATCH 01/25] remove straintime & speed skill caps, implement basic
doubletap cheese detection
---
.../Difficulty/OsuDifficultyCalculator.cs | 2 +-
.../Preprocessing/OsuDifficultyHitObject.cs | 2 +-
.../Difficulty/Skills/Speed.cs | 20 ++++++++++++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
index e47f82fb39..cfd74a4174 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
@@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[]
{
new Aim(mods),
- new Speed(mods)
+ new Speed(mods, beatmap, clockRate)
};
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
index fa6c5c4d9c..bc97172dbf 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
setDistances();
// Every strain interval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure
- StrainTime = Math.Max(50, DeltaTime);
+ StrainTime = DeltaTime;
}
private void setDistances()
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index f0eb199e5f..7bc16485eb 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
+using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
@@ -26,12 +27,14 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
protected override double DifficultyMultiplier => 1.04;
private const double min_speed_bonus = 75; // ~200BPM
- private const double max_speed_bonus = 45; // ~330BPM
private const double speed_balancing_factor = 40;
+ private double greatWindow;
- public Speed(Mod[] mods)
+ public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
: base(mods)
{
+ greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
+ Console.WriteLine(greatWindow);
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -42,12 +45,23 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
var osuCurrent = (OsuDifficultyHitObject)current;
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
- double deltaTime = Math.Max(max_speed_bonus, current.DeltaTime);
+ double deltaTime = current.DeltaTime;
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
+ // Doubletap detection
+ if (Previous.Count > 0)
+ {
+ var osuPrevious = (OsuDifficultyHitObject)Previous[0];
+ if ( (osuPrevious.DeltaTime / osuCurrent.DeltaTime) >= 3 && osuCurrent.DeltaTime <= (2 * greatWindow))
+ {
+ //Console.WriteLine( osuCurrent.StartTime / 1000.0);
+ return 0;
+ }
+ }
+
double angleBonus = 1.0;
if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
From a190038c33fec8b62784d4c64ae72aef28e15477 Mon Sep 17 00:00:00 2001
From: mrowswares <83023433+mrowswares@users.noreply.github.com>
Date: Sun, 29 Aug 2021 20:16:13 +0100
Subject: [PATCH 02/25] remove writelines
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 --
1 file changed, 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 7bc16485eb..7cc5447888 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -34,7 +34,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
: base(mods)
{
greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
- Console.WriteLine(greatWindow);
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -57,7 +56,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
var osuPrevious = (OsuDifficultyHitObject)Previous[0];
if ( (osuPrevious.DeltaTime / osuCurrent.DeltaTime) >= 3 && osuCurrent.DeltaTime <= (2 * greatWindow))
{
- //Console.WriteLine( osuCurrent.StartTime / 1000.0);
return 0;
}
}
From 711baa12bafc7bfa3186b545b421ee760dbcc653 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Thu, 2 Sep 2021 16:31:31 +0100
Subject: [PATCH 03/25] emu's doubletap cheese nerf
---
.../Difficulty/Skills/Speed.cs | 20 ++++++++-----------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 7cc5447888..8beef524de 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
: base(mods)
{
- greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
+ //greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -46,20 +46,16 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
double deltaTime = current.DeltaTime;
+ // Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
+ if (Previous.Count > 0)
+ {
+ deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
+ }
+
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
- // Doubletap detection
- if (Previous.Count > 0)
- {
- var osuPrevious = (OsuDifficultyHitObject)Previous[0];
- if ( (osuPrevious.DeltaTime / osuCurrent.DeltaTime) >= 3 && osuCurrent.DeltaTime <= (2 * greatWindow))
- {
- return 0;
- }
- }
-
double angleBonus = 1.0;
if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
@@ -76,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
- return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / osuCurrent.StrainTime;
+ return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
}
}
}
From 3e98c71ece670f63e7522a6deaf5740681d548d5 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Thu, 2 Sep 2021 16:48:34 +0100
Subject: [PATCH 04/25] cap deltatime to hitwindow sorta
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 8beef524de..3ce0d050d7 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
: base(mods)
{
- //greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
+ greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -52,6 +52,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
}
+ // Cap deltatime to the OD 300 hitwindow.
+ // 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed
+ var hitWindowNerfRaw = deltaTime / (greatWindow * 2 * 0.77);
+ var hitWindowNerf = Math.Clamp(hitWindowNerfRaw, 0.85, 1);
+
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
@@ -72,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
- return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
+ return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / (deltaTime / hitWindowNerf);
}
}
}
From d9cc497801fb37f45644f058805a05f51626a59b Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Thu, 2 Sep 2021 17:02:23 +0100
Subject: [PATCH 05/25] refactoring
---
.../Difficulty/OsuDifficultyCalculator.cs | 2 +-
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
index cfd74a4174..74ede287b0 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
@@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[]
{
new Aim(mods),
- new Speed(mods, beatmap, clockRate)
+ new Speed(mods, beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, clockRate),
};
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 3ce0d050d7..76803cbdf8 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -30,10 +30,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private const double speed_balancing_factor = 40;
private double greatWindow;
- public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
+ public Speed(Mod[] mods, float od, double clockRate)
: base(mods)
{
- greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
+ greatWindow = (79 - (od * 6) + 0.5) / clockRate;
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -54,8 +54,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// Cap deltatime to the OD 300 hitwindow.
// 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed
- var hitWindowNerfRaw = deltaTime / (greatWindow * 2 * 0.77);
- var hitWindowNerf = Math.Clamp(hitWindowNerfRaw, 0.85, 1);
+ var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.77);
+ deltaTime /= Math.Clamp(hitWindowNerf, 0.92, 1);
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
@@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
- return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / (deltaTime / hitWindowNerf);
+ return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
}
}
}
From 0d60076f3411d03937f9a1b3bcaa170f5ae30730 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Thu, 2 Sep 2021 17:14:23 +0100
Subject: [PATCH 06/25] fix doubletap cheese detect (base on hitwindow)
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 76803cbdf8..6cd32c798d 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double deltaTime = current.DeltaTime;
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- if (Previous.Count > 0)
+ if (Previous.Count > 0 && deltaTime <= greatWindow * 2)
{
deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
}
From 57a2ba9aa80e5432cfe0fcaa31618f85bf97e4ad Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Thu, 2 Sep 2021 18:29:55 +0100
Subject: [PATCH 07/25] remove "straintime"
---
.../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 8 --------
osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs | 6 +++---
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
index bc97172dbf..609ad4c995 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -32,11 +32,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
///
public double? Angle { get; private set; }
- ///
- /// Milliseconds elapsed since the start time of the previous , with a minimum of 50ms.
- ///
- public readonly double StrainTime;
-
private readonly OsuHitObject lastLastObject;
private readonly OsuHitObject lastObject;
@@ -47,9 +42,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
this.lastObject = (OsuHitObject)lastObject;
setDistances();
-
- // Every strain interval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure
- StrainTime = DeltaTime;
}
private void setDistances()
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
index 16a18cbcb9..63daea1ade 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
@@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
Math.Max(osuPrevious.JumpDistance - scale, 0)
* Math.Pow(Math.Sin(osuCurrent.Angle.Value - angle_bonus_begin), 2)
* Math.Max(osuCurrent.JumpDistance - scale, 0));
- result = 1.4 * applyDiminishingExp(Math.Max(0, angleBonus)) / Math.Max(timing_threshold, osuPrevious.StrainTime);
+ result = 1.4 * applyDiminishingExp(Math.Max(0, angleBonus)) / Math.Max(timing_threshold, osuPrevious.DeltaTime);
}
}
@@ -54,8 +54,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double travelDistanceExp = applyDiminishingExp(osuCurrent.TravelDistance);
return Math.Max(
- result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(osuCurrent.StrainTime, timing_threshold),
- (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / osuCurrent.StrainTime
+ result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(osuCurrent.DeltaTime, timing_threshold),
+ (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / osuCurrent.DeltaTime
);
}
From 0beef9c1e7ed296401b347a42811029b593379f0 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Fri, 3 Sep 2021 02:20:22 +0100
Subject: [PATCH 08/25] made double cheese detection stricter
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 6cd32c798d..c4230fc9a4 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double deltaTime = current.DeltaTime;
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- if (Previous.Count > 0 && deltaTime <= greatWindow * 2)
+ if (Previous.Count > 0 && deltaTime <= greatWindow)
{
deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
}
From bf87a4b2d3802cfdd17b04f412fc9c9f9ab98799 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Fri, 3 Sep 2021 02:39:21 +0100
Subject: [PATCH 09/25] interpolate the doubletap cheese nerf instead
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index c4230fc9a4..836e926cf1 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -2,11 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using System;
-using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
+using osu.Framework.Utils;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
@@ -47,9 +47,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double deltaTime = current.DeltaTime;
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- if (Previous.Count > 0 && deltaTime <= greatWindow)
+ double deltaTimeThreshold = greatWindow * 2;
+
+ if (Previous.Count > 0 && deltaTime < deltaTimeThreshold && Previous[0].DeltaTime > deltaTime)
{
- deltaTime = Math.Max(Previous[0].DeltaTime, deltaTime);
+ double closenessToZero = Math.Min(1, deltaTime / deltaTimeThreshold);
+ deltaTime = Interpolation.Lerp(Previous[0].DeltaTime, deltaTime, closenessToZero);
}
// Cap deltatime to the OD 300 hitwindow.
From 8654a0af05798ec1a8db0c8af9e9e737b523c724 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Fri, 3 Sep 2021 03:01:25 +0100
Subject: [PATCH 10/25] remove unnecessary min & renamed variable so its more
descriptive
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 836e926cf1..fb24476493 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -51,8 +51,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
if (Previous.Count > 0 && deltaTime < deltaTimeThreshold && Previous[0].DeltaTime > deltaTime)
{
- double closenessToZero = Math.Min(1, deltaTime / deltaTimeThreshold);
- deltaTime = Interpolation.Lerp(Previous[0].DeltaTime, deltaTime, closenessToZero);
+ double speedWindowRatio = deltaTime / deltaTimeThreshold;
+ deltaTime = Interpolation.Lerp(Previous[0].DeltaTime, deltaTime, speedWindowRatio);
}
// Cap deltatime to the OD 300 hitwindow.
From 3fce3f620f5903f2aee9ee7566273a887d48be62 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Sat, 4 Sep 2021 16:56:15 +0100
Subject: [PATCH 11/25] use OsuHitWindows, amend comment
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index fb24476493..e69f15188d 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -7,6 +7,8 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
using osu.Framework.Utils;
+using osu.Game.Rulesets.Scoring;
+using osu.Game.Rulesets.Osu.Scoring;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
@@ -33,7 +35,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public Speed(Mod[] mods, float od, double clockRate)
: base(mods)
{
- greatWindow = (79 - (od * 6) + 0.5) / clockRate;
+ HitWindows hitWindows = new OsuHitWindows();
+ hitWindows.SetDifficulty(od);
+ greatWindow = (int)(hitWindows.WindowFor(HitResult.Great)) / clockRate;
}
protected override double StrainValueOf(DifficultyHitObject current)
@@ -56,7 +60,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
// Cap deltatime to the OD 300 hitwindow.
- // 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed
+ // 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed harshly
var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.77);
deltaTime /= Math.Clamp(hitWindowNerf, 0.92, 1);
From e9f7258f2b3110d4845699602e6dbdab49713895 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Mon, 13 Sep 2021 14:50:40 +0100
Subject: [PATCH 12/25] adjust hitwindow nerf to be harsher
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index e69f15188d..2640d4ac41 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -60,8 +60,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
// Cap deltatime to the OD 300 hitwindow.
- // 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed harshly
- var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.77);
+ // 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly
+ var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.93);
deltaTime /= Math.Clamp(hitWindowNerf, 0.92, 1);
double speedBonus = 1.0;
From 8796e45f63447ec2de4c89f4d03af0b384ec264a Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Tue, 14 Sep 2021 15:22:03 +0100
Subject: [PATCH 13/25] prevent 2B objects from dividing by zero
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs | 2 +-
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
index 63daea1ade..7467feb009 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
@@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
return Math.Max(
result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(osuCurrent.DeltaTime, timing_threshold),
- (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / osuCurrent.DeltaTime
+ (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / Math.Max(osuCurrent.DeltaTime, 1)
);
}
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 2640d4ac41..39acbf4027 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -84,7 +84,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
- return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
+ return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / Math.Max(deltaTime, 1);
}
}
}
From 6d254fba0ac2001d559f5debb8ca1c953d60c23e Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 10:27:18 +0100
Subject: [PATCH 14/25] digestify speed return
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 39acbf4027..19f9e3f849 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -84,7 +84,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
- return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / Math.Max(deltaTime, 1);
+ return (1 + (speedBonus - 1) * 0.75)
+ * angleBonus
+ * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5))
+ / Math.Max(deltaTime, 1);
}
}
}
From 49658b6f82d097777705f6eaa670bd0fc4339be6 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 10:29:30 +0100
Subject: [PATCH 15/25] set greatWindow to readonly
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 19f9e3f849..93d3227649 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -30,7 +30,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private const double min_speed_bonus = 75; // ~200BPM
private const double speed_balancing_factor = 40;
- private double greatWindow;
+
+ private readonly double greatWindow;
public Speed(Mod[] mods, float od, double clockRate)
: base(mods)
From a0bd73c3562211320410bbd63d157af0143ba377 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 10:52:50 +0100
Subject: [PATCH 16/25] refactor hit window calc
---
.../Difficulty/OsuDifficultyCalculator.cs | 24 ++++++++++++-------
.../Difficulty/Skills/Speed.cs | 6 ++---
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
index 74ede287b0..9107d8234f 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
@@ -21,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
public class OsuDifficultyCalculator : DifficultyCalculator
{
private const double difficulty_multiplier = 0.0675;
+ private double hitWindowGreat;
public OsuDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap)
@@ -36,11 +38,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double speedRating = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
double starRating = aimRating + speedRating + Math.Abs(aimRating - speedRating) / 2;
- HitWindows hitWindows = new OsuHitWindows();
- hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);
-
- // Todo: These int casts are temporary to achieve 1:1 results with osu!stable, and should be removed in the future
- double hitWindowGreat = (int)(hitWindows.WindowFor(HitResult.Great)) / clockRate;
double preempt = (int)BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450) / clockRate;
int maxCombo = beatmap.HitObjects.Count;
@@ -79,11 +76,20 @@ namespace osu.Game.Rulesets.Osu.Difficulty
}
}
- protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[]
+ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
- new Aim(mods),
- new Speed(mods, beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, clockRate),
- };
+ HitWindows hitWindows = new OsuHitWindows();
+ hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty);
+
+ // Todo: These int casts are temporary to achieve 1:1 results with osu!stable, and should be removed in the future
+ hitWindowGreat = (int)(hitWindows.WindowFor(HitResult.Great)) / clockRate;
+
+ return new Skill[]
+ {
+ new Aim(mods),
+ new Speed(mods, hitWindowGreat),
+ };
+ }
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
{
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 93d3227649..8f0034ef79 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -33,12 +33,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private readonly double greatWindow;
- public Speed(Mod[] mods, float od, double clockRate)
+ public Speed(Mod[] mods, double hitWindowGreat)
: base(mods)
{
- HitWindows hitWindows = new OsuHitWindows();
- hitWindows.SetDifficulty(od);
- greatWindow = (int)(hitWindows.WindowFor(HitResult.Great)) / clockRate;
+ greatWindow = hitWindowGreat;
}
protected override double StrainValueOf(DifficultyHitObject current)
From 3a16ec277a8fdac95f890599d4d7db56491fae70 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 11:12:36 +0100
Subject: [PATCH 17/25] refactor speed window ratios
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 8f0034ef79..89e5c39449 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -49,19 +49,19 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
double deltaTime = current.DeltaTime;
- // Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- double deltaTimeThreshold = greatWindow * 2;
+ double greatWindowFull = greatWindow * 2;
+ double speedWindowRatio = deltaTime / greatWindowFull;
- if (Previous.Count > 0 && deltaTime < deltaTimeThreshold && Previous[0].DeltaTime > deltaTime)
+ // Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
+ if (Previous.Count > 0 && deltaTime < greatWindowFull && Previous[0].DeltaTime > deltaTime)
{
- double speedWindowRatio = deltaTime / deltaTimeThreshold;
+
deltaTime = Interpolation.Lerp(Previous[0].DeltaTime, deltaTime, speedWindowRatio);
}
// Cap deltatime to the OD 300 hitwindow.
- // 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly
- var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.93);
- deltaTime /= Math.Clamp(hitWindowNerf, 0.92, 1);
+ // 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
+ deltaTime /= Math.Clamp(speedWindowRatio * (1/0.93), 0.92, 1);
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
From 4017598af0420a71ab769b4dde2b24ecd5adf512 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 11:15:05 +0100
Subject: [PATCH 18/25] simplify algebra down
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 89e5c39449..aefebbe669 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
- deltaTime /= Math.Clamp(speedWindowRatio * (1/0.93), 0.92, 1);
+ deltaTime /= Math.Clamp(speedWindowRatio / 0.93, 0.92, 1);
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
From 7f6722e43fcd4aa19a5e3d65a189959714d64d5c Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 11:24:48 +0100
Subject: [PATCH 19/25] throw math.max(N, 1) into straintime
---
.../Preprocessing/OsuDifficultyHitObject.cs | 8 ++++++++
osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs | 6 +++---
.../Difficulty/Skills/Speed.cs | 17 ++++++++---------
3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
index 609ad4c995..65efe65129 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -16,6 +16,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
protected new OsuHitObject BaseObject => (OsuHitObject)base.BaseObject;
+ ///
+ /// Milliseconds elapsed since the start time of the previous , with a minimum of 1ms to account for simultaneous s.
+ ///
+ public double StrainTime { get; private set; }
+
///
/// Normalized distance from the end position of the previous to the start position of this .
///
@@ -42,6 +47,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
this.lastObject = (OsuHitObject)lastObject;
setDistances();
+
+ // Capped to 1ms to prevent difficulty calculation breaking from simulatenous objects.
+ StrainTime = Math.Max(DeltaTime, 1);
}
private void setDistances()
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
index 7467feb009..16a18cbcb9 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
@@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
Math.Max(osuPrevious.JumpDistance - scale, 0)
* Math.Pow(Math.Sin(osuCurrent.Angle.Value - angle_bonus_begin), 2)
* Math.Max(osuCurrent.JumpDistance - scale, 0));
- result = 1.4 * applyDiminishingExp(Math.Max(0, angleBonus)) / Math.Max(timing_threshold, osuPrevious.DeltaTime);
+ result = 1.4 * applyDiminishingExp(Math.Max(0, angleBonus)) / Math.Max(timing_threshold, osuPrevious.StrainTime);
}
}
@@ -54,8 +54,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double travelDistanceExp = applyDiminishingExp(osuCurrent.TravelDistance);
return Math.Max(
- result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(osuCurrent.DeltaTime, timing_threshold),
- (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / Math.Max(osuCurrent.DeltaTime, 1)
+ result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(osuCurrent.StrainTime, timing_threshold),
+ (Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / osuCurrent.StrainTime
);
}
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index aefebbe669..b2eacc5c6a 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -47,25 +47,24 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
var osuCurrent = (OsuDifficultyHitObject)current;
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
- double deltaTime = current.DeltaTime;
+ double strainTime = osuCurrent.StrainTime;
double greatWindowFull = greatWindow * 2;
- double speedWindowRatio = deltaTime / greatWindowFull;
+ double speedWindowRatio = strainTime / greatWindowFull;
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- if (Previous.Count > 0 && deltaTime < greatWindowFull && Previous[0].DeltaTime > deltaTime)
+ if (Previous.Count > 0 && strainTime < greatWindowFull && (Previous[0] as OsuDifficultyHitObject).StrainTime > strainTime)
{
-
- deltaTime = Interpolation.Lerp(Previous[0].DeltaTime, deltaTime, speedWindowRatio);
+ strainTime = Interpolation.Lerp(Previous[0].DeltaTime, strainTime, speedWindowRatio);
}
// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
- deltaTime /= Math.Clamp(speedWindowRatio / 0.93, 0.92, 1);
+ strainTime /= Math.Clamp(speedWindowRatio / 0.93, 0.92, 1);
double speedBonus = 1.0;
- if (deltaTime < min_speed_bonus)
- speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
+ if (strainTime < min_speed_bonus)
+ speedBonus = 1 + Math.Pow((min_speed_bonus - strainTime) / speed_balancing_factor, 2);
double angleBonus = 1.0;
@@ -86,7 +85,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
return (1 + (speedBonus - 1) * 0.75)
* angleBonus
* (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5))
- / Math.Max(deltaTime, 1);
+ / strainTime;
}
}
}
From 2fe0681310498718bea523b550109743c511a0d9 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 12:03:47 +0100
Subject: [PATCH 20/25] elaborate comment
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index b2eacc5c6a..5b509b9edc 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
// Cap deltatime to the OD 300 hitwindow.
- // 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
+ // 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
strainTime /= Math.Clamp(speedWindowRatio / 0.93, 0.92, 1);
double speedBonus = 1.0;
From cf63a45f32dd10d7be11d959f8667a8b2ba544e4 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 12:36:15 +0100
Subject: [PATCH 21/25] swap speedwindowratio in cap so values are correct
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 5b509b9edc..78c3db96a1 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
- strainTime /= Math.Clamp(speedWindowRatio / 0.93, 0.92, 1);
+ strainTime /= Math.Clamp((strainTime / greatWindowFull) / 0.93, 0.92, 1);
double speedBonus = 1.0;
if (strainTime < min_speed_bonus)
From 463b92fcca42f0aa0e14307f21a7d60e46c7e080 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 12:41:29 +0100
Subject: [PATCH 22/25] remove unused strings
---
osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs | 1 -
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 --
2 files changed, 3 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
index 9107d8234f..743494abac 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 78c3db96a1..a117570e61 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -7,8 +7,6 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
using osu.Framework.Utils;
-using osu.Game.Rulesets.Scoring;
-using osu.Game.Rulesets.Osu.Scoring;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
From 2c3e7bfd2dceddb7d8400c40a3ec5bcad2c436c7 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 15:27:36 +0100
Subject: [PATCH 23/25] moved 2b straintime cap up to 25ms
---
.../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
index 65efe65129..8e8f9bc06e 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
protected new OsuHitObject BaseObject => (OsuHitObject)base.BaseObject;
///
- /// Milliseconds elapsed since the start time of the previous , with a minimum of 1ms to account for simultaneous s.
+ /// Milliseconds elapsed since the start time of the previous , with a minimum of 25ms to account for simultaneous s.
///
public double StrainTime { get; private set; }
@@ -48,8 +48,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
setDistances();
- // Capped to 1ms to prevent difficulty calculation breaking from simulatenous objects.
- StrainTime = Math.Max(DeltaTime, 1);
+ // Capped to 25ms to prevent difficulty calculation breaking from simulatenous objects.
+ StrainTime = Math.Max(DeltaTime, 25);
}
private void setDistances()
From 2637c063a951b675edf4abd3d815e9c9ae33ebf9 Mon Sep 17 00:00:00 2001
From: apollo-dw <83023433+apollo-dw@users.noreply.github.com>
Date: Wed, 15 Sep 2021 15:40:26 +0100
Subject: [PATCH 24/25] forgot a deltatime
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index a117570e61..3cb0e3506b 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
if (Previous.Count > 0 && strainTime < greatWindowFull && (Previous[0] as OsuDifficultyHitObject).StrainTime > strainTime)
{
- strainTime = Interpolation.Lerp(Previous[0].DeltaTime, strainTime, speedWindowRatio);
+ strainTime = Interpolation.Lerp((Previous[0] as OsuDifficultyHitObject).StrainTime, strainTime, speedWindowRatio);
}
// Cap deltatime to the OD 300 hitwindow.
From 7976442aec419492c30fa0b121c3ce9e00c33a9a Mon Sep 17 00:00:00 2001
From: smoogipoo
Date: Thu, 16 Sep 2021 14:20:42 +0900
Subject: [PATCH 25/25] Fix CI issues
---
osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
index 3cb0e3506b..9364b11048 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
@@ -43,6 +43,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
return 0;
var osuCurrent = (OsuDifficultyHitObject)current;
+ var osuPrevious = Previous.Count > 0 ? (OsuDifficultyHitObject)Previous[0] : null;
double distance = Math.Min(single_spacing_threshold, osuCurrent.TravelDistance + osuCurrent.JumpDistance);
double strainTime = osuCurrent.StrainTime;
@@ -51,10 +52,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double speedWindowRatio = strainTime / greatWindowFull;
// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
- if (Previous.Count > 0 && strainTime < greatWindowFull && (Previous[0] as OsuDifficultyHitObject).StrainTime > strainTime)
- {
- strainTime = Interpolation.Lerp((Previous[0] as OsuDifficultyHitObject).StrainTime, strainTime, speedWindowRatio);
- }
+ if (osuPrevious != null && strainTime < greatWindowFull && osuPrevious.StrainTime > strainTime)
+ strainTime = Interpolation.Lerp(osuPrevious.StrainTime, strainTime, speedWindowRatio);
// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
@@ -81,9 +80,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
return (1 + (speedBonus - 1) * 0.75)
- * angleBonus
- * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5))
- / strainTime;
+ * angleBonus
+ * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5))
+ / strainTime;
}
}
}