TAStudio records extra frames at the end during playback
In BizHawk 2.4.2 and the latest dev build, there's a very odd difference between TAStudio's behavior and tradional movie recording.
If you create a new movie in TAStudio, and then export to bk2, it will be a 0 frame movie exported.
If you then advance one frame, and export to bk2, it will be a two frame movie. This shouldn't happen; it should be a one frame movie. For some reason, TAStudio will create two new frames.
(I do not think this occurs in Recording Mode for TAStudio, though I need to test that again, but this should not occur at all.)
This behavior is not intended, because it was a regression introduced in 2.2.2. There is a similar behavior, where TAStudio always has a blank line at the end. For instance, if you click a button on the last line of TAStudio, it will add a single line afterwards. However, this is a distinct behavior, and only adds one frame, not two.
Also comparable, as mentioned above, TAStudio always starts with a single line, which actually translates into a 0-frame movie. And this seems like a sensible behavior to me, since nothing has occurred in the movie.
Ideally, TAStudio would always shows one more input line than the size of the movie's input log. This bug breaks that, and limits the ability to control TAStudio's playback precisely. For instance, this bug is a blocker for TAStudio being able to (conveniently) calculate the cycle count in Game Boy movies. Edit (2024-06-24): Yes, you can seek to the desired "last" frame and truncate, and that could save cycle count if saving cycle count in TAStudio worked, but ideally that wouldn't even be necessary.
I am going to try and address this in the moviesession-cleanup branch.
This bug was introduced between 2.2.1 and 2.2.2. Specifically, it was introduced in e99ea11cf7e18309a05d1c58d38ca13dea808120.
Take a look around the backlog, this sounds hauntingly similar to something else I remember reading recently
For instance, this bug is a blocker for TAStudio being able to calculate the cycle count in Game Boy movies.
The blocker is the fact that TAStudio can't know the count until the frame has been emulated, and the input being send is drawn on the previous frame. Changing which visible frame on the roll it should consider last frame of the bk2 won't be easy, but it may help resolving some confusion, for example if your last button is on frame 100, the final frame count of the movie will be 101, which is the frame when the input actually arrives to the core.
the input being send is drawn on the previous frame.
I'm not sure what you mean by that. "previous frame" is a bit unclear to me in this context. Also, when you say "draw" are you talking about rendering?
I think I have a basic understanding of the problem though, it will probably evolve as I investigate more. I don't think I disagree about how TAStudio should ultimately behave.
If you normally use an emulator with input display on, immediate input that updates even while paused (white font by default) is equivalent to what is shown in tastudio. It's before emulation. If you hold that input and advance a frame, then it will be sent to the core. Having input drawn in tastudio is the same as holding that input prior to frame emulation and then advancing a frame. Frame 0 is before anything has been emulated, so it's a non-existent time.
(Just for posterity, I think this might have been resolved in a0800862b3678cbfeaad1290418a17c2b3e51fea (PR #3782 ), which was a few days after the commit a72b0f7e8c181f3b140ab401238c4f77f08ad0f7 (PR #4023 ) linked above.)