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

Physics interpolation docs #5801

Merged
merged 1 commit into from
May 5, 2022
Merged

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented May 4, 2022

These could be improved loads I'm sure (especially more and better illustrations, so I'd welcome any by anyone else, I'm not very expert at this), and maybe be made more concise, but it should be okay to get started.

Notes

  • Includes a "quick start" guide. This could be removed, but a lot of users get put off reading a lot of text, and it's difficult to explain physics interpolation in a concise way as it is a totally new concept to a lot of people, so this could be a compromise for the attentionally challenged.
  • I separated this onto several pages as it was becoming too large for a single page
  • Removed mention of 2D interpolation, we can add this in 3.6
  • I used some funky csv-table format in using_physics_interpolation.rst, this might need checking we support this (worked fine on mine)

@lawnjelly lawnjelly force-pushed the fti_new branch 2 times, most recently from 40ef0ce to 46c7f6a Compare May 4, 2022 13:56
@lawnjelly lawnjelly changed the title [WIP] Physics interpolation docs Physics interpolation docs May 4, 2022
@lawnjelly lawnjelly marked this pull request as ready for review May 4, 2022 13:59
Ensure that all indirect movement happens during physics ticks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Consider that in Godot, Nodes can be moved not just directly in your own scripts, but also by automatic methods such as tweening, animation, and navigation. All these methods *must also* have their timing set to operate on the physics tick rather than each frame ("idle").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, this can be a problem for animations that change both a transform and a color at the same time. Physics interpolation only affects transforms, not other properties such as modulation or opacity.

See also godotengine/godot#51318 which is what could happen if you use a low physics tick rate and an AnimationPlayer running on the physics tick.

Copy link
Member Author

@lawnjelly lawnjelly May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes absolutely there are a number of cases like this. Ideally almost everything in the engine would have the capability for interpolation. It is also particularly important for sound, to avoid harsh clicking as objects move around (I don't know whether this is dealt with already in the audio with some kind of interpolation).
This is also another plus point for calling it "fixed timestep interpolation" rather than physics interpolation, but I guess that ship has sailed. 😀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now changed this to make this a bit clearer and add the caveat that you point out that they can also be used to animate properties that are not interpolated.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to merge after applying suggestions.

@lawnjelly lawnjelly force-pushed the fti_new branch 3 times, most recently from b344e16 to 4085b0a Compare May 4, 2022 17:16
@mhilbrunner
Copy link
Member

No idea whether the CSV thing will work on RTD too, lets check. :P
Thanks for the great work!

@mhilbrunner mhilbrunner merged commit f90b8bf into godotengine:3.5 May 5, 2022
@lawnjelly lawnjelly deleted the fti_new branch May 19, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants