Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change doubletap doubles nerf in Speed Evaluator to address for galloping #28611

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 34 additions & 10 deletions osu.Game.Rulesets.Osu/Difficulty/Evaluators/SpeedEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
Expand Down Expand Up @@ -33,18 +34,28 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current)
var osuNextObj = (OsuDifficultyHitObject?)current.Next(0);

double strainTime = osuCurrObj.StrainTime;
double doubletapness = 1;

// Nerf doubletappable doubles.
if (osuNextObj != null)
{
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);
double nextDeltaTime = Math.Max(1, osuNextObj.DeltaTime);
double deltaDifference = Math.Abs(nextDeltaTime - currDeltaTime);
double speedRatio = currDeltaTime / Math.Max(currDeltaTime, deltaDifference);
double windowRatio = Math.Pow(Math.Min(1, currDeltaTime / osuCurrObj.HitWindowGreat), 2);
doubletapness = Math.Pow(speedRatio, 1 - windowRatio);
}
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);

// It's easier to gallop if you have more time between doubles
// Get max between next and prev ratio to avoid nerfing triples
double speedRatio = Math.Max(getSpeedRatio(osuCurrObj, osuPrevObj), getSpeedRatio(osuCurrObj, osuNextObj));

// Can't doubletap if circles don't intersect
double normalizedDistance = Math.Min(1, osuCurrObj.LazyJumpDistance / (OsuDifficultyHitObject.NORMALISED_RADIUS * 2));
double distanceFactor = normalizedDistance < 0.5 ? 1.0 : 1 - Math.Pow((normalizedDistance - 0.5) / 0.5, 0.5);

// Use HitWindowGreat * 2, because even if you can't get 300 with doubletapping - you still can gallop
const double power = 2;
double windowRatio = Math.Pow(Math.Min(1, currDeltaTime / (osuCurrObj.HitWindowGreat * 2)), power);

// Nerf even more if you don't need to gallop anymore
double halfPoint = Math.Pow(0.5, power);
if (windowRatio < halfPoint)
windowRatio *= windowRatio / halfPoint;
Comment on lines +53 to +56
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand what's going on here


double doubletapness = Math.Pow(speedRatio, distanceFactor * (1 - windowRatio));

// 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.
Expand All @@ -61,5 +72,18 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current)

return (speedBonus + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) * doubletapness / strainTime;
}

private static double getSpeedRatio(OsuDifficultyHitObject current, OsuDifficultyHitObject? other)
{
if (other.IsNull())
return 0;

double currDeltaTime = Math.Max(1, current.DeltaTime);
double otherDeltaTime = Math.Max(1, other.DeltaTime);

double deltaDifference = Math.Abs(currDeltaTime - otherDeltaTime);

return currDeltaTime / Math.Max(currDeltaTime, deltaDifference);
}
}
}
Loading