diff --git a/osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.cs b/osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.cs index c9831aad6d..fc2a153f49 100644 --- a/osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.cs +++ b/osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Tests { protected override string ResourceAssembly => "osu.Game.Rulesets.Catch"; - [TestCase(3.8701854263563118d, "diffcalc-test")] + [TestCase(3.8701758020428221d, "diffcalc-test")] public void Test(double expected, string name) => base.Test(expected, name); diff --git a/osu.Game.Rulesets.Catch/Difficulty/Preprocessing/CatchDifficultyHitObject.cs b/osu.Game.Rulesets.Catch/Difficulty/Preprocessing/CatchDifficultyHitObject.cs index 6d00bb27b5..24e526ed19 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/Preprocessing/CatchDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/Preprocessing/CatchDifficultyHitObject.cs @@ -18,6 +18,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty.Preprocessing public new CatchHitObject LastObject => (CatchHitObject)base.LastObject; public readonly float NormalizedPosition; + public readonly float LastNormalizedPosition; /// /// Milliseconds elapsed since the start time of the previous , with a minimum of 25ms. @@ -31,6 +32,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty.Preprocessing var scalingFactor = normalized_hitobject_radius / halfCatcherWidth; NormalizedPosition = BaseObject.X * CatchPlayfield.BASE_WIDTH * scalingFactor; + LastNormalizedPosition = LastObject.X * CatchPlayfield.BASE_WIDTH * scalingFactor; // Every strain interval is hard capped at the equivalent of 600 BPM streaming speed as a safety measure StrainTime = Math.Max(25, DeltaTime); diff --git a/osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs b/osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs index e06ca08fbe..d146153294 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs @@ -21,20 +21,23 @@ namespace osu.Game.Rulesets.Catch.Difficulty.Skills protected override double DecayWeight => 0.94; - private float lastPlayerPosition; + private float? lastPlayerPosition; private float lastDistanceMoved; protected override double StrainValueOf(DifficultyHitObject current) { var catchCurrent = (CatchDifficultyHitObject)current; + if (lastPlayerPosition == null) + lastPlayerPosition = catchCurrent.LastNormalizedPosition; + float playerPosition = MathHelper.Clamp( - lastPlayerPosition, + lastPlayerPosition.Value, catchCurrent.NormalizedPosition - (normalized_hitobject_radius - absolute_player_positioning_error), catchCurrent.NormalizedPosition + (normalized_hitobject_radius - absolute_player_positioning_error) ); - float distanceMoved = playerPosition - lastPlayerPosition; + float distanceMoved = playerPosition - lastPlayerPosition.Value; double distanceAddition = Math.Pow(Math.Abs(distanceMoved), 1.3) / 500; double sqrtStrain = Math.Sqrt(catchCurrent.StrainTime);