diff --git a/osu.Game.Modes.Osu/Objects/Slider.cs b/osu.Game.Modes.Osu/Objects/Slider.cs index 213a4a7bee..38d1dfda5d 100644 --- a/osu.Game.Modes.Osu/Objects/Slider.cs +++ b/osu.Game.Modes.Osu/Objects/Slider.cs @@ -14,6 +14,11 @@ namespace osu.Game.Modes.Osu.Objects { public class Slider : OsuHitObject, IHasCurve { + /// + /// Scoring distance with a speed-adjusted beat length of 1 second. + /// + private const float base_scoring_distance = 100; + public IHasCurve CurveObject { get; set; } public SliderCurve Curve => CurveObject.Curve; @@ -51,13 +56,10 @@ namespace osu.Game.Modes.Osu.Objects { base.ApplyDefaults(timing, difficulty); - ControlPoint overridePoint; - ControlPoint timingPoint = timing.TimingPointAt(StartTime, out overridePoint); - var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1; - var baseVelocity = 100 * difficulty.SliderMultiplier / velocityAdjustment; + double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier / timing.SpeedMultiplierAt(StartTime); - Velocity = baseVelocity / timingPoint.BeatLength; - TickDistance = baseVelocity / difficulty.SliderTickRate; + Velocity = scoringDistance / timing.BeatLengthAt(StartTime); + TickDistance = scoringDistance / difficulty.SliderTickRate; } public IEnumerable Ticks diff --git a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs index 1f9241268b..40277e18fb 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs @@ -13,6 +13,11 @@ namespace osu.Game.Modes.Taiko.Objects { public class DrumRoll : TaikoHitObject, IHasDistance { + /// + /// Drum roll distance that results in a duration of 1 speed-adjusted beat length. + /// + private const float base_distance = 100; + public double EndTime => StartTime + Distance / Velocity; public double Duration => EndTime - StartTime; @@ -59,7 +64,7 @@ namespace osu.Game.Modes.Taiko.Objects { base.ApplyDefaults(timing, difficulty); - Velocity = timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier / 1000; + Velocity = base_distance * difficulty.SliderMultiplier * difficulty.SliderTickRate * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime); TickTimeDistance = timing.BeatLengthAt(StartTime); //TODO: move this to legacy conversion code to allow for direct division without special case. diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index ac47a3bc88..327c0402ab 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -14,6 +14,11 @@ namespace osu.Game.Modes.Taiko.Objects /// public const float CIRCLE_RADIUS = 42f; + /// + /// Time (in milliseconds) to scroll in the hit object with a speed-adjusted beat length of 1 second. + /// + private const double base_scroll_time = 6000; + /// /// The time to scroll in the HitObject. /// @@ -34,7 +39,7 @@ namespace osu.Game.Modes.Taiko.Objects { base.ApplyDefaults(timing, difficulty); - PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; + PreEmpt = base_scroll_time / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / 1000; ControlPoint overridePoint; Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode; diff --git a/osu.Game/Beatmaps/Timing/TimingInfo.cs b/osu.Game/Beatmaps/Timing/TimingInfo.cs index a0a3bd38f0..076618beea 100644 --- a/osu.Game/Beatmaps/Timing/TimingInfo.cs +++ b/osu.Game/Beatmaps/Timing/TimingInfo.cs @@ -76,21 +76,5 @@ namespace osu.Game.Beatmaps.Timing return timingPoint ?? ControlPoint.Default; } - - /// - /// Finds the slider velocity at a time. - /// - /// The time to find the slider velocity at. - /// The slider velocity in milliseconds. - public double SliderVelocityAt(double time) - { - const double base_scoring_distance = 100; - - double beatDistance = BeatDistanceAt(time); - - if (beatDistance > 0) - return base_scoring_distance / beatDistance * 1000; - return base_scoring_distance; - } } } \ No newline at end of file