From c9e76783e64630cd1b9d9b08bebe108d41511886 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Sep 2021 17:14:56 +0900 Subject: [PATCH 1/5] Fix taiko HD not calculating pre-empt correctly --- .../Mods/TaikoModHidden.cs | 29 +++++++------------ .../UI/DrawableTaikoRuleset.cs | 10 +++++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs index a6b3fe1cd9..5104fd9cff 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -2,43 +2,41 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; +using osu.Game.Rulesets.Taiko.UI; +using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Taiko.Mods { - public class TaikoModHidden : ModHidden + public class TaikoModHidden : ModHidden, IApplicableToDrawableRuleset { public override string Description => @"Beats fade out before you hit them!"; public override double ScoreMultiplier => 1.06; - private ControlPointInfo controlPointInfo; + private DrawableTaikoRuleset drawableRuleset; + + public void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) + { + this.drawableRuleset = (DrawableTaikoRuleset)drawableRuleset; + } protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) { ApplyNormalVisibilityState(hitObject, state); } - protected double MultiplierAt(double position) - { - double beatLength = controlPointInfo.TimingPointAt(position).BeatLength; - double speedMultiplier = controlPointInfo.DifficultyPointAt(position).SpeedMultiplier; - - return speedMultiplier * TimingControlPoint.DEFAULT_BEAT_LENGTH / beatLength; - } - protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) { switch (hitObject) { case DrawableDrumRollTick _: case DrawableHit _: - double preempt = 10000 / MultiplierAt(hitObject.HitObject.StartTime); + double preempt = drawableRuleset.TimeRange.Value / drawableRuleset.ControlPointAt(hitObject.HitObject.StartTime).Multiplier; double start = hitObject.HitObject.StartTime - preempt * 0.6; double duration = preempt * 0.3; @@ -56,10 +54,5 @@ namespace osu.Game.Rulesets.Taiko.Mods break; } } - - public override void ApplyToBeatmap(IBeatmap beatmap) - { - controlPointInfo = beatmap.ControlPointInfo; - } } } diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs index 6ddbf3c16b..824b95639b 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Bindables; @@ -16,6 +17,7 @@ using osu.Game.Input.Handlers; using osu.Game.Replays; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Scoring; using osu.Game.Skinning; @@ -60,6 +62,14 @@ namespace osu.Game.Rulesets.Taiko.UI scroller.Height = ToLocalSpace(playfieldScreen.TopLeft + new Vector2(0, playfieldScreen.Height / 20)).Y; } + public MultiplierControlPoint ControlPointAt(double time) + { + int result = ControlPoints.BinarySearch(new MultiplierControlPoint(time)); + if (result < 0) + result = Math.Clamp(~result - 1, 0, ControlPoints.Count); + return ControlPoints[result]; + } + public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TaikoPlayfieldAdjustmentContainer(); protected override PassThroughInputManager CreateInputManager() => new TaikoInputManager(Ruleset.RulesetInfo); From ea68be08cb3fa6badd2f5df51f3fc5bc8a1901e8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Sep 2021 17:27:54 +0900 Subject: [PATCH 2/5] Split magic values into named constants --- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs index 5104fd9cff..b3a54521d8 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -18,6 +18,18 @@ namespace osu.Game.Rulesets.Taiko.Mods public override string Description => @"Beats fade out before you hit them!"; public override double ScoreMultiplier => 1.06; + /// + /// How far away from the hit target should hitobjects start to fade out. + /// Range: [0, 1] + /// + private const float fade_out_start_time = 0.6f; + + /// + /// How long hitobjects take to fade out, in terms of the scrolling length. + /// Range: [0, 1] + /// + private const float fade_out_duration = 0.3f; + private DrawableTaikoRuleset drawableRuleset; public void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) @@ -37,8 +49,8 @@ namespace osu.Game.Rulesets.Taiko.Mods case DrawableDrumRollTick _: case DrawableHit _: double preempt = drawableRuleset.TimeRange.Value / drawableRuleset.ControlPointAt(hitObject.HitObject.StartTime).Multiplier; - double start = hitObject.HitObject.StartTime - preempt * 0.6; - double duration = preempt * 0.3; + double start = hitObject.HitObject.StartTime - preempt * fade_out_start_time; + double duration = preempt * fade_out_duration; using (hitObject.BeginAbsoluteSequence(start)) { From 5dd0e0d961dacbd71a27d0e340c71a62a7bd3e35 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Sep 2021 17:33:32 +0900 Subject: [PATCH 3/5] Don't apply normal visibility to increased visibility state --- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs index b3a54521d8..baad65297c 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -39,7 +39,6 @@ namespace osu.Game.Rulesets.Taiko.Mods protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) { - ApplyNormalVisibilityState(hitObject, state); } protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) From a4238e49a70b30a6f3a97f61c7731b29d91b2afb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Sep 2021 17:39:34 +0900 Subject: [PATCH 4/5] Revert "Don't apply normal visibility to increased visibility state" This reverts commit 5dd0e0d961dacbd71a27d0e340c71a62a7bd3e35. --- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs index baad65297c..b3a54521d8 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -39,6 +39,7 @@ namespace osu.Game.Rulesets.Taiko.Mods protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) { + ApplyNormalVisibilityState(hitObject, state); } protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) From 430ecc5409a903a1f871c3097a24c92beb3ff6f0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 21 Sep 2021 15:20:04 +0900 Subject: [PATCH 5/5] Adjust to make HD slightly harder and not obsolete --- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs index b3a54521d8..7f565cb82d 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -22,13 +22,13 @@ namespace osu.Game.Rulesets.Taiko.Mods /// How far away from the hit target should hitobjects start to fade out. /// Range: [0, 1] /// - private const float fade_out_start_time = 0.6f; + private const float fade_out_start_time = 1f; /// /// How long hitobjects take to fade out, in terms of the scrolling length. /// Range: [0, 1] /// - private const float fade_out_duration = 0.3f; + private const float fade_out_duration = 0.375f; private DrawableTaikoRuleset drawableRuleset;