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

Cleanup before/after frame logic in MovieSession #4023

Closed Morilli closed 2 months ago

Morilli commented 2 months ago

-closes #2292.

This does change some behavior, but hopefully the new structure is more logical and more correct. Calling HandleFrameAfter from HandleFrameBefore definitely didn't feel proper.

This is in preparation for #3989, as this changed logic should be much clearer in what specific changes TAStudio wants: If the current playback is at the end of the movie,

  1. the HandlePlaybackEnd function should not be called and instead the movie should just stay in the mode it was previously in
  2. on frame advance, input should still be recorded, even in playback mode.

The 2. point is the biggest question mark to me still. There is this line MovieController.SetFromSticky(StickySource); which can currently only be hit on the very first frame or when enabling recording mode, advancing to the end of the tas movie, disabling recording mode and then advancing a single frame without entering input in the input roll. If I knew how to get sticky/autohold input I would test it, although I'm assuming the current logic is incorrect if anything.

Could maybe also help with #2622, although that will require additional consideration.

vadosnaprimer commented 2 months ago

Which of the things described in #2292 does it fix?

Morilli commented 2 months ago

Which of the things described in #2292 does it fix?

The part where TAStudio always keeps an extra frame at the end in playback mode. The behavior is now effectively the same as record mode. When pressing frame advance after creating a new tasproj, the movie will have a 1 frame length.

vadosnaprimer commented 2 months ago

Alright yep, I think this fix makes it possible to properly set movie duration on its last frame in tastudio. When we've emulated the last frame of the tasproj, we're in the same state as if we've just recorded a regular movie. Obviously drawing on last frame in the InpuRoll adds one more row which is correct, but having playback cursor on that frame should not have added yet another frame to the movie, because the fact of emulating it does not require any new frames.

vadosnaprimer commented 2 months ago

on frame advance, input should still be recorded, even in playback mode.

I disagree with this if it's not optional.

Morilli commented 2 months ago

on frame advance, input should still be recorded, even in playback mode.

I disagree with this if it's not optional.

This is just how TAStudio has worked the last couple years. The alternative would be to respect the "on movie end" setting completely, but then you'd get a switch to record mode at the end, which may or may not be what people expect when using TAStudio.