Wild Performance

Discussion and feedback on Construct 2

Post » Wed Oct 09, 2013 10:57 am

My laptop which has an Nvidia 640m, 10GB Ram and an i5 2467m can play Battlefield 3 at 60fps on medium settings.

When I run my C2 project "Orbit" without any background art I get 60fps but when I try to run it after my buddy has added artwork it drops to about 12fps.

If I remove all of the webGL effects like glow and additive blending on the lights etc the fps jumps up to about 25.

The rest of the scene is made up with about 20 - 30 64x64 9-patch objects.

Is there anything I should really watch out for when importing art? Does it matter what quality png's we're adding to the game? Keep in mind that the game was running at 60fps before the art went in, so it's unlikely to be anything in my code screwing the frame rate.
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Wed Oct 09, 2013 11:06 am

9-patch kills performance - it's not nearly as resource-friendly as tiled backgrounds.

When importing art, test as you go. No point in dumping in everything in one go and then testing. Graphics are the biggest performance killer in C2.

I spent a lot of time optimising my artwork as I got it in from the artist. You can't simply drop in whatever comes through and expect everything to be smooth. Battlefield 3 was built by a team of skilled engineers and artists who work to spec, and the art pipeline is one of the most complex parts of any AAA development program.

The quality of the PNG won't make any difference at run-time, it only affects file size, but as soon as you have multiple transparent and semi-transparent images all on top of each other and/or moving around, you can expect performance to suffer.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Wed Oct 09, 2013 11:39 am

Thanks, I didn't realize that 9-patch was a potential performance killer...
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Wed Oct 09, 2013 11:42 am

9-patch shouldn't be a performance killer. It should be equivalent to nine sprites, and you should have a budget of thousands of sprites on a desktop machine.

Did you test across a range of browsers? Do they all perform the same?
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Wed Oct 09, 2013 11:51 am

Actually I only tested on Chrome and Node Webkit, I'll do tests on other browsers too.
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Wed Oct 09, 2013 11:57 am

@Ashley, I'll give you the exact scenario in which I noticed it killing performance. I have a tiled background that covers an entire layout which is solid black and 128x128 and set to 50% opacity. When I switched to a 9-patch to do this same thing but with rounded edges, I found that performance was absolutely crushed.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Wed Oct 09, 2013 12:31 pm

@GeometriX - submit a bug report and I'll investigate, it should not be anywhere that significant a difference. Was every browser the same or did you just test Chrome? Performance can vary a lot between browsers.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Wed Oct 09, 2013 12:42 pm

@Ashley, Sure thing, I'll try to recreate the situation in a simple example and will send through a report. This current project is for offline play so I've only tested on Chrome and NW.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Wed Oct 09, 2013 1:02 pm

So I found a couple more objects with additive blending and glow attached, removed them and got the frame rate up to 50fps.

Those webGL effects are pretty hardcore, I need to go through the performance tips guide and make sure I'm only using layer effects / put all effects in the same layer etc.

Thanks for the info though guys
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Fri Oct 18, 2013 10:57 am

I made a simple cap file to test the impact of 9-patch.

https://dl.dropboxusercontent.com/s/fwe5369rxvxdywd/9-patch_fps_damage.capx

and below is what I found:

1. On my computer, no impact at all. It's always 60fps.
2. On my HTC Desire HD, and I load it with Cocoonjs Launcher. It drops from 56 to 36.

Providence University, lecturer.

Tatung University, lecturer.



Consultant per question: USD$15 / time

Consultant by month: USD$300 / month

Customized project: USD$2500 / capx
B
78
S
18
G
4
Posts: 197
Reputation: 7,828

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 17 guests