Skip to content

[Playback] Fixes timing between recording and playback#291

Merged
ScribbleTAS merged 4 commits intoMinecraftTAS:develop-beta3from
ScribbleTAS:fix/timing
Apr 16, 2026
Merged

[Playback] Fixes timing between recording and playback#291
ScribbleTAS merged 4 commits intoMinecraftTAS:develop-beta3from
ScribbleTAS:fix/timing

Conversation

@ScribbleTAS
Copy link
Copy Markdown
Member

@ScribbleTAS ScribbleTAS commented Apr 15, 2026

Up to now, playback was always delayed by one tick compared to the recording,
meaning if you recorded an input on tick 10 it would be pressed on tick 11.

By itself this was not really an issue, however it had a knock on affect when creating savestates, the desync-monitor or RNG,
where the playback had to be artificially delayed to sync everything up...

  • Tick 0 is changed from being always empty and null to be actually used...
  • When starting a playback, tick 0 is now preloaded
  • Added UnitTest for the PlaybackController
  • Adjusted DesyncMonitor to the new timing
  • Fix starting a recording via keybinds not working properly
  • Add tasmod.playback.trace VM option for outputting a file with the current playback container every tick
  • [VirtualInput] Fix issues when an object uses deepcopy on itself
  • Fix tasmod.mixin.json being invalid

The 0th tick in the input list will now contain the state the keyboard was in when the recording was started

- Fix issues when the VirtualPeripherals tried to copy from itself
- Fix mixin.json being invalid
- Add "tasmod.playback.trace" vm variable
- Fix DesyncMonitor being 0 in the first tick
This commit makes it so the recording and playback will line up properly.
Before this, the playback was delayed by one tick.

To achieve this, the playbackNextTick and recordNextTick functions were split into different tick functions.
Before, both methods were called in onClientTickPost, which is fired when the tick ends.

This is correct for recordNextTick, however the playbackNextTick needs to be in a onClientTickPre method.

- Added UnitTests for the PlaybackControllerClient
- Fixed mistake where nextPlaybackKeyboard were used instead of currentPlaybackKeyboard
- Replaced static TASmod Logger with local logger
- Added onClientTickPre Event
@ScribbleTAS ScribbleTAS added this to the Beta3.0 milestone Apr 15, 2026
@ScribbleTAS ScribbleTAS self-assigned this Apr 15, 2026
@ScribbleTAS ScribbleTAS requested a review from PancakeTAS April 15, 2026 20:01
@github-project-automation github-project-automation Bot moved this to Todo in TASmod Apr 15, 2026
@ScribbleTAS ScribbleTAS marked this pull request as draft April 15, 2026 20:09
@ScribbleTAS
Copy link
Copy Markdown
Member Author

ScribbleTAS commented Apr 15, 2026

Nvm need to fix something... The camera is also one tick delayed...

@ScribbleTAS ScribbleTAS marked this pull request as ready for review April 16, 2026 09:18
@ScribbleTAS
Copy link
Copy Markdown
Member Author

Fixed now!

@ScribbleTAS ScribbleTAS merged commit 7aa931d into MinecraftTAS:develop-beta3 Apr 16, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in TASmod Apr 16, 2026
@ScribbleTAS ScribbleTAS deleted the fix/timing branch April 16, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants