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

Nerf repeated angles in Flashlight skill #19716

Merged
merged 11 commits into from
Aug 29, 2022
15 changes: 15 additions & 0 deletions osu.Game.Rulesets.Osu/Difficulty/Evaluators/FlashlightEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ public static class FlashlightEvaluator
private const double min_velocity = 0.5;
private const double slider_multiplier = 1.3;

private const double min_angle_multiplier = 0.2;

/// <summary>
/// Evaluates the difficulty of memorising and hitting an object, based on:
/// <list type="bullet">
/// <item><description>distance between a number of previous objects and the current object,</description></item>
/// <item><description>the visual opacity of the current object,</description></item>
/// <item><description>the angle made by the current object,</description></item>
/// <item><description>length and speed of the current object (for sliders),</description></item>
/// <item><description>and whether the hidden mod is enabled.</description></item>
/// </list>
Expand All @@ -43,6 +46,8 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, bool hidd

OsuDifficultyHitObject lastObj = osuCurrent;

double angleRepeatCount = 0.0;

// This is iterating backwards in time from the current object.
for (int i = 0; i < Math.Min(current.Index, 10); i++)
{
Expand All @@ -66,6 +71,13 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, bool hidd
double opacityBonus = 1.0 + max_opacity_bonus * (1.0 - osuCurrent.OpacityAt(currentHitObject.StartTime, hidden));

result += stackNerf * opacityBonus * scalingFactor * jumpDistance / cumulativeStrainTime;

if (currentObj.Angle != null && osuCurrent.Angle != null)
{
// Objects further back in time should count less for the nerf.
if (Math.Abs(currentObj.Angle.Value - osuCurrent.Angle.Value) < 0.02)
angleRepeatCount += Math.Max(1.0 - 0.1 * i, 0.0);
}
}

lastObj = currentObj;
Expand All @@ -77,6 +89,9 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current, bool hidd
if (hidden)
result *= 1.0 + hidden_bonus;

// Nerf patterns with repeated angles.
result *= min_angle_multiplier + (1.0 - min_angle_multiplier) / (angleRepeatCount + 1.0);

double sliderBonus = 0.0;

if (osuCurrent.BaseObject is Slider osuSlider)
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Flashlight(Mod[] mods)
hasHiddenMod = mods.Any(m => m is OsuModHidden);
}

private double skillMultiplier => 0.05;
private double skillMultiplier => 0.052;
private double strainDecayBase => 0.15;

private double currentStrain;
Expand Down