# Room Speed vs Frames Per Second (FPS)

S

#### Shazard Bansraj

##### Guest
The GM documentation states that Room Speed and Frames Per Second are completely separate. I've been confusing myself trying to calculate the time certain actions and animations would take to complete. I'd appreciate any readings or guides on the matter.

Is it possible to truly have a frame rate of 60 FPS with a Room Speed of 30? Is the default Room Speed still 30? Higher frame rates usually mean a smoother-looking game, but what are the benefits of a higher Room Speed? Should I increase my Room Speed to 60?

#### woods

##### Member
here is kinda how i see it..

the step even kicks off at the room speed.. (this is not frames per second)

the code in the step event tries to run this many times in a second
room_speed 30
in the step event,
if you have image_speed=1 and 30 frames it would run thru all 30 frames in 1 sec.(super smooth)
if you have image_speed=1 and 3 frames it would run thru all 3 frames in 1 sec. (super choppy)

....ish

not entirely accurate i know .. but is a rough example

##### Member
The GM documentation states that Room Speed and Frames Per Second are completely separate. I've been confusing myself trying to calculate the time certain actions and animations would take to complete. I'd appreciate any readings or guides on the matter.

Is it possible to truly have a frame rate of 60 FPS with a Room Speed of 30? Is the default Room Speed still 30? Higher frame rates usually mean a smoother-looking game, but what are the benefits of a higher Room Speed? Should I increase my Room Speed to 60?
I could be wrong, but I'm pretty sure it just means that room_speed is the goal. But not necessarily the what the FPS actually is. In other words, if you set it to 60, it tries to maintain 60. But if might drop to 30. It's never going to go over. The point is that you can't say: show_debug_message(room_speed) and expect it to tell you what the current FPS is. If you want that you use fps, or fps real. From the manual:

"These values are often confused, but basically one [room_speed] is the number of game steps that GameMaker Studio 2 is supposed to be completing in a second, while the other (the fps) is the number of CPU steps that GameMaker Studio 2 is actually completing in a second up to a maximum value of the room speed itself. "

To answer your other question, I would say that yes, I would probably default to 60 fps.

#### immortalx

##### Member
Room speed can mean 2 things depending on the implementation:

The simplest approach is setting to the desired frame rate. Let's say 60 fps. An object with a speed of 1 pixel per game-step will thus move 60 pixels in 1 second. In order for gamemaker to achieve that, it has to do all its calculations (for all game objects) in 0.016 seconds for each step. On a simple game it can do much-much better, so the rest of the time until 0.016 seconds have past, it just stays idle. That is all well and good until you run this game on an old machine. This time not only there isn't any time to spare, calculations for a single step could take, say, 0.3 seconds. That means the game would actually run slower on this machine.

The other approach (which most professional games use), is setting room speed to the largest number possible, and introducing the concept of delta-time. Details about this are maybe out of the scope of this discussion, so I think a google search would serve that purpose better. In a nutshell, the time since the last step is measured, and every moving object's speed is calculated as desired-speed X delta-time. Thus objects on different computers appear tobe moving at the same speed, the difference being only the smoothness of motion.