## Roid Rage

Show off your games, demos and other (playable) creations.
help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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?
Furiously typing ned.
Roid Rage

Citizen
Posts: 69
Joined: Mon Aug 08, 2011 12:28 pm

### Re: Roid Rage

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.

help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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.
Furiously typing ned.
Roid Rage

tsturzl
Party member
Posts: 161
Joined: Fri Apr 08, 2011 3:24 am

### Re: Roid Rage

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.

help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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.
Furiously typing ned.
Roid Rage

kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

### Re: Roid Rage

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.

help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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?
Furiously typing ned.
Roid Rage

kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

### Re: Roid Rage

help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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.
Furiously typing ned.
Roid Rage

help computer
Prole
Posts: 15
Joined: Tue Sep 20, 2011 1:07 pm

### Re: Roid Rage

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.