From 60dc2c8876a558037ce83c33b6c7fc68c9c08895 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:05:00 +0900 Subject: [PATCH 1/8] Add ducking effect on match found --- osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs index 501a46d4c4..cc2bfa9d06 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs @@ -71,6 +71,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue [Resolved] private IBindable ruleset { get; set; } = null!; + [Resolved] + private MusicController musicController { get; set; } = null!; + private readonly IBindable currentState = new Bindable(); private readonly Bindable availablePools = new Bindable(); @@ -369,6 +372,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue } }; matchFoundSample?.Play(); + musicController.DuckMomentarily(1250); break; case MatchmakingScreenState.AcceptedWaitingForRoom: From 43878f6d33fb84a2f9307a872e343c973aa2aaf1 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:10:52 +0900 Subject: [PATCH 2/8] Add SFX for enqueueing and also a looping 'waiting' SFX when in certain matchmaking states --- .../Matchmaking/Queue/ScreenQueue.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs index cc2bfa9d06..8eaa280794 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs @@ -18,6 +18,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; using osu.Framework.Screens; +using osu.Framework.Threading; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -81,8 +82,13 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue private CancellationTokenSource userLookupCancellation = new CancellationTokenSource(); + private Sample? enqueueSample; + private Sample? waitingLoopSample; private Sample? matchFoundSample; + private SampleChannel? waitingLoopChannel; + private ScheduledDelegate? startLoopPlaybackDelegate; + protected override void LoadComplete() { base.LoadComplete(); @@ -158,6 +164,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue [BackgroundDependencyLoader] private void load(AudioManager audio) { + enqueueSample = audio.Samples.Get(@"Multiplayer/Matchmaking/enqueue"); + waitingLoopSample = audio.Samples.Get(@"Multiplayer/Matchmaking/waiting-loop"); matchFoundSample = audio.Samples.Get(@"Multiplayer/Matchmaking/match-found"); } @@ -250,6 +258,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue mainContent.FadeInFromZero(500, Easing.OutQuint); mainContent.Clear(); + startLoopPlaybackDelegate?.Cancel(); + stopWaitingLoopPlayback(); + switch (newState) { case MatchmakingScreenState.Idle: @@ -337,6 +348,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue sendToBackgroundButton.Enabled.Value = true; sendToBackgroundButton.TooltipText = "You will receive a notification when your game is ready. Make sure to watch out for it!"; }, 5000); + + enqueueSample?.Play(); + startLoopPlaybackDelegate = Scheduler.AddDelayed(startWaitingLoopPlayback, 2000); break; case MatchmakingScreenState.PendingAccept: @@ -398,6 +412,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue }, } }; + + startWaitingLoopPlayback(); break; case MatchmakingScreenState.InRoom: @@ -434,6 +450,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue { base.Dispose(isDisposing); + stopWaitingLoopPlayback(); + if (client.IsNotNull()) client.MatchmakingLobbyStatusChanged -= onMatchmakingLobbyStatusChanged; } @@ -447,6 +465,24 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue InRoom } + private void startWaitingLoopPlayback() + { + stopWaitingLoopPlayback(); + + waitingLoopChannel = waitingLoopSample?.GetChannel(); + if (waitingLoopChannel == null) + return; + + waitingLoopChannel.Looping = true; + waitingLoopChannel?.Play(); + } + + private void stopWaitingLoopPlayback() + { + waitingLoopChannel?.Stop(); + waitingLoopChannel?.Dispose(); + } + private partial class BeginQueueingButton : SelectionButton { public readonly IBindable SelectedPool = new Bindable(); From 3cb85f743accf2db5208c43f4546147b771f0175 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:16:21 +0900 Subject: [PATCH 3/8] Rework `StageDisplay` SFX --- .../Match/StageDisplay.StageSegment.cs | 16 ++++------------ .../Matchmaking/Match/StageDisplay.StatusText.cs | 7 +++++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StageSegment.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StageSegment.cs index 301cac1437..7e3b7d4468 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StageSegment.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StageSegment.cs @@ -39,8 +39,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match private DateTimeOffset countdownEndTime; private SpriteIcon arrow = null!; - private Sample? countdownTickSample; - private double? lastSamplePlayback; + private Sample? segmentStartedSample; private Container mainContent = null!; @@ -120,7 +119,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match }; Alpha = 0.5f; - countdownTickSample = audio.Samples.Get(@"Multiplayer/countdown-tick"); + segmentStartedSample = audio.Samples.Get(@"Multiplayer/Matchmaking/stage-segment"); } protected override void LoadComplete() @@ -156,15 +155,6 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match } progressBar.Width = (float)Math.Clamp(elapsed.TotalMilliseconds / total.TotalMilliseconds, 0, 1); - - int secondsRemaining = Math.Max(0, (int)Math.Ceiling((total.TotalMilliseconds - elapsed.TotalMilliseconds) / 1000)); - - if (total.TotalMilliseconds - elapsed.TotalMilliseconds <= 3000 - && lastSamplePlayback != secondsRemaining) - { - countdownTickSample?.Play(); - lastSamplePlayback = secondsRemaining; - } } private void onMatchRoomStateChanged(MatchRoomState? state) => Scheduler.Add(() => @@ -213,6 +203,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match arrow.FadeIn(500, Easing.OutQuint); this.FadeIn(200); + + segmentStartedSample?.Play(); }); private void onCountdownStopped(MultiplayerCountdown countdown) => Scheduler.Add(() => diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StatusText.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StatusText.cs index 8d94df11e4..33692ffe03 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StatusText.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.StatusText.cs @@ -65,8 +65,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match if (text.Text == string.Empty || (lastSamplePlayback != null && Time.Current - lastSamplePlayback < OsuGameBase.SAMPLE_DEBOUNCE_TIME)) return; - textChangedSample?.Play(); - lastSamplePlayback = Time.Current; + if (matchmakingState.Stage is MatchmakingStage.WaitingForClientsJoin or MatchmakingStage.WaitingForClientsBeatmapDownload) + { + textChangedSample?.Play(); + lastSamplePlayback = Time.Current; + } LocalisableString textForStatus = getTextForStatus(matchmakingState.Stage); From 27ff2a7d49dcb4d735ee35cc54ef4d045d4a0a15 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:16:45 +0900 Subject: [PATCH 4/8] Add SFX for round transitions --- .../Matchmaking/Match/StageDisplay.cs | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs index e383df71c9..446d01562c 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs @@ -3,6 +3,8 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; @@ -138,8 +140,15 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match private Circle innerCircle = null!; private CircularProgress progress = null!; + private Sample? swishSample; + private Sample? swooshSample; + private Sample? roundUpSample; + private SampleChannel? swishChannel; + private SampleChannel? swooshChannel; + private SampleChannel? roundUpChannel; + [BackgroundDependencyLoader] - private void load(OverlayColourProvider colours) + private void load(OverlayColourProvider colours, AudioManager audio) { Size = new Vector2(76); @@ -210,6 +219,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match Text = $"{round_count}" }, }; + + swishSample = audio.Samples.Get(@"UI/overlay-pop-in"); + swooshSample = audio.Samples.Get(@"UI/overlay-big-pop-out"); + roundUpSample = audio.Samples.Get(@"Multiplayer/Matchmaking/round-up"); + } private int round; @@ -231,9 +245,37 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match .MoveToY(0, 500, Easing.InQuart) .ScaleTo(1, 500, Easing.InQuart); + swishChannel = swishSample?.GetChannel(); + + if (swishChannel != null) + { + swishChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + swishChannel?.Play(); + } + + Scheduler.AddDelayed(() => + { + swooshChannel = swooshSample?.GetChannel(); + + if (swooshChannel != null) { + swooshChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + swooshChannel?.Play(); + } + }, 1250); + Scheduler.AddDelayed(() => { progress.ProgressTo((float)round / round_count, 500, Easing.InOutQuart); + + roundUpChannel = roundUpSample?.GetChannel(); + + if (roundUpChannel != null) + { + roundUpChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + roundUpChannel.Frequency.Value = 1f + round * 0.05f; + roundUpChannel?.Play(); + } + Scheduler.AddDelayed(() => { innerCircle From e24df0b9d03a6bf8c6f0d200fb057c9966a4b5f0 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:17:23 +0900 Subject: [PATCH 5/8] Change 'quick play' button to use the 'daily' sample for now --- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index b123d50a4e..a73fafcffd 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -161,7 +161,7 @@ namespace osu.Game.Screens.Menu { Padding = new MarginPadding { Left = WEDGE_WIDTH } }); - buttonsMulti.Add(new MainMenuButton("quick play", @"button-default-select", FontAwesome.Solid.Bolt, new Color4(94, 63, 186, 255), onMatchmaking, Key.Q)); + buttonsMulti.Add(new MainMenuButton("quick play", @"button-daily-select", FontAwesome.Solid.Bolt, new Color4(94, 63, 186, 255), onMatchmaking, Key.Q)); buttonsMulti.ForEach(b => b.VisibleState = ButtonSystemState.Multi); buttonsEdit.Add(new MainMenuButton(EditorStrings.BeatmapEditor.ToLower(), @"button-default-select", OsuIcon.Beatmap, new Color4(238, 170, 0, 255), (_, _) => OnEditBeatmap?.Invoke(), Key.B, From 4e90a2aee235cd00995d290cb30ad1236cb02ac8 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:56:13 +0900 Subject: [PATCH 6/8] Code style fixes --- .../Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs index 446d01562c..654f527339 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs @@ -223,7 +223,6 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match swishSample = audio.Samples.Get(@"UI/overlay-pop-in"); swooshSample = audio.Samples.Get(@"UI/overlay-big-pop-out"); roundUpSample = audio.Samples.Get(@"Multiplayer/Matchmaking/round-up"); - } private int round; @@ -257,10 +256,10 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match { swooshChannel = swooshSample?.GetChannel(); - if (swooshChannel != null) { - swooshChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; - swooshChannel?.Play(); - } + if (swooshChannel == null) return; + + swooshChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + swooshChannel?.Play(); }, 1250); Scheduler.AddDelayed(() => From 2f6bd6605f45882d59835bf5a28e27ec3252c0e4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 6 Oct 2025 14:49:42 +0900 Subject: [PATCH 7/8] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6457d1cccd..ea0ce9a92c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -36,7 +36,7 @@ - + From bc7e02c30b4444a2e8a6cc2aad1dec01076bbb7d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 6 Oct 2025 18:03:53 +0900 Subject: [PATCH 8/8] Delay round increment sound to match animation better --- .../Matchmaking/Match/StageDisplay.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs index 654f527339..9bb1fe1397 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs @@ -266,17 +266,17 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match { progress.ProgressTo((float)round / round_count, 500, Easing.InOutQuart); - roundUpChannel = roundUpSample?.GetChannel(); - - if (roundUpChannel != null) - { - roundUpChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; - roundUpChannel.Frequency.Value = 1f + round * 0.05f; - roundUpChannel?.Play(); - } - Scheduler.AddDelayed(() => { + roundUpChannel = roundUpSample?.GetChannel(); + + if (roundUpChannel != null) + { + roundUpChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + roundUpChannel.Frequency.Value = 1f + round * 0.05f; + roundUpChannel?.Play(); + } + innerCircle .FadeTo(1, 250, Easing.OutQuint) .Then()