fix replay speed values being wrong on TAS timescale replays#1274
Closed
akanora wants to merge 1 commit intoshavitush:masterfrom
Closed
fix replay speed values being wrong on TAS timescale replays#1274akanora wants to merge 1 commit intoshavitush:masterfrom
akanora wants to merge 1 commit intoshavitush:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.