Understanding Delta Time (Godot)

I have a question regarding delta time. It makes sense what was explained in the lecture " Understanding Delta Time"; however, the moving of the rocket is happening in the _physycs_process method, and the Physics Ticks per Second is a constant value, you even had to go to the project settings to update it to demonstrate the possible issue. So, why should we expect different Physics Ticks per second when we run the moving code there? It will be a problem if we run the code in the _process method, but why will it be a problem in _physycs_process?

Does it mean that Physics Ticks per Second - is not a constant value when the game is built and running as a standalone executable? Is it up to the engine to change the value of Physics Ticks per Second on different machines during runtime?

Let’s say I’ve disabled V-Sync, and now I have 3000 FPS in my game, specifically in the _process method right? But since _physycs_process is running on the constant FPS separate from the _process, I guess I should still have 60 FPS (or whatever I set in the project settings) there and my delta logic is not needed?

What will happened if my machine is very slow and I only have 10 FPS in my _proecss, what FPS in this case will be in _physycs_process? Still 60?

Hello paxer.
It is generally more reliable and a better practice to use the delta parameter even in the physics process when you update directly the position of an object.
While it’s true that in most cases, the physics_process will be called at regular interval, there are cases where this might not happen (very complex scenes or hardware limits).
And if you ever have the need to change the numer of ticks per second later while developing, all your scenes will still behave as you originally intended. If you set your speed variables counting on 60 ticks per second, and you have to change that, you will have the need to update all your values.

yeah, I understand, I just thought that it looks like, specifically in the example of _physycs_process, there is not much of a value to multiply to delta since the Physics Ticks per Second is a constant, and I don’t see a reason why would I want to change the value of it in the project setting. However, it, of course, makes sense when we need to implement some move logic in the _process function where the FPS is variable and will be different for every computer.

And yeah, I agree that it is better to stick to the habit and always multiply to the delta in _process and _phsyscs_process just to be safe, except for the usage of _move_and_slide Physics introduction — Godot Engine (4.0) documentation in English where it is done by the engine

Hi and welcome to the community @paxer and @Jago :wave:

sounds like you two have answered the question between you, nice one :slight_smile:

in the case of the bullet specifically. since we are only using the speed value here solely for the purposes of moving the bullet which is an area2d and it doesnt have any transformable physics properties of its own. (like a velocity or gravity)
then, yes i believe you could ommit the use of delta in this case, but with making a mental note that it was left out on purpose and why.

yep the physics engine side of it will run its calculations at a fixed timestep in editor and build then hand back the physics state information back to the engine to use for any game logic / rendering.

Darren

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

Privacy & Terms