Delta time consistency?

I am currently having problems figuring out my… problem. I am developping in the editor and everything works fine, but when I package the game, everything is simply slower (the velocity, the physics, everything). In itself it’s pretty normal because I don’t have the best computer in the world and our game is made for high-end computers, but the physics simply doesn’t seem to be frame rate independant.

For example, I am simulating buoyancy, so I have a bunch of platforms that have a buoyancy force acted on them to make them float. I put my platforms deep in the ocean and counted how much time it took for them to reach the surface. In the editor version, it took them about 3 seconds, but in the packaged build, it took them 7 seconds. I am simply calling AddForce() on the platforms once every frame, in the ■■■■.

I understand that the packaged build may lag on my computer (it has highest quality settings, full screen, etc.), but shouldn’t the physics be frame independant internally? It should take the same amount of time to reach the surface in both versions.

Also, everything physics oriented in the packaged build feels way slower, like it would take me twice as much time to push a block, or simply move around with forces. But everything that doesn’t use the physics engine works fine because I am multiplying by the delta time. At first, I thought I might need to multiply the forces by the delta time, but everything I read said that the AddForce() function simply adds an acceleration for the duration of the frame. Also, if I do AddForce(FVector(0, 0, 980)), it directly counters the gravity, so it wouldn’t work anyways to multiply the forces by the delta time externally.

So, what’s going on?

Thank you.

That’s because the editor is capped at 120fps and the packaged game is probably 60 (depends on your monitor, but 60 is the most common). That’s why you call the functions twice as often in the editor. To circumvent that you should always scale your values by the delta time (ie multiply your AddForce by delta time before plugging it to the AddForce node). It will require some tweaking and tuning, as this will lower your original values by about 120 times.

AddForce and AddForceAtLocation nodes already account for Delta Time.