Skip to content

Commit

Permalink
Merge pull request #608 from LumpBloom7/Star-Follow-leniency
Browse files Browse the repository at this point in the history
Avoid punishing players for accurately following the star on slow Slides
  • Loading branch information
LumpBloom7 authored Sep 8, 2024
2 parents 837ebcb + 6be655e commit 19a4995
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
Expand Down Expand Up @@ -198,6 +199,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
break;
}
}

if (!userTriggered)
{
if (!HitObject.HitWindows.CanBeHit(timeOffset))
Expand All @@ -216,12 +218,21 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
return;
}



var result = HitObject.HitWindows.ResultFor(timeOffset);

// If the slide was completed before the early windows, just give an OK result
// Give the player an OK for extremely early completion
// This is also a safegaurd for super late hits beyond the late windows, where the input may have occured prior to the late window being exceeded due to lag.
if (result == HitResult.None)
result = HitResult.Ok;

// Give a perfect result if the star is intersecting with the last node
// This is to preserve the expected invariant that following the star perfectly should guarantee a perfect judgement.
if (timeOffset < 0)
if ((1 - StarProgress) * Slidepath.Path.TotalDistance <= DrawableSlideCheckpointNode.DETECTION_RADIUS)
result = HitResult.Perfect;

ApplyResult(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public partial class DrawableSlideCheckpointNode : DrawableSentakkiHitObject
private SentakkiInputManager sentakkiActionInputManager = null!;
internal SentakkiInputManager SentakkiActionInputManager => sentakkiActionInputManager ??= ((SentakkiInputManager)GetContainingInputManager());

public const float DETECTION_RADIUS = 100;

public DrawableSlideCheckpointNode()
: this(null)
{
Expand All @@ -35,9 +37,9 @@ public DrawableSlideCheckpointNode(SlideCheckpoint.CheckpointNode? node)
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.None;
Size = new Vector2(200);
Size = new Vector2(DETECTION_RADIUS * 2);
CornerExponent = 2f;
CornerRadius = 100;
CornerRadius = DETECTION_RADIUS;
}

protected override void OnApply()
Expand Down

0 comments on commit 19a4995

Please sign in to comment.