makes the game play much better on my machine - The framerate stays around 30fps when explosions are rendered on screen - (not optimal - but certainly playable - it is basically double the framerate I had before)
That... is not great. I haven't optimised anything yet though, so there is plenty of room for improvement yet.
I've added an options screen to change the size of explosions. Is it possible to change v-sync while running? I noticed turning this off gives a big boost, and I'd like to add an option in-game. Or otherwise, is there any downside to having v-sync disabled by default for everyone?
help computer wrote:I noticed turning this off gives a big boost, and I'd like to add an option in-game. Or otherwise, is there any downside to having v-sync disabled by default for everyone?
There are. VSync's main purpose is to avoid tearing, which happens when the game switches to the next frame, when the current one is just being drawn. It just looks ugly (upper part of the screen belongs to one frame and lower part to the next one, often with a visible seam between). As a side effect, VSync also binds your framerate to refresh rate of your screen (usually 60 Hz), so that may be the reason of the "boost" you get after turning it off.
I'm using a total of 20 particle system in my game, as well as Box2D physics. The game never exceeds 10% CPU usage on my computer even if all systems are firing at once, and there are several collisions. Nor does the game ever swoop below 60FPS(which is the fps limit).
My artist, who is running at significantly lower specs, reported that he experiences no lag either.
Perhaps you could try and recycle objects rather than recreating them?
Also, I didn't experience any lag while playing it.
tsturzl wrote:I'm using a total of 20 particle system in my game, as well as Box2D physics. The game never exceeds 10% CPU usage on my computer even if all systems are firing at once, and there are several collisions. Nor does the game ever swoop below 60FPS(which is the fps limit).
My artist, who is running at significantly lower specs, reported that he experiences no lag either.
Perhaps you could try and recycle objects rather than recreating them?
Also, I didn't experience any lag while playing it.
Good idea. Recyling is definitely something I'll try with the asteroids once I start optimising.
BTW I added a video in the first post of me playing. Badly.
What version of love is this meant for? I get an error (attempt to index setColor line 17 explosions.lua) after a couple of seconds of playing it using both 0.72 and 0.8.
kraftman wrote:What version of love is this meant for? I get an error (attempt to index setColor line 17 explosions.lua) after a couple of seconds of playing it using both 0.72 and 0.8.
I've (oh noes) attempted to optimise the table insertions and access a little bit.
It could be sped up more by changing how the asteroids are managed but, to be honest, would take a lot more work than I'm willing to put into rewriting what would be a large percentage of the game anyway. Yea, I'm pretty lazy. I'd rather take what I've learned and move on.
Anyway I'm happy with how it turned out for what it is, and I hope some people enjoy playing it.
I've updated the source and first post with the beta3 download.