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

Bug Report: Song may restart at the end while missed notes pass by #3142

Open
2 tasks done
NotHyper-474 opened this issue Sep 13, 2024 · 54 comments
Open
2 tasks done
Assignees
Labels
status: needs clarification Requires more info from the contributor. type: major bug Involves a major bug, including crashes, softlocks, or issues blocking progression

Comments

@NotHyper-474
Copy link
Contributor

NotHyper-474 commented Sep 13, 2024

Issue Checklist

  • I have properly named the issue
  • I have checked the issues/discussions pages to see if the issue has been previously reported

What platform are you using?

Itch.io (Web)

If you are playing on a browser, which one are you using?

Firefox

Version

0.5.0

Context (Provide images, videos, etc.)

After a song ends, it might repeat once more. While this is happening "ghost" notes pass by.
Edit: In certain cases it seems like it'll keep repeating from where you last paused and basically getting you stuck unless you don't keep pausing and unpausing.

8mb.video-V09-1X6W5zzk.mp4

Steps to reproduce (or crash logs, errors, etc.)

  • Just play any song until the end. (I was testing this on Freeplay - Pico character, might need more testing.)
    This might not always happen and seems to occur more frequently on web builds when using Unlocked Framerate, but it is not necessarily caused by it.
@NotHyper-474 NotHyper-474 added status: pending triage The bug or PR has not been reviewed yet. type: minor bug Involves a minor bug or issue. labels Sep 13, 2024
@NotHyper-474 NotHyper-474 changed the title Bug Report: Song might restart on end while "ghost" notes appear by Bug Report: Song may restart at the end while "ghost" notes scroll by Sep 13, 2024
@NotHyper-474 NotHyper-474 changed the title Bug Report: Song may restart at the end while "ghost" notes scroll by Bug Report: Song may restart at the end while "ghost" notes pass by Sep 13, 2024
@AbnormalPoof
Copy link
Contributor

I managed to reproduce this bug back in v0.4.1, but I simply thought it was an issue with one of my mods.

@EliteMasterEric EliteMasterEric pinned this issue Sep 13, 2024
@EliteMasterEric
Copy link
Member

Definitely looking for help diagnosing/reproducing this.

@saturn-volv
Copy link

I was encountering the same issue but can only reproduce it on web. I also use firefox.

@NotHyper-474
Copy link
Contributor Author

NotHyper-474 commented Sep 13, 2024

I was encountering the same issue but can only reproduce it on web. I also use firefox.

Yeah I was trying it on the standalone build but couldn't reproduce it. Could be a browser / web version specific issue.

@NotHyper-474
Copy link
Contributor Author

I managed to reproduce this bug back in v0.4.1, but I simply thought it was an issue with one of my mods.

I also had managed to reproduce it in that version while I was testing #2706, but I was on WSL and couldn't replicate it again afterward.

@Hundrec
Copy link
Contributor

Hundrec commented Sep 13, 2024

Encountered this one at the end of Cocoa Erect on itch.io Web.

@NotHyper-474
Copy link
Contributor Author

Encountered this one at the end of Cocoa Erect on itch.io Web.

Were you perchance in Firefox as well?

@Hundrec
Copy link
Contributor

Hundrec commented Sep 13, 2024

I was using Brave when this happened

@KATBOI667
Copy link

Had this exact same thing happen to me on both DadBattle Pico & Blammed Pico

Opera GX, btw

@Denoohay
Copy link

Denoohay commented Sep 13, 2024

Had this issue happen to me in the windows build during my first time playing Pico (Pico Mix).

@Hundrec
Copy link
Contributor

Hundrec commented Sep 13, 2024

Just replicated this bug with Bopeebo (Pico Mix) on itch.io for Brave. The clip begins on the second loop of the song and goes into the third loop (which starts in the middle of the song).

Pico.ghost.loop.bug.mp4

@PlazmaZX
Copy link

I also had this happen to me whilst playing South (Pico Mix) on Newgrounds, also on Firefox. I think the ghost notes are notes you missed the first time round and they're just wrapping round the second time.

@Hundrec
Copy link
Contributor

Hundrec commented Sep 13, 2024

I also had this happen to me whilst playing South (Pico Mix) on Newgrounds, also on Firefox. I think the ghost notes are notes you missed the first time round and they're just wrapping round the second time.

I've observed this "wrapping around" effect as well!

@Pizzawishes
Copy link

Pizzawishes commented Sep 13, 2024

I literally can't complete Philly Nice (Pico Mix) and Blammed (Pico Mix) because of this issue
(I'm on the Newgrounds release)

@Raltyro
Copy link

Raltyro commented Sep 13, 2024

This can be happen in windows build too, just rarely unless framerate are unlocked it somehow increases the chances of it happening

@KoloInDaCrib
Copy link
Contributor

KoloInDaCrib commented Sep 13, 2024

Got this bug as well while playing 2Hot on the itch.io version, as well as while playing on the web version (using Microsoft Edge).

I think this might happen is because Conductor sets the song position to 0.0 if FlxG.sound.music is null, which also restarts the song in PlayState's stepHit() function. Not sure why onComplete doesn't want to work for FlxG.sound.music, but if I find sumthin I'll edit da comment more.

@eXteRadis
Copy link

I experienced the same thing on Chrome

@EliteMasterEric EliteMasterEric self-assigned this Sep 13, 2024
@EliteMasterEric EliteMasterEric added status: cannot reproduce Involves a bug which cannot be reliably reproduced by reviewers. Assistance may be needed. and removed status: pending triage The bug or PR has not been reviewed yet. labels Sep 13, 2024
@NotHyper-474
Copy link
Contributor Author

Apparently it's easier to reproduce this issue if Unlocked Framerate is enabled, and doesn't seem to occur when it's disabled.

@bubl3
Copy link

bubl3 commented Sep 13, 2024

i have found multiple ways to reproduce this looping bug.
1st having unlocked fps usually makes songs loop all the time they rarely dont loop with unlocked fps and i dont know why.
2nd if u restart a song the chances of a song looping increases even with unlocked fps off
3rd it seems happen randomly also? but the 2 things i mentioned above are reproduceable at least for me
(im using Opera GX to play the game and im playing through newgrounds)

@HeroDaGr8
Copy link

This just happened to me moments ago. I was playing South on Hard in Story Mode, and when the song finished it didn't end but the song replayed and ghost notes passed by. I believe those notes might be the notes I missed before the song looped? But my game broke and the sprites became black after finishing the looped song. I'm on Opera Gx playing on Newgrounds btw

@KoloInDaCrib
Copy link
Contributor

KoloInDaCrib commented Oct 4, 2024

Is there a consistent way to replicate this bug?
I feel like this is an issue with the Conductor class since it controls the gameplay aspect (and considering missed ghost notes re-appear on repeat) though I cannot say what to fix since I barely get the issue in the first place.

@AbnormalPoof
Copy link
Contributor

AbnormalPoof commented Oct 8, 2024

This bug happens on desktop as well, but it's a lot more rare!

@amyspark-ng
Copy link
Contributor

For some reason I manage to get this to happen on desktop, and the clear % went beyond 100%... screenshot-2024-10-08-09-09-45 screenshot-2024-10-08-09-09-23 (I never got this again after that.)

how did you get 114% clear

@AbnormalPoof
Copy link
Contributor

how did you get 114% clear

Initially, I thought it was a Funkin' bug, but I simply time traveled on accident, resulting in more notes and in turn raising the clear% beyond 100!

@amyspark-ng
Copy link
Contributor

amyspark-ng commented Oct 10, 2024

how did you get 114% clear

Initially, I thought it was a Funkin' bug, but I simply time traveled on accident, resulting in more notes and in turn raising the clear% beyond 100!

oh i see! that's crazy, also what's that song? looks very fun can i get link :)

@Hundrec
Copy link
Contributor

Hundrec commented Oct 10, 2024

Someone needs to reach 1000% and see if #3631 happens

@AbnormalPoof
Copy link
Contributor

oh i see! that's crazy, also what's that song? looks very fun can i get link :)

The chart itself is made by me, which is not released publicly. You can find the song here though: https://www.youtube.com/watch?v=19y8YTbvri8

@AbnormalPoof
Copy link
Contributor

Someone needs to reach 1000% and see if #3631 happens

On it

@Hundrec
Copy link
Contributor

Hundrec commented Oct 13, 2024

Just encountered this for the first time in 0.5.2 (itch.io (Downloadable Build) - Windows)
My FPS limit is at 300.

Senpai.Erect.Loop.Bug.mp4

@amyspark-ng
Copy link
Contributor

yeah i found it recently too, it was coincidentally on senpai erect too!!!!

@AbnormalPoof
Copy link
Contributor

AbnormalPoof commented Oct 13, 2024

As a temporary workaround and shitty bandaid fix, here's a module that allows you to end the song immediately by pressing one in case you get stuck:

import funkin.modding.module.Module;
import funkin.play.PlayState;
import flixel.FlxG;

class EndSongKey extends Module {
  public function new() {
    super('EndSong');
  }

  function onUpdate() {
    if (PlayState.instance != null) {
      if (FlxG.keys.justPressed.ONE) PlayState.instance.endSong(true);
    }
  }
}

This already exists as a hotkey in debug builds, but it's really useful in this context since you can't really complete the song without quitting and replaying it.

@amyspark-ng
Copy link
Contributor

since the bug exists i've encountered only twice, is it very common for others?

@Hundrec
Copy link
Contributor

Hundrec commented Oct 13, 2024

My guess is that people's FPS settings determine how commonly they encounter this bug

@NotHyper-474
Copy link
Contributor Author

My guess is that people's FPS settings determine how commonly they encounter this bug

Considering that enabling Unlocked FPS on web made the issue more common for me, that might not be incorrect.

@Hundrec
Copy link
Contributor

Hundrec commented Oct 13, 2024

Just encountered this on two different devices at once, both playing Senpai Erect at 300 FPS. Maybe this just happens a lot on this song now?

Edit: This bug now occurs every time I play Senpai Erect

@PolygonGitHub
Copy link

Still encountering this bug even on 0.5.2. On Linux build, but the FPS was kept at 60. I've encountered this bug before on Web build as well before 0.5.x.

@JackXson-Real
Copy link

Still exists in 0.5.3.

@NotHyper-474
Copy link
Contributor Author

I feel like this is an issue with the Conductor class since it controls the gameplay aspect (and considering missed ghost notes re-appear on repeat) though I cannot say what to fix since I barely get the issue in the first place.

You might be onto something, I've noticed that everytime it repeats/rewinds a voice resync is triggered, and it'll always rewind to a specific position.

I had added a trace to track the Conductor.songPosition on every beat and for some reason it would always reset to that specific position when the song ended and cause the vocal resync (which also resyncs the music time). I still need to do some additional testing to see if the same thing happens in the cases where the bug doesn't happen.

@KoloInDaCrib
Copy link
Contributor

KoloInDaCrib commented Oct 25, 2024

You might be onto something, I've noticed that everytime it repeats/rewinds a voice resync is triggered, and it'll always rewind to a specific position.

Interesting point actually, this also explains why the bug behaves differently on pause - it resyncs the audio after every unpause
image

I have a potential idea as to how to solve this, and that would include making a variable that signifies the maximum duration of the song (with all the offsets accounted for!) and then checking if either FlxG.sound.music.time or Conductor.songPosition reaches that point (preferably check whichever one finishes later than the other). That way we could kill off FlxG.sound.music.onComplete because it doesnt account for offsets and it may be the culprit of this. Those dastardly offsets are at it again,,,,,

I'll give this idea a test a bit later currently dealing with sum chart editor bugs that I'd like to fix.

Edit: nope this doesn't seem to work so far hmm....gonna keep on tryin sum things. At least I can consistently reproduce this bug on Senpai Erect on Web builds

@AbnormalPoof
Copy link
Contributor

It's always the goddamn offsets...

@Hundrec
Copy link
Contributor

Hundrec commented Oct 25, 2024

I love that fixing the start-of-song desync bug led to all this chaos

@NotHyper-474
Copy link
Contributor Author

NotHyper-474 commented Oct 25, 2024

I have a potential idea as to how to solve this, and that would include making a variable that signifies the maximum duration of the song (with all the offsets accounted for!) and then checking if either FlxG.sound.music.time or Conductor.songPosition reaches that point (preferably check whichever one finishes later than the other).

I think an easy - but not ideal - fix would be to disable vocal resync when the song is close to ending, since on songs where I consistently managed to reproduce the bug would actually end if I disabled the vocal resyncing logic.

Edit: Nvm it doesn't work, the FlxG.sound.music.time itself is being rewinded even before the resync, so it might actually be an issue with Flixel

@NotHyper-474
Copy link
Contributor Author

Upon further investigation, I began to realize that all the songs in which I was able to consistently reproduce this issue have vocals that are longer than the instrumental, those being Spookez, Dadbattle (Pico Mix) and Senpai Erect.

To confirm if this was the case I changed the BF vocals for Fresh Erect to be a bit more long than the instrumental and it caused the glitch in that song as well. Likewise, editing the other songs' files so they all have the same length solved the issue on them. Still, this issue only occurred with Unlocked Framerate on.
This hole just seems to go deeper...

@Hundrec
Copy link
Contributor

Hundrec commented Oct 26, 2024

Excellent detective work, Hyper!

@AbnormalPoof
Copy link
Contributor

AbnormalPoof commented Oct 26, 2024

Upon further investigation, I began to realize that all the songs in which I was able to consistently reproduce this issue have vocals that are longer than the instrumental, those being Spookez, Dadbattle (Pico Mix) and Senpai Erect.

To confirm if this was the case I changed the BF vocals for Fresh Erect to be a bit more long than the instrumental and it caused the glitch in that song as well. Likewise, editing the other songs' files so they all have the same length solved the issue on them. Still, this issue only occurred with Unlocked Framerate on. This hole just seems to go deeper...

I feel like the issue is that the game tries to resync the vocals since they go beyond the instrumental time (which is shorter) and eventually hit the threshold for resync (5ms).

@Beelijah
Copy link

woah, 20 participants.

@Beelijah
Copy link

Beelijah commented Nov 18, 2024

pretty sure this happened to me in one of my other videos, ill give the link here:

https://www.youtube.com/watch?v=4jYO3lp3MaI&t=215s

clicking the link should bring you to the bug (3:35)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs clarification Requires more info from the contributor. type: major bug Involves a major bug, including crashes, softlocks, or issues blocking progression
Projects
None yet
Development

No branches or pull requests