TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.2k stars 385 forks source link

Regular Desyncing issues #2830

Closed LPLibrarian closed 3 years ago

LPLibrarian commented 3 years ago

Hi all, I've been recording longplays for a while now but lately I've been feeling a bit defeated.

4 longplays in a row have had desyncing issues, a lot of them right near the start of the movie - and I foolishly played through until the end a couple times before finding out.

I've tried what I could find online regarding desyncing issues but I'm still facing the same thing. Using one save state, not altering any settings. The only thing I can note is that since updating Bizhawk it's happened on 3/3 games. Previously it happened much less often - a tolerable amount of errors.

I'm pretty close to losing my cool as one of these games was about 20h of gameplay, and I've only myself to blame for not using due diligence. If anyone could please provide some insight or assistance I'd be really grateful! I don't for the life of me know why it's happening, if it's something I'm doing to cause it, or if there's anything I can do to prevent or minimise it's occurrence. Please excuse my naivety on the technical side of these things, I'll try my best to be helpful. Below is the last game it happened on. Thanks all.

Core: Octoshock (PSX) Loaded rom's hash: E68B25C0 Scooby-Doo and the Cyber Chase (USA).cue No open tools or scripts running. Using BizHawk 2.6.2 on a Win10 Home, Intel(R) Core i7-8750H CPU @ 2.20GHz. 16GB RAM, 64bit OS

YoshiRulz commented 3 years ago

I'm afraid we have no idea (see the mentioned issue). Anything else you can add might be helpful, such as whether you were using rewind or savestates.

zeromus commented 3 years ago

PSX is known to be buggy besides whatever else might be going on right now, so rolling back to an older version of bizhawk that's reliable is probably what you want to do

LPLibrarian commented 3 years ago

Thanks for the prompt response - what a bummer! I typically use up to 3 different save states so I have a point to go back to in case I mess something up. I've tried using less and less and it appears to happen even when using just one save state. No use of rewinds.

I'll try rolling back to older versions. As for the bk2 files I have, is there any way to salvage them? Maybe correct inputs where they start to fail?

YoshiRulz commented 3 years ago

You can of course do that with TAStudio, but it would be a long, manual process.

zeromus commented 3 years ago

Yes, it can be done (maybe). You may have to unzip the bk2 and fiddle around with it depending on what versions are involved. of course if you get it to load just replay it til it goes askew and then start recording new input again from there. Or it may go askew in the first frame.

LPLibrarian commented 3 years ago

Thanks guys, I'll have a play around with these ideas as well as rolling back and see how we go.

alyosha-tas commented 3 years ago

If you are going to use older builds, keep in mind that using autofire will cause desyncs in builds back to and including 2.5, so don't use autofire in these builds if you want to maximize your sync chances.

LPLibrarian commented 3 years ago

Great tip, appreciate the heads up!

Zimond47 commented 3 years ago

I might have more info. I had the same problem with PSX and tested a little. It seems to be an issue with increasing the speed during playback. On 100% speed the TAS runs fine but if you increase the speed the framecounter speed doesnt change. So while the game runs at like 180fps for example the framecounter is still running at 60fps.

Edit : This only happens with the "unthrottled" option not with increasing the speed in steps. So : Increase/Decrease Speed accordingly alter the framecounter speed... Toogle throttle does not Edit 2: This is also the case when recording and toggle the throttle. Input recording stays at about 60fps while the game runs 2-3x. @LPLibrarian : Worth a try. If you have not touched the throttle during recording but only for playback maybe some of your files can be used after all by playing them in normal speed?

Zimond47 commented 3 years ago

psxunthrottled Left 2.6.2 Right 2.5.2 Both started almost in the same time and unthrottled.

zeromus commented 3 years ago

are you telling me you have a tas that will run fine at 60fps but if fast-forwarded or unthrottled, it will desync?

Zimond47 commented 3 years ago

Yes. It's not just a desync. The speed of the TAS is not locked to the game speed when you unthrottle the speed in 2.6.2 So when the game runs for approx 180fps in this example only 60fps of inputs are recorded when you record unthrottled.

Same when you play it back and then unthrottle it. The game runs 2-3x the speed of the input playback. See the screenshot, you can reproduce this.

zeromus commented 3 years ago

are you telling me you have a tas you recorded at 180fps, but if played back at 60 fps it will desync?

Zimond47 commented 3 years ago

No, of course not. It was just an example. It's just that when ever you unthrottle the speed (for example rush through a boring scene you still dont want to cut) At this point the TAS is screwed since the input recording is still running at normal speed.

You can easily reproduce this. Open a PSX game. Open the tasstudio. Unthrottle the speed. Let it run for a minute.

The framecounter should be at a multiple of 3600, depending on the speed the core is running on your system. But it's not. It will be 3600 no matter how fast the emulation runs. Same thing happens when you record a TAS normally and then play it back unthrottled. No matter how fast the game runs, the input recording runs at 60fps.

alyosha-tas commented 3 years ago

Woah, that's crazy, nice find Zimond47

nattthebear commented 3 years ago

Cannot reproduce. Opened a PSX game, opened tasstudio, turned off all throttles, started emulation, stopwatched for about one minute, stopped emulation, and frame counter was at 5500.

YoshiRulz commented 3 years ago

"Unthrottled" is a separate menu item and not equivalent to disabling "Clock Throttle" — which were you testing with?

nattthebear commented 3 years ago

I guess I was on "Throttled: None"; why is that a separate thing than "Unthrottled: None"?

LPLibrarian commented 3 years ago

I might have more info. I had the same problem with PSX and tested a little. It seems to be an issue with increasing the speed during playback. On 100% speed the TAS runs fine but if you increase the speed the framecounter speed doesnt change. So while the game runs at like 180fps for example the framecounter is still running at 60fps.

Edit : This only happens with the "unthrottled" option not with increasing the speed in steps. So : Increase/Decrease Speed accordingly alter the framecounter speed... Toogle throttle does not Edit 2: This is also the case when recording and toggle the throttle. Input recording stays at about 60fps while the game runs 2-3x. @LPLibrarian : Worth a try. If you have not touched the throttle during recording but only for playback maybe some of your files can be used after all by playing them in normal speed?

Great work following this up @Zimond47 - I was hopeful as I do typically mess with speeds, however this didn't salvage my files. Hopefully and surely this will help others at the very least!

Zimond47 commented 3 years ago

Just to clarify, I was using the hotkey for "Toggle Throttle". I have that mapped on the gamepad

alyosha-tas commented 3 years ago

Please try dev build as of most recent commit, I might have introduced this problem when fixing the autofire one (definitely a bug either way.)

Zimond47 commented 3 years ago

Can confirm. This fixed it. Test recorded for 3 minutes and played around with the throttle a lot... all fine now. Thank you very much 👍

alyosha-tas commented 3 years ago

Cool, @LPLibrarian please try to record something using your usual workflow in dev. build and see if it syncs.

alyosha-tas commented 3 years ago

Closing as the identified problem is fixed. @LPLibrarian if you still encounter desyncs please open a new issue with fresh info.