Hi everyone,
I got an question about how to make Physics computations independant of the framerate of the game.
I have one actor, a bouncing ball that have an impulse apply to it every tick to compensate the gravity. And when close to the ground, it receive a big impulse to make it “bounce”.
But the catch is that the final result will be very different depending of the framerate :



As we can see in these 3 gifs, in the first case with no restriction on the FPS, the ball is perfectly bouncing and slowly falling.
In the second where I limit the max fps to 30, sometimes we only have half of a bounce. And for the third with a limit at 10, we only have small bounces and the ball could stay on the ground for a time.
On my side on the code, I looked at the Substepping physic system to have something that should be independent of the framerate. Here the snippets :
https://dev.epicgames.com/community/snippets/lNw/unreal-engine-physics-with-substepping-setup
( I know that there is also a way to register every ticks the substep’s method on the body instance of my StaticMesh, but this way from the BeginPlay seems more ideal and I didn’t see any differences. )
So, from that I would thought that every thing should have been identical no matter what the number of FPS were. I don’t think I forgot to enable something on the project settings either :
Here are the source I had on the topic :
http://mansisaksson.com/view/ue4-substepping
You will noticed that I don’t multiply the impulse with the delta time on the “counter gravity”. I don’t understand why but it seems that we don’t have to use the delta time in our physics tick computations.
I have tried with both anyway, and it didn’t change anything.
So, does anyone with good physics knowledge could help me ?
Thank you everyone =)




