• 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!

Game Frames Per Second question

B

BabyMonkey

Guest
Hello,

I'm quite new with Gamemaker 2 and have been learning the program and GML while working on my first project for around half a year now.

When starting my project i had my "Game Frames Per Second" setting set at 60, but during gameplay i noticed some jittering for example when the view rolls around the room. I tried different things to remedy this, until i changed the "Game Frames Per Second" setting to 120 and this seemed to fixed it. (I am using an 60hz monitor and have the synchronization option on.) The game now runs at smooth 60fps on my setup. Then i just moved on with my project...

Now months later i started thinking, did i mess things up by changing the setting up to 120? This is thinking way way ahead, but if someone were to run the game with an 120hz monitor, would the game speed be all messed up? Is there some way i can lock the max FPS at 60, without having to change the frames per second setting back to 60, since this would also mean that i would have to correct every single function that is tied to the game speed.

I hope this is not a really stupid question, but i'd appreciate the help :) Thanks in advance.
 

RangerX

Member
It should not be dramatic but:

- Someone with a machine having a tuff time running your game at 120fps will get slowdown.
- Anybody with a monitor that is not 120 mhz or more will not benefit from your framerate (60 mhz monitors display 60 images per seconds, not more).
- You stuttering was probably caused by something else and while your solution worked for you, its probably just a coincidence/luck. The real problem probably isn't fixed.
 
B

BabyMonkey

Guest
Thank you for the answers.
But still, if someone were to play the game now with a 120hz monitor, the game would run at the same speed as it does with my 60hz monitor? meaning all the timing set for alarms, image_speeds, etc etc. would be the same, or?
 

hogwater

Member
I haven't moved the GMS 2 yet, but if "game frames per second" is the same as "room_speed" you should really be using "room_speed" in your code instead of the number directly.

That way if you need to make changes you won't be entering into a nightmare scenario where you have to find every last 120 and change it to 60.
 
B

BabyMonkey

Guest
Your game will push 120 fps but their monitor will show 60 of them per seconds, that's all.
With vsync on, their game would run at double your speed because their monitor is 2x better than yours.
Agh... so which is it? I'm still confused.

I have no problem with changing the Frames Per Second back to 60 and then just correcting the alarms, image_speeds etc. But the problem is if i do that the game will display jitter like every one second, most prominent when moving the character horizontally and will also display massive screen tearing if i don't have the synchronization turned on. What could be causing this?

So to summarize still... at the moment i have Frames per second set at 120, i am using a 60hz display, i have the synchronization(vsync?) turned on and the game runs silky smooth at 60fps, with not even a tiniest jitter. This is the way i would like it to be. I experimented a bit and tried changing the frames per second to 70 or 80 etc. and the jitter wasn't there... game was running smoothly. It almost feels like if i have it set at 60 the game will struggle to keep it steady...?

And i am still confused about the frames per second causing problems with displays that are 120hz or over... If the synchronization is on and someone plays on a 120hz display i would think it would run at double speed, like TheouAegis said... or are Gamemaker games limited to display only at 60fps?
 
Last edited by a moderator:

RangerX

Member
If room_speed = 120 and your monitor is 60 hertz, the monitor will miss 1 frame out of 2. Basically, your game will render at 120 fps but will be displayed at half the fps.
V-sync will probably make GameMaker send an image in the monitor's buffer only when its available. Will basically will influence a big fat nothing. :)
 

RangerX

Member
He's asking about when the monitor's refresh rate is 120 fps.
He's asking both cases and I had expected you to explain that other case. Personally I don't see why the games would run double speed.
There's stuff to block unecessary acceleration due to hardware in like all current engines of this world.
 

Binsk

Member
The screen is irrelevant.

If it can run at 120fps then the game logic will run at that frame rate. This means your alarms and such will be twice as fast as when running at 60fps.

Now, I'm uncertain if vsync will limit a 60 hertz monitor to 60 if it can pull 120. However, it will obviously allow a 120 hertz monitor to run at 120.

The simple answer is, if you want the system to logically run at 60 frames a second set the max speed to 60 frames a second. Game maker generally ties the rendering speed with the game logic speed, whether or not the screen can actually refresh fast enough.
 
Top