Skip to content

Commit 346af99

Browse files
committed
Document physics spiral of death performance issue in Troubleshooting physics issues
1 parent 26769a6 commit 346af99

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tutorials/physics/troubleshooting_physics_issues.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ other solutions you can try:
2727
speed. The faster the object moves, the larger the collision shape should
2828
extend outside of the object to ensure it can collide with thin walls more
2929
reliably.
30-
- Increase **Physics Ticks Per Second** in the advanced Project Settings. While
30+
- Increase **Physics Ticks per Second** in the advanced Project Settings. While
3131
this has other benefits (such as more stable simulation and reduced input
3232
lag), this increases CPU utilization and may not be viable for mobile/web
3333
platforms. Multipliers of the default value of ``60`` (such as ``120``, ``180``
@@ -44,7 +44,7 @@ causes the simulation to become wobbly, making the objects unable to rest on top
4444
of each other without moving.
4545

4646
Increasing the physics simulation rate can help alleviate this issue. To do so,
47-
increase **Physics Ticks Per Second** in the advanced Project Settings. Note
47+
increase **Physics Ticks per Second** in the advanced Project Settings. Note
4848
that increases CPU utilization and may not be viable for mobile/web platforms.
4949
Multipliers of the default value of ``60`` (such as ``120``, ``180`` or ``240``)
5050
should be preferred for a smooth appearance on most displays.
@@ -83,7 +83,7 @@ simulation rate (as making the shape thicker would cause a disconnect between
8383
the RigidBody's visual representation and its collision).
8484

8585
In both cases, increasing the physics simulation rate can also help alleviate
86-
this issue. To do so, increase **Physics Ticks Per Second** in the advanced
86+
this issue. To do so, increase **Physics Ticks per Second** in the advanced
8787
Project Settings. Note that this increases CPU utilization and may not be viable
8888
for mobile/web platforms. Multipliers of the default value of ``60`` (such as
8989
``120``, ``180`` or ``240``) should be preferred for a smooth appearance on most
@@ -115,7 +115,7 @@ vehicle (due to tunneling), but also that the simulation has little data to work
115115
with in general at such a high speed.
116116

117117
Fast-moving vehicles can benefit a lot from an increased physics simulation
118-
rate. To do so, increase **Physics Ticks Per Second** in the advanced Project
118+
rate. To do so, increase **Physics Ticks per Second** in the advanced Project
119119
Settings. Note that this increases CPU utilization and may not be viable for
120120
mobile/web platforms. Multipliers of the default value of ``60`` (such as
121121
``120``, ``180`` or ``240``) should be preferred for a smooth appearance on most
@@ -156,6 +156,22 @@ geometry as a collider. Not only this will improve physics simulation
156156
performance significantly, but this can also improve stability by letting you
157157
remove small fixtures and crevices from being considered by collision.
158158

159+
Framerate suddenly drops to a very low value beyond a certain amount of physics simulation
160+
------------------------------------------------------------------------------------------
161+
162+
This occurs because the physics engine can't keep up with the expected
163+
simulation rate. In this case, the framerate will start dropping, but the engine
164+
is only allowed to simulate a certain number of physics steps per rendered
165+
frame. This snowballs into a situation where framerate keeps dropping until it
166+
reaches a very low framerate (typically 1-2 FPS) and is called the *physics
167+
spiral of death*.
168+
169+
To avoid this, you should check for situations in your project that can cause
170+
excessive number of physics simulations to occur at the same time (or with
171+
excessively complex collision shapes). If these situations cannot be avoided,
172+
you can increase the **Max Physics Steps per Frame** project setting and/or
173+
reduce **Physics Ticks per Second** to alleviate this.
174+
159175
Physics simulation is unreliable when far away from the world origin
160176
--------------------------------------------------------------------
161177

0 commit comments

Comments
 (0)