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

Add physics interpolation docs to 4.3 #9738

Closed
wants to merge 1 commit into from

Conversation

skyace65
Copy link
Contributor

@skyace65 skyace65 commented Aug 11, 2024

This PR adds the physics interpolation docs from 3.6 to the 4.3 branch. This is mostly a copy and paste with the following changes:

  • The camera example from one page was removed as it was a 3D example.
  • the bottom of the 2D and 3D page was mostly removed. it now just states that interpolation isn't supported for particles.
  • The existing images were converted to webp, and the one picture of the editor was re-done, all images have gone through webp compression.
  • Notes added on each page stating that physics interpolation does not work in 3D
  • Removed info on MultiMesh from the advanced physics interpolation page since those methods don't exist in 4.3
  • Updated the project settings links for physics FPS since the setting was renamed in 4.x
  • Changed a reference for camera (3D camera) to "a node" (line 151 on using physics interpolation)

I'm keeping the 2D and 3D page mostly as is because the 2D information on that page is still useful, it would be time consuming to remove everything 3D related, and it would seem mildly pointless since the 3D information will be relevant again in a future update. Though I'm open to doing more changes if anyone thinks it's necessary.

@skyace65 skyace65 added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Aug 11, 2024
@skyace65 skyace65 added this to the 4.3 milestone Aug 11, 2024
@skyace65 skyace65 force-pushed the Physics-Interpolation branch 7 times, most recently from 2842b21 to 1397166 Compare August 12, 2024 22:38
@skyace65
Copy link
Contributor Author

@rburing Could the 3D camera example in these docs be re-worked for a 2D scene? And if so how heavily would it have to be modified? I'm trying to figure out if it should be altered or just removed.

@rburing
Copy link
Member

rburing commented Aug 12, 2024

@skyace65 I would remove all of it for 4.3 for simplicity.

Also there is no get_global_transform_interpolated or interpolation of 2D particles in 4.3.

We can add back the camera example for 4.4 when 3D physics interpolation is merged.

cc @lawnjelly

@skyace65 skyace65 force-pushed the Physics-Interpolation branch 6 times, most recently from 2dc2bf2 to 8c305dc Compare August 13, 2024 03:04
@skyace65 skyace65 force-pushed the Physics-Interpolation branch from 8c305dc to 7119622 Compare August 13, 2024 03:10
@skyace65 skyace65 marked this pull request as ready for review August 13, 2024 03:17
@skyace65
Copy link
Contributor Author

@rburing it's ready for review now.

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

Will go over again for more details but these were the immediate

Generally 2D and 3D physics interpolation work in very similar ways. However,
there are a few differences, which will be described here.

.. note:: currently only 2D physics interpolation works in Godot.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: currently only 2D physics interpolation works in Godot.
.. note:: Currently only 2D physics interpolation works in Godot.

``physics_interpolation_mode`` ``On``, but the child is set to ``Off``,
the child will still be interpolated if the parent is moving. *Only the
child's local transform is uninterpolated.* Controlling the on / off
behaviour of 2D nodes therefore requires a little more thought and planning.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
behaviour of 2D nodes therefore requires a little more thought and planning.
behavior of 2D nodes therefore requires a little more thought and planning.

For all

games, in some cases you will want to go a stage further to get the best
possible results and the smoothest possible experience.

.. note:: currently only 2D physics interpolation works in Godot.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: currently only 2D physics interpolation works in Godot.
.. note:: Currently only 2D physics interpolation works in Godot.

great for everybody.

However, modern games are often no longer made for fixed hardware. You will
often be planning to release on desktop computers, mobiles and more, all of
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
often be planning to release on desktop computers, mobiles and more, all of
often be planning to release on desktop computers, mobiles, and more. All of

I'd break this long sentence

The simplest way to achieve this is linear interpolation, or lerping, which
you may have used before.

.. note:: currently only 2D physics interpolation works in Godot.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: currently only 2D physics interpolation works in Godot.
.. note:: Currently only 2D physics interpolation works in Godot.

another mechanism to automatically move nodes).
- Be sure to call :ref:`Node.reset_physics_interpolation<class_Node_method_reset_physics_interpolation>`
on nodes *after* you first position or teleport them, to prevent
"streaking"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"streaking"
"streaking".

existing games will work with few changes. That said there are some
situations which require special treatment, and these will be described.

.. note:: currently only 2D physics interpolation works in Godot.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: currently only 2D physics interpolation works in Godot.
.. note:: Currently only 2D physics interpolation works in Godot.


Using physics interpolation
===========================
How do we incorporate physics interpolation into a Godot game? Are there any
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
How do we incorporate physics interpolation into a Godot game? Are there any
How do we incorporate physics interpolation into a Godot game? Are there any

:header: "Low tick rates (10-30)", "Medium tick rates (30-60)", "High tick rates (60+)"
:widths: 20, 20, 20

"Better CPU performance","Good physics behaviour in complex scenes","Good with fast physics"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Better CPU performance","Good physics behaviour in complex scenes","Good with fast physics"
"Better CPU performance","Good physics behavior in complex scenes","Good with fast physics"

For all here too

@rburing
Copy link
Member

rburing commented Aug 14, 2024

I would really remove all details about 3D, since nothing is merged on that front. Minimal docs are fine to start with. I'll be glad to update the docs for 3D when the time comes, but at the moment I'm on vacation.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This has become one of the most popular approaches to dealing with the
problem. It is supported by Godot 3.5 and later in 3D (although it is
Copy link
Member

Choose a reason for hiding this comment

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

Make relevant to 4.x.

@lawnjelly
Copy link
Member

Agree with @rburing on simply removing the details of 3D, especially in the 2D and 3D physics interpolation section. I actually only added that section after adding 2D to emphasize the differences.

So perhaps just titling it 2D physics interpolation for now and only including 2D info would be good.

@tetrapod00
Copy link
Contributor

So, 3D physics interpolation (godotengine/godot#92391) was merged into 4.4.

Is it still the right approach to start with this PR targeting 4.3 that only discusses 2D and removes all mentions of 3D? There are notes about the lack of 3D support that will only be relevant for a single minor version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2D physics interpolation ghosted sprite2d
6 participants