Löve FPS optimisation

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Löve FPS optimisation

Post by timmeh42 »

I've been fiddling around with highly repetitive/intensive tasks on Löve, and as an amateur programmer with no formal education in computer science theory (or whatever its called) I have no idea what makes certain functions in Lua and Löve more or less efficient than others.
So, could we make a list of recommended functions to use or not to use for high efficiency?

To start, the best I could come up with so far is that, in Löve itself, when drawing large numbers of images using the same image, it is about 1.5x faster to add them all to a SpriteBatch than to draw them individually.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Löve FPS optimisation

Post by Robin »

Honestly, usually it won't matter, unless you're doing things like calling newFont or newImage in love.update() or love.draw().

In a LÖVE game, there are usually two general bottlenecks: game logic and drawing shit to the screen.

For game logic, you need to watch algorithmic complexity: a for-loop in a for-loop will take more time than a single for-loop, simulating thousands of enemies will be slower than a handful. As long as you don't want too much, this usually will not be a problem.

Drawing shit is more of a mixed bag, this has to do with hardware and that's really not my area of expertise. Using SpriteBatches (as you said) and Canvases can help there, but often you don't need them. Don't try to use "tricks" for a few more FPS if it's not necessary, because you may end up with higher system requirements for graphics drivers and whatnot than you would have had without those tricks.
Help us help you: attach a .love.
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: Löve FPS optimisation

Post by mickeyjm »

Robin wrote: Don't try to use "tricks" for a few more FPS if it's not necessary, because you may end up with higher system requirements for graphics drivers and whatnot than you would have had without those tricks.
And THAT is why I hate Canvases
Your screen is very zoomed in...
User avatar
felix24
Party member
Posts: 163
Joined: Tue Jul 26, 2011 4:51 pm
Contact:

Re: Löve FPS optimisation

Post by felix24 »

i found this quite interesting for general tips on optimization.
it's an article by the guy who programmed Beep.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Löve FPS optimisation

Post by Jasoco »

mickeyjm wrote:
Robin wrote: Don't try to use "tricks" for a few more FPS if it's not necessary, because you may end up with higher system requirements for graphics drivers and whatnot than you would have had without those tricks.
And THAT is why I hate Canvases
Hey, don't hate on Canvas. They can do stuff you just simply can't do without them. You either hate Canvases because your computer can't support them, or you don't hate them at all because they're very useful, even if they aren't 100% supported.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Löve FPS optimisation

Post by Roland_Yonaba »

Maybe you will find that threadinteresting.
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: Löve FPS optimisation

Post by mickeyjm »

Jasoco wrote:
mickeyjm wrote:
Robin wrote: Don't try to use "tricks" for a few more FPS if it's not necessary, because you may end up with higher system requirements for graphics drivers and whatnot than you would have had without those tricks.
And THAT is why I hate Canvases
Hey, don't hate on Canvas. They can do stuff you just simply can't do without them. You either hate Canvases because your computer can't support them, or you don't hate them at all because they're very useful, even if they aren't 100% supported.
Hate them for the first reason,
When the were framebuffers I was fine with it, i could actually use them. I no they are useful but IMO works for everyone>faster for those who hav supporting graphic cards
Your screen is very zoomed in...
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests