Skip to content
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

[3.x] Physics Interpolation - fix client interpolation pump #102184

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Jan 30, 2025

Client interpolation pump is moved AFTER the physics tick, after physics objects have been moved. This is necessary because the current transform is also updated during the pump.

Fixes #102142

Notes

  • This was an oversight for client interpolation that seemed to only cause problems for physics objects, and only in the case where more than one physics tick took place before the frame.
  • The server side pumps can take place before the tick because setting transforms will update the current as they come in, however for the client side interpolation, we have to wait until all changes have been made before setting the current transform.
  • This is one of those bugs that is super obvious in retrospect 😁 . It may also fix some other behaviour on the first frame of get_global_transform_interpolated().
  • I've tested using non-physics and physics objects, and the first frames of following and all looks good, even in the issue conditions (faster tick rate than frame rate).
  • Should be forward ported to 4.x @rburing .

Client interpolation pump is moved AFTER the physics tick, after physics objects have been moved.
This is necessary because the `current` transform is also updated during the pump.
@lawnjelly lawnjelly added bug topic:core topic:3d cherrypick:3.6 Considered for cherry-picking into a future 3.6.x release labels Jan 30, 2025
@lawnjelly lawnjelly added this to the 3.7 milestone Jan 30, 2025
@lawnjelly lawnjelly changed the title Physics Interpolation - fix client interpolation pump [3.x] Physics Interpolation - fix client interpolation pump Jan 30, 2025
@lawnjelly lawnjelly marked this pull request as ready for review January 30, 2025 11:59
@lawnjelly lawnjelly requested a review from a team as a code owner January 30, 2025 11:59
@lawnjelly lawnjelly merged commit a434959 into godotengine:3.x Feb 10, 2025
14 checks passed
@lawnjelly
Copy link
Member Author

Thanks!

@lawnjelly lawnjelly deleted the fti_fix_client_ticking branch February 10, 2025 19:07
@oeleo1
Copy link

oeleo1 commented Feb 14, 2025

Hm, put aside my blind trust on you getting this right, I have a question. Could this be the reason for a 1-frame streaking we see occasionally for non-physics objects after their addition to the scene tree, with a set_position() or some other transform, followed invariably by a reset_physics_interpolation()?
It is one of those rarely observed glitches which prevent us from getting to the bottom of it with a MRP, but if the order/rate of physics vs. idle frame ticks is involved in the transform update, I’ll take your opinion either way 😊. Thanks.

@lawnjelly
Copy link
Member Author

@oeleo1 likely not as this PR is for client interpolation (I.e. get global transform interpolated).

Feel free to create an issue, and I will check next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:3.6 Considered for cherry-picking into a future 3.6.x release topic:core topic:3d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants