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.
Löve FPS optimisation
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Löve FPS optimisation
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.
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.
Re: Löve FPS optimisation
And THAT is why I hate CanvasesRobin 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.
Your screen is very zoomed in...
Re: Löve FPS optimisation
i found this quite interesting for general tips on optimization.
it's an article by the guy who programmed Beep.
it's an article by the guy who programmed Beep.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Löve FPS optimisation
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.mickeyjm wrote:And THAT is why I hate CanvasesRobin 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.
- 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
Hate them for the first reason,Jasoco wrote: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.mickeyjm wrote:And THAT is why I hate CanvasesRobin 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.
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...
Who is online
Users browsing this forum: slime and 4 guests