Performance question...

Get help using Construct 2

Post » Tue Feb 19, 2013 6:56 pm

I'm making a space game with a starry background using a bunch of star objects more or less randomly placed each time you load. The player can fly in any direction for forever so I'm making the stars wrap. What's unclear to me from the manual is whether replacing all the star sprites with small star tiled backgrounds or small star particles would help performance at all, as the manual mainly discourages sprite tiling (which I am not doing). I like my stars and would like to be able to fit a lot in, though I don't relish the prospect of making 30 different tiled background objects for different colors, sizes, and brightness levels (as currently I do most of that in a single sprite with animations).

I'm not planning to "release" this game on mobile devices but my current framerate of 27-40, average 35 fps in firefox (with ~400 objects) is bugging me and I like things that run as smoothly as possible.

Thanks!Phyvo2013-02-19 18:57:08
B
6
S
1
Posts: 40
Reputation: 917

Post » Tue Feb 19, 2013 7:04 pm

Could you upload it somewhere? 35 fps with ~400 objects it's kind of low.
Your pc might be not powerful enought to handle this or you doing something wrong in C2.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Feb 19, 2013 7:16 pm

I'd say that if your "stars" are actually drawn sprites that,fitting them onto a power of two tiled background may improve performance...but if your stars are just pixels created at one side then wrapped,that creating them,destroying them offscreen and re-creating them would be better for performance...

I certainly think with 400 objects and only average 35FPS there are probably a few more places you could make big improvements on performance...I currently have a project with average 1000 objects running at steady 60 FPS

Just to add particles are a no no if you want performance up....Pixel perfick2013-02-19 19:19:24
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Tue Feb 19, 2013 7:50 pm

My PC may well not be powerful enough as it's a laptop with an integrated graphics card (it runs the lower end AAA stuff fine though). Still, I did just go and test it in chrome and chrome runs it smooth, so I don't know how much this has to do with my computer.

Here is my capx... I did have to do clean up work to make it readable as I tend to strike through events/actions as I iterate on them. The first event sheet has star stuff: https://www.dropbox.com/s/70g33v2ae8bbm6c/starproj.capx

The stars themselves are actually sizeable 16 x 16 sprites that I size downward for variety... in reality they don't get bigger than 4x4 but I like starting big and sizing small since it makes things a bit more crisp. I didn't think it would hurt much to have them start a little big since the manual said that size doesn't really matter.Phyvo2013-02-19 19:51:34
B
6
S
1
Posts: 40
Reputation: 917

Post » Tue Feb 19, 2013 7:52 pm

I can't open your file, You are using third party plugin "CSV to Array".
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Feb 19, 2013 8:04 pm

Forgot about that, sorry. Here is the capx with the CSV events removed.

https://www.dropbox.com/s/ey8n0hhatzsjub7/gutted.capx

You won't be able to fly but firefox still runs slow regardless.Phyvo2013-02-19 20:04:49
B
6
S
1
Posts: 40
Reputation: 917

Post » Tue Feb 19, 2013 8:10 pm

Still needs "CSV to Array".
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Feb 19, 2013 8:17 pm

Forgot you had to delete the plug-in from the object list... I suppose that would have the fastest way to do it in the first place. Retry the link!
B
6
S
1
Posts: 40
Reputation: 917

Post » Tue Feb 19, 2013 9:05 pm

yeah. 400 sprites on a desktop based computer does seem low. Do you have any specifications on your computer. Try turning WebGL off if you can. if your on an older laptop your computer might try to software render the effects which will kill performance.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Tue Feb 19, 2013 9:08 pm

I think it's more of a firefox issue. I test it on my brothers pc (he's got firefox and chrome installed)
chrome - 60fps all the time
firefox - 20 - 45 and keeps changing
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Artpunk, indiegrimes, NRABrazil, PixelatedTrip and 24 guests