3D Physics are framerate dependent

The 3d physics behavior doesn’t seem to have TimeDelta() implemented on it from the getgo, and multiplying impulses by TimeDelta() gives you very inconsistent results.

Here’s an example .json project showcasing this problem, all you have to do is lower the framerates and see it for yourself.

My game uses custom physics movements, with lots of impulses and forces, I’ve been developing it for a while now, how do I fix this?

I doubt people will take to download your project. You should take a screenshot of your events. People will be able to tell you if you are using the action correctly or not.

Here’s the event


Here’s a comparison on different Frames per second (the boxes are stacked in the same order as their events, the top and bottom ones have a linear damping of 20 while the middle ones have a linear damping of 0)
fps comparison gdevelop

why do you want to use forces in your project?

It’s a 3d platformer and when the player presses the movement keys they have a force applied to them based on the key pressed

I don’t like the default 3d physics character controller very much

you can change the linear velocity, is more stable in my tests since you can change to an constant value or add an limit to it. forces will keep adding value every frame, thats why is inconsistent in different framerates.

altho, if my memories fooled me letme know!!

2 Likes

This is correct. The above events will add those impulses and force every frame as there is no conditions nor trigger once. It is unrelated to the physics engine itself and is related to the event setup.

I mean that’s still a shame because doing this would be far easier than whatever calculations I’d have to do just to use linear velocities. Can’t even have other objects collide with it causing some bouncing as I’m constantly overwriting the velocities.
image
(this isn’t the character I’m talking about it’s just an example that also doesn’t work with TimeDelta())
So the only way for me to properly move my character is to change the linear velocities?

This is not true. The physics engine expects the force action to be called every frame (as long as the force should applies). It will take into account the time delta in its calculation.
With a variable frame rate, it’s not possible to reproduce the exact same trajectories (for instance for a Pachinko), but players won’t tell the difference for most games.

so what is the issue in peeblo’s case? he is using in the right way aren’t he?
i mean, what would solve peeblo’s issue?

Notice how the only one that stays consistent accross different framerates is the third box, which has a force applied to it but has no linear damping unlike the one below it, what do I make up from this?

Impulses should only be called once. So, we can ignore these 2 cases (the ones on top I guess).

Actually no, here in this comparison I heard what you said about how impulses should be handled and applied an impulse ONLY ONCE at the start of the scene for the two boxes at the top

You can clearly see a difference here too (the box at the top with linear damping)
another one
Once again, the only boxes that stay consistent are the ones without any linear damping, the two in the middle