From a5b4abda887f2f3bf9883dc89e6f87322ff6d1af Mon Sep 17 00:00:00 2001 From: Anthony <59863144+t0nik@users.noreply.github.com> Date: Wed, 29 Jan 2025 03:53:14 +0100 Subject: [PATCH 1/4] Add Fade-In effect to Swell object --- .../Objects/Drawables/DrawableSwell.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 28617b35f68c..6dd70b6d3ee9 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -35,6 +35,15 @@ public partial class DrawableSwell : DrawableTaikoHitObject /// private const double ring_appear_offset = 100; + /// + /// Offset away from the start time of the swell at which the Fade-In effect starts. + /// + private const double fade_in_offset = 1800; + /// + /// Duration of the Fade-In time of the swell. + /// + private const double fade_in_duration = 666; + private Vector2 baseSize; private readonly Container ticks; @@ -248,10 +257,20 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) } } + protected override void UpdateInitialTransforms() + { + // allow for the fade-in effect + Alpha = 0; + } + protected override void UpdateStartTimeStateTransforms() { base.UpdateStartTimeStateTransforms(); + // swell fade-in effect from stable + using (BeginDelayedSequence(-fade_in_offset)) + this.FadeIn(fade_in_duration, Easing.In); + using (BeginDelayedSequence(-ring_appear_offset)) targetRing.ScaleTo(target_ring_scale, 400, Easing.OutQuint); } From c580790699218acb013eee14f35bf9e848d1b2a3 Mon Sep 17 00:00:00 2001 From: Anthony <59863144+t0nik@users.noreply.github.com> Date: Wed, 29 Jan 2025 05:30:05 +0100 Subject: [PATCH 2/4] Increase Fade-In offset to match stable better --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 6dd70b6d3ee9..f0e072b7c8a8 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -38,7 +38,7 @@ public partial class DrawableSwell : DrawableTaikoHitObject /// /// Offset away from the start time of the swell at which the Fade-In effect starts. /// - private const double fade_in_offset = 1800; + private const double fade_in_offset = 1833; /// /// Duration of the Fade-In time of the swell. /// From 2e6c94cb93f9dcccefa9e7802ad5ade20997889e Mon Sep 17 00:00:00 2001 From: Anthony <59863144+t0nik@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:03:30 +0100 Subject: [PATCH 3/4] Add Fade-In effect to DrawableHit --- .../Objects/Drawables/DrawableHit.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 28831a6d2c7b..783b9a909fce 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -6,13 +6,18 @@ using System; using System.Diagnostics; using System.Linq; +using System.Runtime.InteropServices; using JetBrains.Annotations; +using Microsoft.Extensions.Logging; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Input.Events; +using osu.Framework.Logging; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Skinning.Default; +using osu.Game.Rulesets.Taiko.UI; using osu.Game.Skinning; using osuTK; @@ -38,6 +43,21 @@ public TaikoAction? HitAction private double? lastPressHandleTime; + /// + /// Duration of the Fade-In time of the hit. + /// + private const double fade_in_duration = 5000; + + /// + /// Opacity difference of fade-in effect between scroll speeds. + /// + private const double fade_in_curve_factor = 200; + + /// + /// Minimum time between HitObject.StartTime and LifetimeStart. + /// + private const double min_start_time_delta = 90; + private readonly Bindable type = new Bindable(); public DrawableHit() @@ -142,6 +162,21 @@ public override void OnReleased(KeyBindingReleaseEvent e) base.OnReleased(e); } + protected override void UpdateInitialTransforms() + { + double start_time_delta = HitObject.StartTime - LifetimeStart; + // scale Alpha value to adjust to stable's fade-in object opacity when LifetimeStart begins, being the first accessible time point in which changing Alpha is possible + Alpha = (float)(1d - Math.Exp(-(start_time_delta - min_start_time_delta) / fade_in_curve_factor)); + + Logger.Log($"time delta: {HitObject.StartTime - LifetimeStart}, LifetimeStart alpha value: {Alpha}"); + + using (BeginAbsoluteSequence(LifetimeStart)) + { + // makes the fade-in effect negligible on low enough scroll speeds + this.FadeIn(fade_in_duration * (1 - Alpha)); + } + } + protected override void UpdateHitStateTransforms(ArmedState state) { Debug.Assert(HitObject.HitWindows != null); From 7069e6e31bee0feec87884e40833fb52e97c9646 Mon Sep 17 00:00:00 2001 From: Anthony <59863144+t0nik@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:04:26 +0100 Subject: [PATCH 4/4] Remove Log calls --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 783b9a909fce..e1c94176bc74 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -12,7 +12,6 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Input.Events; -using osu.Framework.Logging; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; @@ -168,8 +167,6 @@ protected override void UpdateInitialTransforms() // scale Alpha value to adjust to stable's fade-in object opacity when LifetimeStart begins, being the first accessible time point in which changing Alpha is possible Alpha = (float)(1d - Math.Exp(-(start_time_delta - min_start_time_delta) / fade_in_curve_factor)); - Logger.Log($"time delta: {HitObject.StartTime - LifetimeStart}, LifetimeStart alpha value: {Alpha}"); - using (BeginAbsoluteSequence(LifetimeStart)) { // makes the fade-in effect negligible on low enough scroll speeds