Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightcore beats don't resume playing correctly after pausing #30293

Open
bdach opened this issue Oct 15, 2024 · 2 comments
Open

Nightcore beats don't resume playing correctly after pausing #30293

bdach opened this issue Oct 15, 2024 · 2 comments

Comments

@bdach
Copy link
Collaborator

bdach commented Oct 15, 2024

Type

Game behaviour

Bug description

Reported in https://discord.com/channels/188630481301012481/1097318920991559880/1295680161580056600

With Nightcore mod active, pausing mid-play and unpausing results in nightcore beat samples not being played for some time. They seem to only resume when a "finish" sample is normally supposed to be played (every 16 beats / 4 bars). They also get disabled again for the same number of beats whenever a new timing point is encountered.

Screenshots or videos

2024-10-15.11-34-43.mp4

Version

current master

Logs

n/a

@bdach
Copy link
Collaborator Author

bdach commented Oct 15, 2024

Well if I were to try fix this naively, it would be by essentially reverting c883c97...

diff --git a/osu.Game/Rulesets/Mods/ModNightcore.cs b/osu.Game/Rulesets/Mods/ModNightcore.cs
index bb18940f8c..c55ac952ed 100644
--- a/osu.Game/Rulesets/Mods/ModNightcore.cs
+++ b/osu.Game/Rulesets/Mods/ModNightcore.cs
@@ -116,7 +116,7 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
 
                 if (!firstBeat.HasValue || beatIndex < firstBeat)
                     // decide on a good starting beat index if once has not yet been decided.
-                    firstBeat = beatIndex < 0 ? 0 : (beatIndex / segmentLength + 1) * segmentLength;
+                    firstBeat = beatIndex < 0 ? 0 : (beatIndex / segmentLength) * segmentLength;
 
                 if (beatIndex >= firstBeat)
                     playBeatFor(beatIndex % segmentLength, timingPoint.TimeSignature);

@peppy are you able to provide some insight into that commit? Dec 2019 is already within my range of activity but I don't believe I looked at that original change and there's seemingly not much talk about it on the PR.

@peppy
Copy link
Member

peppy commented Oct 23, 2024

From my recollection, without that commit the beat would start too early at the beginning of the beatmap. Maybe that has been fixed elsewhere if you're not seeing that?

I'll take a look.

@peppy peppy self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants