-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
2842b21
to
1397166
Compare
@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. |
@skyace65 I would remove all of it for 4.3 for simplicity. Also there is no We can add back the camera example for 4.4 when 3D physics interpolation is merged. cc @lawnjelly |
2dc2bf2
to
8c305dc
Compare
8c305dc
to
7119622
Compare
@rburing it's ready for review now. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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
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 |
There was a problem hiding this comment.
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.
Agree with @rburing on simply removing the details of 3D, especially in the So perhaps just titling it |
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. |
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:
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.