Page 1 of 1

Game runs too fast on a laptop?

Posted: Sun Dec 22, 2013 4:50 am
by sclark39
Something very strange is going on with my Love2d entry. On my beast gaming machine at home, it runs at about 60 and feels good. On this laptop, it's reporting an FPS of 300 or so, like it's not taking any time at all to draw or something. It's drawing many more frames than are being simulated. It seems strange that a laptop would be running "faster" than a gaming PC, leading me to believe this might be a bug with love2d's handling of this card.

You can check out my source here: http://www.ludumdare.com/compo/ludum-da ... &uid=15443 (Love link includes images/sounds, Source is lua only)

Locally, I've added some code to limit the FPS from the bottom of http://love2d.org/wiki/love.timer.sleep which seems to help, but I really don't understand why I'm needing to limit the FPS on what I would assume is an underpowered device.

Stats of this machine:

Code: Select all

          Processor: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz (4 CPUs), ~2.8GHz
             Memory: 5120MB RAM
Available OS Memory: 5004MB RAM
          Page File: 3350MB used, 6654MB available
          Card name: Intel(R) HD Graphics Family
       Manufacturer: Intel Corporation
          Chip type: Intel(R) HD Graphics Family
           DAC type: Internal
         Device Key: Enum\PCI\VEN_8086&DEV_0126&SUBSYS_21DA17AA&REV_09
     Display Memory: 1696 MB
   Dedicated Memory: 64 MB
      Shared Memory: 1632 MB
Anyone have any clue what's going on here?

Re: Game runs too fast on a laptop?

Posted: Sun Dec 22, 2013 5:04 am
by sclark39
Oh, I also remember reading something about vsync. Is vsync on by default for Love? Maybe the laptop GPU doesn't have vsync, so it's reporting a higher framerate even though the actual logic loop is taking more time than on a desktop (since the draw part is probably taking basically 0 time).

Re: Game runs too fast on a laptop?

Posted: Sun Dec 22, 2013 9:51 am
by Robin
Yeah, vsync is on by default, unless LÖVE can't turn it on, because of whatever low-level thing does not support vsync.

Re: Game runs too fast on a laptop?

Posted: Sun Dec 22, 2013 10:39 am
by bartbes
Or if the graphics driver overrides it.

Re: Game runs too fast on a laptop?

Posted: Sun Dec 22, 2013 5:16 pm
by sclark39
Yeah, I believe that's what was happening. It was running way too fast and needed an FPS limiter on it.

Re: Game runs too fast on a laptop?

Posted: Mon Dec 23, 2013 1:37 am
by Jasoco
Make sure you're creating framerate independent animations by using Delta Time (dt) to your advantage.