Nightcore beats don't resume playing correctly after pausing
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
https://github.com/user-attachments/assets/b7fcaa25-c8b4-46ca-9419-6892de717593
Version
current master
Logs
n/a
Well if I were to try fix this naively, it would be by essentially reverting https://github.com/ppy/osu/pull/7221/commits/c883c97bab8e81a3bd67db0ef5d4c7110b5d3161...
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.
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.
I'm having a similar issue, but it applies to the start of the beatmap as well.
It's 0 to 20 bars before I actually hear any Nightcore samples, and sometimes they will also stop halfway through (and come back later).
And it's NOT consistent either, even on the same beatmap.