• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Help with delta_time

Hello everyone! I was watching some tutorials on frame rate and delta_time. I found these two vidios just fantastic on the subject. But I have some doubts about that.

Is there a way to do this in room_speed?

For example I have a game that I have been working on for 3 years, it is a giant project, I am currently converting everything to delta_time (move speed, image_speed, etc.), I believe it will take me a few months to finish all my game settings for delta_time.

If there was a way to do this directly in room_speed the conversion job would be easier.


another question is about image_speed. How would I adjust the frame rate for animations? (image_speed * delta ???)



I was thinking of creating an option in the game for the 60/30/120 frame_rate. How could I do that?


Tuto 1:
Tuto 2:
 
No, you can't do it with the room speed; if it was that simple, no one would do it the other way. Unless you only have 10 minutes a day to work on your game, it won't take you several months to switch over. My FPS is on the scale of something like Halo 3, and it only took me a couple weeks to shift my engine into using delta time, and that was with a 9-5. Most of what you'll be doing is just pasting a multiplier into your actions.

After getting delta time up and running, setting the frame rate cap is as simple as setting the room speed.
 

kburkhart84

Firehammer Games
Using delta_time is basically the exact opposite of using room_speed. You use deltaTime when you want to AVOID using room speed capping.

If what you are wanting is to cap at 30, 60, 120, instead of delta_time...the implementation is going to be similar anyway. You need to make all your objects' movements be multiplied by something. That something can be pre-calculated when you change the capping speed, or recalculated each frame. It is VERY similar to what you would do with delta_timing, though with delta time, you have to calculate the time passed every frame instead of assuming the amount based on the room speed cap.
 
Top