there has any tricks to improve FPS for old PC?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by slime »

vsync is on by default in LÖVE. When I turned vsync off in your game, I got ~560fps without the background, and ~550fps with the background.
User avatar
baby_nux
Prole
Posts: 25
Joined: Fri Mar 04, 2011 3:21 pm

Re: there has any tricks to improve FPS for old PC?

Post by baby_nux »

tentus wrote: That code is fine, though I have to ask, why 1 * 0.9? Why not just 0.9?
i was change to 0.9 but not show diference.
crow wrote:I am confused in what your doing as I get 62 with and without background
i just do a little test for see what wrong with code.
there is not wrong from code, but why my result is so much slow with background. this is make no sense isn't it?

if the problem is from hardware why without background is 110 FPS.
slime wrote:vsync is on by default in LÖVE. When I turned vsync off in your game, I got ~560fps without the background, and ~550fps with the background.
i new in love
how to change vsync?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by kikito »

The code runs at 60 fps in all cases on my sytem.

I've had a look at the code and could not find anything obviously bad.

Are your graphic drivers up to date?

Small things:
  • As others have said, 1*0.9 is often times the same as 0.9; -1*0.9 is -0.9
  • Booleans are better than 1's and 0's for conditions.
Instead of this:

Code: Select all

on_back=1
...
if on_back==1 then
...
function love.keypressed(k)
    if k == "b" then
      if on_back==1 then
        on_back=0
      else
        on_back=1
      end
    end

end
You could have this:

Code: Select all

on_black =  true
...
if on_black then
...
function love.keypressed(k)
    if k == "b" then
      on_back= not on_black
    end
end
When I write def I mean function.
User avatar
baby_nux
Prole
Posts: 25
Joined: Fri Mar 04, 2011 3:21 pm

Re: there has any tricks to improve FPS for old PC?

Post by baby_nux »

kikito wrote:The code runs at 60 fps in all cases on my sytem.

I've had a look at the code and could not find anything obviously bad.

Are your graphic drivers up to date?
hmm.. i'm use openchrome driver for my via chrome VGA.
they say via chrome has lot of problem with driver in linux,
but why if i used sdl framework run smoothly with my vga driver.
is there any issues bug or problem if love2D with via chrome driver?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by bartbes »

But love doesn't use SDL for drawing, it uses OpenGL.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by Robin »

baby_nux wrote:i new in love
how to change vsync?
In conf.lua:

Code: Select all

function love.conf(t)
    t.vsync = false
end
Help us help you: attach a .love.
User avatar
baby_nux
Prole
Posts: 25
Joined: Fri Mar 04, 2011 3:21 pm

Re: there has any tricks to improve FPS for old PC?

Post by baby_nux »

problem solved!!!

since via chrome driver at ubuntu has problem about driver compatibility then i do some tweak on driver.
the problem is from opengl driver, its doesn't work well. ( thx to bartbes for remain me )
so i download "via_chrome9_dri.so" from official site and replace the old one.
and then, love2D work perfectly.

test result:
165 FPS with background
423 FPS without background

but why so much deference, I am soo confuse :shock: ..

anyway, but more better now :awesome:
maybe i do not need FPS trick anymore LOL...

thx all
User avatar
crow
Party member
Posts: 186
Joined: Thu Feb 24, 2011 11:47 pm
Location: UK
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by crow »

I just test this on my laptop I getting 65 on both also strange my laptop is older and is using a crap gfx and 1.7 amd dual core where my
pc gets 61 and thats a core 2 duo 2.4 with a 512 Radian HD 4450 hmm why are my Frame Rate so low ?
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon

I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by tentus »

crow wrote:I just test this on my laptop I getting 65 on both also strange my laptop is older and is using a crap gfx and 1.7 amd dual core where my
pc gets 61 and thats a core 2 duo 2.4 with a 512 Radian HD 4450 hmm why are my Frame Rate so low ?
Ok, first off, use punctuation, you are very difficult to understand most of the time, since you ignore commas and periods.

Now that I've got that off my chest, it's probably a video card cap: many systems will refuse to go much above 60 fps, to avoid overheating. My Asus M51 does that, which is kinda irritating but makes sense (makes it much harder to optimize code :P ).
Kurosuke needs beta testers
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: there has any tricks to improve FPS for old PC?

Post by TechnoCat »

tentus wrote:Now that I've got that off my chest, it's probably a video card cap: many systems will refuse to go much above 60 fps, to avoid overheating. My Asus M51 does that, which is kinda irritating but makes sense (makes it much harder to optimize code :P ).
Argh, and my system refuses to do vsync. So everyone who decides to not use dt and assume max FPS makes a game I can't play.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 56 guests