ph_fps_max_lock
This variable sets the framerate or resolution of physics collision detection
and physics entity updates. The higher this value, the more frequently collision
checks and updates are done, leading to more immersive and stable simulations
at the cost of slowing the overall frame rate. For reasons of stability, the physics
framerate (and its inverse, the physics stepsize) is locked at a fixed value,
as opposed to rendering frames that can take arbitrary step sizes.
Range:
0 .. 100 (default 70)
Type:
var
Remarks:
- For engine versions prior to 6.4, the physics framerate should be an integer
multiple of the render framerate at all times, otherwise stuttering can occur:
If fps_max == 50, then ph_fps_max_lock should be one of 50, 100,150,
200, etc. This ensures that every display frame is made up of the same number
(1,2,3,4,etc.) of physics frames. If ph_fps_max_lock was 75 in this example,
it would cause the first render frame to be made up of 1 physics frames, the second
render frame then contains 2 physics frame, the next render frame has 1 physics
frame and so on. The visual effect is a physics entity that skips ahead every
other render frame. To prevent this, set fps_max to a low value (like 30),
set ph_fps_max_lock= n* fps_max, set fps_lock=on and time_smooth=0
at the beginning of your main function.
- With engine version 6.4 or above, physics movement is interpolated and ph_fps_max_lock and time_smooth can take arbitrary values.
Example:
fps_max = 40;
ph_fps_max_lock = 80; // two physics frames per render fram
See also:
time, time_factor,
fps_max, fps_min, fps_lock
► latest
version online