Page 1 of 1

VSync Issues

Posted: Fri Jan 15, 2016 4:12 pm
by Carracer12
Hi

So I made a game a little while back (few months) and I now need to have to have it working as a demonstration. It used to work fine but when I loaded up the .love file (without updating to 0.10.0), the FPS was not obeying VSync (which should lock it to 60 FPS on my monitor). Instead it went to ~600 and as a result alot of the game is not functioning correctly. I then tried updating (which involved changing file formats for all my images as for some reason they were saved as gifs before) but no luck.

I know it's not well-coded, however it was my first attempt at a proper game and would appreciate any help getting it working again. So to clarify, what I want to do is get VSync to work again.

Thanks in advance!

~Carracer12

Re: VSync Issues

Posted: Fri Jan 15, 2016 5:26 pm
by Nixola
Vsync works correctly here; did you check your driver settings? Some video drivers might be forcing their vsync settings on applications (might have happened after an update), which would cause the issue you're having. Anyway, you should do whatever you can to ensure the game will run exactly the same no matter what the FPS are.

Re: VSync Issues

Posted: Fri Jan 15, 2016 9:13 pm
by pgimeno
This is not directly related to your issue, but vsync is not always 60 Hz. I can configure my video mode to 60 or 75, for example, and I think 100 is fairly common.

Re: VSync Issues

Posted: Fri Jan 15, 2016 9:50 pm
by bobbyjones
If you use setMode anywhere in your code make sure to set vsync.

Re: VSync Issues

Posted: Sat Jan 16, 2016 3:04 pm
by Carracer12
Okay guys, thanks for your help. Is there any easy way to limit FPS/"ensure the game will run the same no matter what the FPS rate"? Sorry for the newbie sounding question, been months since I last did any of this coding :P

Re: VSync Issues

Posted: Sat Jan 16, 2016 3:41 pm
by s-ol
Carracer12 wrote:Okay guys, thanks for your help. Is there any easy way to limit FPS/"ensure the game will run the same no matter what the FPS rate"? Sorry for the newbie sounding question, been months since I last did any of this coding :P
yes, use delta time correctly in all calculations: https://www.love2d.org/wiki/dt