Skip to content

fix: new interpolators delaying between stopping and starting #3413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Apr 16, 2025

This fixes the issue where a server authority instance would lag behind when using the new interpolators. This was especially visible when the moving body completely stopped, all state updates were processed, and then shortly later it began to move again there would be a delay between the 1st state update and the rest of the pending state updates.

This also fixes an issue where if the frame rate takes longer than the tick frequency authority instances could invoke the same check for state changes more than once in the same frame. This is not needed since changes to the transform are frame driven and the check should only be performed once per new tick(s).

MTT-12027

Changelog

  • Fixed: Issue where the authority instance of NetworkTransform could check for state updates more than one time in a frame if the frame rate is slower than the tick frequency.
  • Fixed: Issue where the new interpolator types were blocking after the first consumption of a sequence of buffered state updates.

Testing and Documentation

  • Includes the integration test: InterpolationStopAndStartMotionTest.
  • No documentation changes or additions were necessary.

Backport

No backport is needed for this update since it pertains to 2.x only features.

First pass at fixing the issue where a server authority instance would lag behind when using the new interpolators. This was especially visible when the moving body completely stopped, all state updates were processed, and then shortly later it began to move again there would be a delay between the 1st state update and the rest of the pending state updates.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review April 18, 2025 04:25
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner April 18, 2025 04:25
adding changelog entry.
This fixes the issue where an authority NetworkTransform instance could check for any changes to the transform more than once in a single frame if the frame time was greater than the tick frequency.
updating changelog.
Adding the test to validate the fix for an object in motion coming to a rest where the interpolator has detected no additional state updates, reset itself, and then the object starts moving again (for longer than 3-10x the tick frequency) then the time between the first new state update and the second state update should not exceed the given tick frequency if both state updates happened sequentially (tick relative).
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) April 21, 2025 23:28
Adding an internal version of GetPositionInterpolator and GetRotationInterpolator when DEBUG_LINEARBUFFER is not defined for testing purposes.
Wrong #if
@NoelStephensUnity NoelStephensUnity merged commit b3722b1 into develop-2.0.0 Apr 22, 2025
42 checks passed
@NoelStephensUnity NoelStephensUnity deleted the fix/interpolate-server-side-delay-adjustment branch April 22, 2025 14:11
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.

2 participants