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 384 forks source link

Is this a rewind bug? #3406

Open ReyVGM opened 2 years ago

ReyVGM commented 2 years ago

I'm using Bizhawk 2.8. Win7 64bit.

My current rewind settings are: Max Buffer size: 9 Rewinds every fixed number of frames: 800

Most of the time when I press the rewind key (usually when I die in a game), instead of jumping back the 800 frames I've set, it just jumps to the point where I died (which was just a split second before I pressed the key). I usually have to button mash the rewind key so it actually jumps back the frames I've set to it and doesn't keep jumping to the spot I died in.

Is it a glitch or is it something that I'm configuring wrong? If it matters, I'm using the Genplus-gx core.

I have noticed that if I pause the emulator and then press the rewind key, it jumps the correct number of frames. I think that maybe when the emulator is not paused and you rewind, it starts counting new frames and when you press the rewind key again instead of jumping the frames it had already recorded, it's taking into account the new frames that started counting when you pressed the rewind key the first time.

Here's a short video I made. The first few second it's me pressing the rewind key at a normal speed, then faster, and finally I button mash it until it really goes back 800 frames.

https://www.youtube.com/watch?v=oY8tObLjIvQ

I don't remember this happening on older Bizhawks when the Rewind config panel looked like this: 2

ReyVGM commented 2 years ago

What is "Needs domain knowledge for triage"? Is it something I need to do?

YoshiRulz commented 2 years ago

No. The rewinder is @nattthebear's brainchild so he'd be able to say whether this is intended. Though he didn't write this feature himself, it was a contribution by @<!---->dacin21.

nattthebear commented 2 years ago

I played around a bit in Genesis with these rewind settings

image

And as best as I can tell, everything worked correctly. It's hard to say though; a rewind interval of 800 frames is so nonsensically broken that I don't know what it's properly supposed to do.

When tapping rewinding when paused, I would go consistently back to the last state, which would be anywhere from 1 to 800 frames away as it would just go to the last thing that was saved. The interval is very inconsistent because the states are so rare: 900 will rewind to 800, and 1500 will rewind to 800. These settings could never be expected to rewind you a consistent 800 frames, as you'd need much more closely spaced intervals than once every 800 frames to guarantee that.

When tapping rewind with the emulator running and not paused, I would consistently go back two states, so anywhere from 800 to 1600 frames. I think this is probably a bug. We have some logic that tries to smoothly rewind you when the emulator is running, given whatever states are available. So for instance, if the core is a 60FPS core and you have states once every 4 frames, it will rewind at 15FPS, showing each state for 66ms before loading the previous one. This logic probably has an off by one error that's mostly unnoticeable for 5FPS-60FPS rewinds, but rears its ugly head in 0.075FPS rewinding.

We shouldn't make any change here, though. The rewinder is designed for smooth live rewinding. Any attempt to get it to do fixed jump rewinding instead is going to be putting a square hole in a round peg. I can see some value in a "jump back N frames" keybind that would quick rewind, and then could be combined with a more reasonable frame interval. But not this.