Page 2 of 3

Re: Roid Rage

Posted: Fri Sep 23, 2011 11:51 am
by help computer
JDFight wrote:Yep - Changing line 15 of explosion.lua to :

Code: Select all

self.ps = lg.newParticleSystem(IMG, size * 100)
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?

Re: Roid Rage

Posted: Fri Sep 23, 2011 1:31 pm
by Rad3k
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.

Re: Roid Rage

Posted: Fri Sep 23, 2011 6:23 pm
by help computer
I've updated the game and first post with all the suggestions so far, thanks for all the feedback guys.

V-sync I've disabled by default for now, but can be re-enabled easily in conf.lua.

Re: Roid Rage

Posted: Fri Sep 23, 2011 9:29 pm
by tsturzl
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.

Re: Roid Rage

Posted: Fri Sep 23, 2011 10:20 pm
by help computer
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. :crazy:

Re: Roid Rage

Posted: Sat Sep 24, 2011 4:29 pm
by kraftman
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.

Re: Roid Rage

Posted: Sat Sep 24, 2011 6:41 pm
by help computer
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.
For 0.7.2, it's the only version I have.

Does it say where the previous calls comes from?

Re: Roid Rage

Posted: Sat Sep 24, 2011 9:27 pm
by kraftman
Image

Re: Roid Rage

Posted: Sun Sep 25, 2011 8:11 am
by help computer
Thanks kraftman.

I'm stumped. I can't repeat it and I'm not sure how it could happen. I assume you're trying it on 0.7.2?

Does it happen in the options menu too? That has quite a few continuous explosions, but not created from asteroids.

Re: Roid Rage

Posted: Mon Sep 26, 2011 10:52 pm
by help computer
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.