GML Delta-Timing (Movement & Alarms)

NeZvers

Member
I'm doing tests myself and last thing I want to solve is animation end with script. Without delta it was pretty easy to calculate, but with delta I found out that after setting room_speed to 99999 and use imgSpeed instead of image_speed (which is set to 0) you can hit image_number(and over) on image_index for one game frame and use it as sprite switch, but haven't tested further yet.
 

matharoo

Udemy Instructor
Thank you @matharoo, very cool.

I do have a question though.
In terms of unlocking room_speed, is it wise to set it to 9999 for example or is there a value that is just right?
I don't see why you would want to set the room_speed to 9999. Perhaps it has an effect that I'm not aware of? I would just keep it as 60.
 

Smiechu

Member
I don't see why you would want to set the room_speed to 9999. Perhaps it has an effect that I'm not aware of? I would just keep it as 60.
To make the game compatible with all possible screen refresh rates?
But even then I find it more reasonable to set it around 200-300fps.
 

NeZvers

Member
Room speed like that unlocks any frame limit that might be. In my tests, I have a game running around actual 1400fps.
If your delta calculations are right then that means whatever system you run, you'll get max possible fps.
That brings its own challenges but looks neat and smooth. It's not needed and maybe you can keep it at 120 to have max reasonable fps, dunno if displays can play it faster.

Actually, you can have a frame limit option in-game settings for players (not to waste processing power on phantom frames), and since you have delta timing down the game will run amazing.
 
Last edited:
B

BigBrotherBear

Guest
Would it be affected by screens with 120Hz if I set it to 60 fps?
 

NeZvers

Member
Your screen doesn't affect room_speed.
And it really isn't good thought to run massive room_speed, 120 is good enough if you want max FPS and you have a display that supports that.
 
N

NeonBits

Guest
coded on 30fps.... hardcoded.. everything... on 30fps... now what's the bad part if I cannot add deltatime so simply?
 

matharoo

Udemy Instructor
coded on 30fps.... hardcoded.. everything... on 30fps... now what's the bad part if I cannot add deltatime so simply?
If you've hardcoded every movement in your game to work with 30 FPS, yeah, it will be hard and time-consuming to add delta-timing, but it's not entirely impossible or infeasible, if you're making a mobile game. If it's a PC game, I wouldn't worry about it.
 
N

NeonBits

Guest
Ahhh, that's better; I don't think I'm smart enough to install that sdk...
... and my coding scares me ...
 
N

NeonBits

Guest
android for 1.4; forget it, I don't feel good enough to go there anyway. But thanks ; )
 

NeZvers

Member
coded on 30fps.... hardcoded.. everything... on 30fps... now what's the bad part if I cannot add delta time so simply?
Well, even NES run at 60fps, I would not enjoy a game as much if it wasn't holding up to it.
Implementing delta-timing is fairly easy until in a platformer game you want to get jumping working (evil laugh). I couldn't find tutorials on that but I figured it out eventually.
 
N

NeonBits

Guest
Well, even NES run at 60fps, I would not enjoy a game as much if it wasn't holding up to it. Implementing delta-timing is fairly easy until in a platformer game you want to get jumping working (evil laugh).
I'm laughing but have no reasons why; it feels only alot better suddenly that my project isn't a platformer...
I took 30fps because the only reason I've heard was "60fps will make animation more smoother"... never looked for information about it; project felt ok when running; never made a test build yet....
 

NeZvers

Member
@NeonBits That smoothness IS the reason why people prefer games on 60fps. If you are not making a mobile game you have no reason why not to do it 60fps.
For mobile games I mentioned 30fps because it will drain battery slower and heat less.
 
N

NeonBits

Guest
That smoothness IS the reason why people prefer games on 60fps. If you are not making a mobile game you have no reason why not to do it 60fps.
Since I had no reason, I took 30fps : P
For mobile games I mentioned 30fps because it will drain battery slower and heat less.
it never came to my mind about the battery; I'm just another new GM deal customer!!!!
Hey, now the way I see it, seems I've already prepared the ground for mobile... but the controls.... I don't think so...
 
Last edited by a moderator:
Top