GameMaker: Studio

GameMaker: Studio

View Stats:
kri Nov 20, 2013 @ 11:22am
A quick question about FPS in GM....
So if you set room_speed to like 60, the game will run at 60 fps. Ok.

But the objects' speed will be 2 times faster than how it was at 30.

Is it possible to change the FPS but the speed and the alarms all have the same speed and stuff?

And if someone sets their FPS(which is room_speed, im making a multiplayer...) to 60, and the other guy will have it set to 120, while there be like a dissatvantage at the guy with 60 fps?

Some people really care about 120 fps :3

Sorry for my bad english.
< >
Showing 1-4 of 4 comments
Bruford Nov 20, 2013 @ 12:24pm 
Set all alarms and speeds as multiples or divisions of romm_speed - so for a 10 second alarm use alarm[0]=room_speed*10
Sera Nov 20, 2013 @ 6:17pm 
A typical function other languages have is delta time. GM traditionally lacked this, resulting in having to poll the system clock constantly to various degrees of effectiveness. Delta time is independent of frame rate, and used to calculate a lot of motion in modern games precisely due to slow down; if you experience frame skipping, delta time is probably involved.

The good news is, Studio totally has delta time. I decided to look into it, because I found it hard to imagine such a thing would still be absent with all the mobile implementations, and it was added in last year.

You can look it up in GM's help file to figure out exactly what you're doing, but the variable in question is delta_time. From what I've gathered in my brief look into it, you'll want a variable to store the difference between frames (delta time seems to be an increasing total - this is fairly new to me as well outside of the concept itself), and you'll scale your speed based on that space.

What that means is a bit of work outright to adjust your present work, but you could set your room speed to anything, theoretically, and GM would approach that number as best it could. If your target speed is 500 fps and the user can only pull 45, the game should theoretically scale just fine to that 45, which is sort of rife with possibilities. Cool stuff.

Your question has resulted in us both learning things! Those are my favorite kinds of questions.
kri Nov 21, 2013 @ 5:28am 
Originally posted by Zaron X:
A typical function other languages have is delta time. GM traditionally lacked this, resulting in having to poll the system clock constantly to various degrees of effectiveness. Delta time is independent of frame rate, and used to calculate a lot of motion in modern games precisely due to slow down; if you experience frame skipping, delta time is probably involved.

The good news is, Studio totally has delta time. I decided to look into it, because I found it hard to imagine such a thing would still be absent with all the mobile implementations, and it was added in last year.

You can look it up in GM's help file to figure out exactly what you're doing, but the variable in question is delta_time. From what I've gathered in my brief look into it, you'll want a variable to store the difference between frames (delta time seems to be an increasing total - this is fairly new to me as well outside of the concept itself), and you'll scale your speed based on that space.

What that means is a bit of work outright to adjust your present work, but you could set your room speed to anything, theoretically, and GM would approach that number as best it could. If your target speed is 500 fps and the user can only pull 45, the game should theoretically scale just fine to that 45, which is sort of rife with possibilities. Cool stuff.

Your question has resulted in us both learning things! Those are my favorite kinds of questions.

Thanks man! :D
Sera Nov 21, 2013 @ 5:58pm 
Not a problem. :)

I will state that after further thought it occurs to me you will have to be careful when compensating for low framerates and timing things like, say, bullet spawns.

ie. if you have a machine gun that in GM terms would fire a bullet every Step in a room with a speed of 60, your goal is 60 bullets a second. If the FPS stays over 60, you're calculating if it's time to launch a bullet or not yet, but in the event it drops below 60, you need to compensate for any odd spacing or lapse in fire caused by missing that opportuniy (for example, at 30 fps you're firing two bullets a step as opposed to one).

It's a fairly minor thing, but it could end up mattering for you.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Nov 20, 2013 @ 11:22am
Posts: 4