Improve demo delag interpolation and sampling#101
Merged
alcachofass merged 1 commit intoJul 21, 2026
Conversation
Replace clamped endpoint handling with continuous interpolation and add robust pose sampling for demo delag. - Removed demoDelagDisplayServerTime. - entityPoseFromBracket: always evaluate both endpoint trajectories at their snapshot times, clamp frac to [0,1], and lerp positions/angles so frac==0/1 remain continuous with the open interval; choose solid based on frac. - Added demoDelagSamplePoseAtTime: prefer live snap↔nextSnap sampling, fall back to history bracket/envelope, and clamp lookups past newest history. - Updated CG_DemoHistory_AdjustPlayerLerpForDemoDelag and CG_DemoHistory_AdjustMissileLerpForDemoDelag to rewind endpoints by ping and interpolate using cg.frameInterpolation, with sensible fallbacks and caching. Result: smoother, continuous motion during demo delag and fewer snapping artifacts.
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.
While watching some demos, I noticed interpolation, although implemented for demo de-lagging, didn't always get applied. Opponents were shown making stepped movements, and not being interpolated between frames as they should be.
The core problem was the interpolation pathways that had been implemented were consistently being invalidated. So I replaced clamped endpoint handling with continuous interpolation and add robust pose sampling for demo delag:
Result: smoother, continuous motion during demo delag and fewer snapping artifacts.