veger / TLBE

TLBE - Time Lapse Base Edition
MIT License
9 stars 6 forks source link

Pausing camera does not stop the 'transition time' #43

Closed veger closed 1 year ago

veger commented 1 year ago

Report from point 2 of https://github.com/veger/TLBE/issues/37

When the camera is transitioning/panning/zooming there doesn't seem to be a way to pause it. You can pause the game but not the timelapse. If the timelapse is paused during a transition then it seems to skip taking the screenshots but the camera continues to move, which leads to missed frames. If I could control this via the same play/pause toolbar button that is already in the mod then that would be incredibly useful.

Most probably cause (from https://github.com/veger/TLBE/issues/37#issuecomment-1607132777)

The game ticks will pass when the camera is paused. And while the code calculates the step size using game ticks and start time of transition the step size will/should change because time 'disappeared', the transition should continue (although with the wrong step sizes). An additional issue is that when the transition time is passed, while the camera is paused, unpausing it won't finish the transition to the final location/scale!

veger commented 1 year ago

I reproducced the issue with a test (04ee6d7)

veger commented 1 year ago

A redesign for transitions is (probably) needed to fix this though, see https://github.com/veger/TLBE/issues/37#issuecomment-1607607662 and the followup comment

veger commented 1 year ago

From https://github.com/veger/TLBE/issues/37#issuecomment-1608200212

Now I remember: the idea of trackers is that they track something in-game like a player, buildings, a static area, etc. Camera on the other hand take screenshots or their current position, while using trackers to update (transition) their position.

So a camera is not notified that a tracker points to something new (as a tracker doesn't know if/when it is going to be used, and thus cannot inform camera(s)). Therefore, the camera checks when a tracker lastly noticed a change (and updated their 'position') and start a new transition form there on.

The solution would be to replace lastChange by updateId in the tracker, and let the camera detect the latest change in the tracker using the updateId, start and end position, and keep track of the transition steps/progress.

veger commented 1 year ago

The failing test case is passing now. And experimentation shows that pausing camera (globally or per camera) is not changing the transition or even stopping it anymore

veger commented 1 year ago

Available in the next release