Curious on why we're not applying delta to the velocity values

Course: Master Mobile Game Development with Godot 4: From Concept to App Stores

I am curious to know why we aren’t applying delta to velocity values when setting them to ensure the game runs the same at different frame rates. Does this not apply here?

Hi Brettski,

In the case of this course its a beginners introduction into mobile development and the game we are creating here does not depend on frame rate being a factor.
Although it is actually good practice to apply delta to the velocity as in games such as a more advanced fps mobile game then fps would be a factor and run at a different rate between devices.

Thanks for the information, Marc. This seems to send a mixed message to those learning about game development.

When should, and when does it not matter to apply delta to velocity? What are some good guidelines around this practice?

Thank you!

Hi Brettski,

As a general rule of thumb i use delta when dealing with time-dependent calculations, animations, movements, physics, and anything related to the progression of time in the game loop.
I dont use delta in situations where frame-rate independence is not crucial, such as input handling or initialization.

Hope this clarifies and in more complex games we would follow this convention

Thanks for the reply, Marc. This tracks with my understanding. IMO, it seems not using the value could mislead developers. I guess I would expect to be taught the correct way, not the ‘quick’ way. Thank you for your time and clarity. I appreciate it.

1 Like

Hi Brettski, I’m the instructor for the course. I hope that you like it so far!

When using move_and_slide you don’t need to multiply velocity by delta. Because move_and_slide will do that for you.

Hope this helps, have fun with the rest of the course :slight_smile:

2 Likes

@Brettski By the way let me also clarify when you want to use delta:

When you are doing an operation each frame, like increasing a variable in the _process function. You should multiply it by delta to make it frame rate independent. This makes sure the game runs the same across different computers with different computing speeds.

There is a full lecture in my Godot 2D Beginner Course that covers delta with intuitive examples

1 Like

Hey @kaanalpar, thank you for the response! Great information about the move_and_slide. Thank you; it was really helpful! I feel I was taught that at some point and forgot it :blush:. I do recall you going over delta in your 2D course, which was one reason I thought of it here.

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

Privacy & Terms