Performance question, layout and Z-Order

Get help using Construct 2

Post » Sun Feb 23, 2014 2:27 am

Hello,

I am building a webapp using Construct 2. I am afraid that the way I'm creating all the app is not performance-friendly.
Instead of using multiple layouts, I am just using one single layout.
Pressing buttons to change between pages from the app is just switching Z-Order of sprites,texts and other stuff...
About performance, if I am keeping all my sprites inside the user view but only some are actually seen (like tileset size of screen on top of others sprites) are only those seen being draw to the screen, or even those on the Z-order bottom are being processed?? If so (i think that it is the case), what's is the best way to avoid this ? Multiple layouts ? Moving sprites off-screen?

Thanks!
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Sun Feb 23, 2014 3:03 am

Without example Capx it's always a bit hit/miss to give any performance hints. Have you checked this with multiple browsers and with debug window active.. With it, you should be able to see what's taking the time.

As far as I know .. all active (marked visible) objects that are at the visible screen area are drawn. So IMHO it would be smarter to move unused elements outside the visible screen instead just hiding them behind the background.
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Post » Sun Feb 23, 2014 3:40 am

It's not slow... yet.
Maybe this, making things invisible, would solve my problem...

I don't know the debug window you talk about.
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Tue Feb 25, 2014 2:51 am

Bump! And I realized that I am on the wrong section, this should be in "General Discussion"...
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Tue Feb 25, 2014 3:55 am

When you use Construct 2, there are two buttons at the top one next another.

Left one is "run layout", that opens your game at the browser normally.
Right one is "debug layout" which opens the game with a debug window attached. Debug window (bellow your game) show a lot useful info of the game, like cpu usage, frame rate...
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Post » Tue Feb 25, 2014 1:18 pm

Performance tips (notes points like the number of layouts does not affect performance)

Optimisation: don't waste your time (you probably shouldn't worry about it already)
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,625

Post » Wed Feb 26, 2014 7:14 am

I'm aware of those tips Ashley.
Weird that I can't find the debug icon or option. My construct license is the early adopter.

I am aiming to mobile webapp, so this is important. I have around 100 objects (sprites, sprite-font,etc). This was enough to slowdown my iphone 4 safari's performance.
I imagine that the process that handles the graphical drawing can't calculate whether or not some object is or isn't visible if laying behind other objects (Z-Order). In that case everything must be drawn.
I did a bit tedious job to add besides moving top/bottom of layers, to enable/disable visibility.
And once again I can press a button on iPhone and feel no delays, much more responsive! So, whenever you can, you should set invisible what you don't want to see. Don't know if the out of screen position trick works. The next optimization here should be to also disable all collisions of those invisible objects.
B
5
S
1
G
2
Posts: 44
Reputation: 1,470


Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 43 guests