Skip to content

fix replay speed values being wrong on TAS timescale replays#1274

Closed
akanora wants to merge 1 commit intoshavitush:masterfrom
akanora:patch-8
Closed

fix replay speed values being wrong on TAS timescale replays#1274
akanora wants to merge 1 commit intoshavitush:masterfrom
akanora:patch-8

Conversation

@akanora
Copy link
Copy Markdown
Contributor

@akanora akanora commented Mar 29, 2026

In 0x0a, .pos was moved to OnPlayerRunCmdPre alongside .flags and .mt. The problem with this is that Pre fires before physics runs, so the recorded position was always from before the engine moved the player that tick. This caused the replay bot to compute incorrect velocity deltas between frames, showing wrong speed values on TAS replays. The fix moves .pos back to OnPlayerRunCmdPost so it's captured after physics, matching the correct final position for that tick. .flags and .mt remain in Pre as intended by 0x0a.

In 0x0a, .pos was moved to OnPlayerRunCmdPre alongside .flags and .mt. However, since OnPlayerRunCmdPre has no ShouldProcessFrame guard (only OnPlayerRunCmdPost does), on ticks that get skipped by timescale, gA_InProgressFrame.pos would still get overwritten with that skipped tick's position. When the next non-skipped tick's Post finally committed the frame, .pos was from a different tick than .buttons/.vel/.ang, causing the replay bot to compute incorrect velocity deltas between frames and display wrong speed values.

The fix moves .pos back to OnPlayerRunCmdPost so it's always captured on the same tick that gets committed. .flags and .mt remain in OnPlayerRunCmdPre as intended by 0x0a, since those need to be grabbed before physics runs.
@akanora akanora closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant