Docs clarification regarding Max Physics Steps By Frame

Godot Version

v4.2.stable.official [46dc27791]

Question

The documentation regarding Max Physics Steps By Frame states the following

. . . the game will appear to slow down if the rendering FPS
is less than 1 / max_physics_steps_per_frame of physics_ticks_per_second. 
This occurs even if delta is consistently used in physics calculations.

To avoid this, increase max_physics_steps_per_frame 
if you have increased physics_ticks_per_second significantly 
above its default value.

I don’t quite understand how the 2 variables relate to each other. I was planning on increasing physics_ticks_per_second (for an internal experiment) dynamically and temporarily by code, but it seems as I have to take into account this other variable, max_physics_steps_by_frame and I don’t quite understand how.

Like what is the formula to take into account, if i set, let’s say, physics_ticks_per_second to 80 how much should I increase this other max_physics_steps_by_frame variable and stuff like that.

If you increase physics ticks per second to 80 without changing the FPS threshold at which the game starts slowing down, you should increase max physics steps per frame by 80/60.0 which is roughly 1.333x. You’ll have to round the final result as Max Physics Steps per Frame only accepts integer values.

Aaah I see! So the result of that division is the factor by which I should multiply the MaxPhysicsStepsByFrame.

So in that same case, as the default value is 8 I should multiply it by 1.33333 then I get 10.66666 so I should set it as 11 (rounding), is this right?

Yes :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.