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

Windows Use Synchronisation to avoid tearing - framerate issues??

DigiChain

Member
I'm currently making my first game and have the room speed set at 60. When I run my game fullscreen on my computer I am getting screen tearing.
To fix this I have ticked "Use synchronisation to avoid tearing" in the output options menu, which works great!

But I'm wondering - if the game is played on a monitor with a higher refresh rate (say 144hz) will this affect the framerate / speed at which my game will run?
If so what's the solution?
 
L

Lonewolff

Guest
Code:
room_speed = 9999;
display_reset(0, true);
And then use delta time for all of your movement calculations.

Everyone's a winner.
 

DigiChain

Member
Because the "Use synchronisation to avoid tearing" option seems to works a charm I'm hoping not to have to rebuild my entire game using delta time (the game is almost complete!).

I just want to know if the game will start running at a faster frame rate on a 144hz monitor (when using this option), or if it'll still attempt to run at the set room speed regardless of the refresh rate?
 

DigiChain

Member
Easy way to test.
Set your room speed to 30, see what speed it runs at.
Good idea! I've just tested it and the game does in fact run at 30fps on my 60hz display with Use Synchronisation on - so all good. It seems Use Synchronisation doesn't alter frame rate based on the refresh rate. Phew
 

DigiChain

Member
It will! If you set your room speed to 999 but have vsync on, then you will be capped to your monitors refresh rate
Ok, so I'm confused. Does vsync force the game to run at the monitors refresh rate or not? - or does it just cap it at the refresh rate if the room speed is higher than it (but not effect it if the room speed is set below the refresh rate)?

Running my game with a room speed of 30 on a 60hz monitor with vsync on doesn't appear to force the room speed up to 60.
 
L

Lonewolff

Guest
Because the "Use synchronisation to avoid tearing" option seems to works a charm I'm hoping not to have to rebuild my entire game using delta time (the game is almost complete!).

I just want to know if the game will start running at a faster frame rate on a 144hz monitor (when using this option), or if it'll still attempt to run at the set room speed regardless of the refresh rate?
No, if your room speed is 60, it will stay 60. Unless you run it on a cheap laptop and it may become 45 or as low as 30 (due to their refresh rates).

But if you haven't taken delta time into consideration. Then there is no saving you from slowdown (unless you recode all of your variables. But if you,have to do that then I'd go delta_time anyway).


Ok, so I'm confused. Does vsync force the game to run at the monitors refresh rate or not? - or does it just cap it at the refresh rate if the room speed is higher than it (but not effect it if the room speed is set below the refresh rate)?
It will run at whatever is slowest.
 

GMWolf

aka fel666
Vsync will act like a cap.
You cannot go over the monitor refresh rate with vsync on.
But vsync won't magically allow your game to run faster than it ran before.


So there are three things to consider:
Room speed.
Monitor refresh rate.
How fast the computer can actually run the game.

The game will run at whatever is slowest.
 
Top