Weird issue with framerate

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
guillotinesmirk
Prole
Posts: 2
Joined: Sat Feb 10, 2018 10:23 pm

Weird issue with framerate

Post by guillotinesmirk »

I've written a gravity simulator, and it's been capped at 30 fps. I disabled t.window.vsync, which didn't help me, and then I read a forum page here on love.run, which gave some sample code which used love.run to run at 60 fps. I tried adding that in, and it fixed my problem for a little while, but the frame rate capped again, and now the sample code also runs at 30 fps. I hadn't modified the code in any way when that happened. Does anyone know what's happening? I'm running it on an MSI, if that helps any.

Here's my code:
GRAVITY.love
(2.46 KiB) Downloaded 132 times
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: Weird issue with framerate

Post by pgimeno »

I'm getting ~1300 FPS. My guess is that your graphics card (or possibly the driver) doesn't honour the vsync bit, and that it's too slow to render every frame in 1/60s, hence it skips every other frame.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Weird issue with framerate

Post by raidho36 »

Yep. Writing games is easy. Writing games that run at high framerate on your target hardware is hard.

*cough*ps4tetris*cough*
Last edited by raidho36 on Sun Feb 11, 2018 12:03 am, edited 1 time in total.
drunken_munki
Party member
Posts: 134
Joined: Tue Mar 29, 2011 11:05 pm

Re: Weird issue with framerate

Post by drunken_munki »

0 bodies: 6700 fps
50 bodies: 1200 fps
100 bodies: 380 fps

Running as is.

Maybe check your driver settings, sometimes they can enforce an FPS cap or force vysnc or something.
guillotinesmirk
Prole
Posts: 2
Joined: Sat Feb 10, 2018 10:23 pm

Re: Weird issue with framerate

Post by guillotinesmirk »

Yeah, I looked up info about my computer, and it looks like it's something to do with power saver mode. I'm getting 900 fps when it's plugged in, and 30 fps when it's on battery. Thank you all for verifying it's not my code.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests