A lot of LAYERS

Get help using Construct 2

Post » Fri Oct 09, 2015 10:00 pm

Hello! Can someone tell me, is there any really difference in use of many layers in Construct 2 and why they slow down performance? The reason why I am asking this is that I opened built-in source file of game Space Blaster and tested it on my Android tablet Ainol Aurora 2. It was great, smooth 50-52 fps. Then I add 20 fully empty layers in this project, compiled it and tested again on same device. The result was different: max 46 fps and often fps drops to 24. :(
B
6
S
1
Posts: 24
Reputation: 332

Post » Sat Oct 10, 2015 1:19 am

Layers are things to load... over the entire screen...

but I'm surprised at how low it went with 20 layers... (Although you should never need 20 0_0)
Eat ALL THE BACON!
B
47
S
17
G
3
Posts: 290
Reputation: 5,070

Post » Sat Oct 10, 2015 5:01 am

You have to realize Layers although empty do contain information. So if you have a ton of them it is going to eat at your processing power. When you create a layer it basically creates an image the size of the layout. Transparent or not it is still there in memory. So every time you add a layer to a 1280,720 project it's like adding a 1280,720 image. At least that is how I understand it.
Image
B
47
S
17
G
3
Posts: 206
Reputation: 5,061

Post » Sat Oct 10, 2015 7:27 am

Here is a quote from Ashleys article on Performance Tips:


Number of layers usually has no effect, unless most of the layers have changed their opacity, have effects applied, have a blend mode other than 'Normal', or use 'force own texture'. However typically there is no performance impact from using multiple layers with default settings.


So if you are really seeing such a performance drop, it might be worthwhile posting a minimal bug report showing the before and after .capx.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,484
Reputation: 59,754

Post » Sat Oct 10, 2015 1:54 pm

Maybe @Ashley will tell us something about it?) All of 20 layers have DEFAULT settings, NO opacity changed, No effects applied, NO blend mode other than 'Normal', NO use 'force own texture'
Last edited by Joe Bookmaker on Sun Oct 11, 2015 10:48 am, edited 1 time in total.
B
6
S
1
Posts: 24
Reputation: 332

Post » Sat Oct 10, 2015 2:00 pm

antares330 wrote:Layers are things to load... over the entire screen...

but I'm surprised at how low it went with 20 layers... (Although you should never need 20 0_0)

It's very comfortable to work with objects on them. For example, I have every menu window on different layer.
B
6
S
1
Posts: 24
Reputation: 332

Post » Mon Oct 12, 2015 2:38 pm

20 empty layers should use effectively zero CPU, GPU and memory. An empty layer is basically no overhead at all. So adding 20 empty layers should not have any measurable impact at all. My main suspicion is that there is variance in your test measurements, but if you think there is good evidence there is a measurable impact, please file a bug report.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Mon Oct 12, 2015 7:51 pm

Ashley wrote:20 empty layers should use effectively zero CPU, GPU and memory. An empty layer is basically no overhead at all. So adding 20 empty layers should not have any measurable impact at all. My main suspicion is that there is variance in your test measurements, but if you think there is good evidence there is a measurable impact, please file a bug report.

I will try this test again and report in case of same result. Thank you for answer.
B
6
S
1
Posts: 24
Reputation: 332

Post » Sun Oct 23, 2016 8:53 am

I also have the same issue, I added only 3 layers and it reduced the framerate significantly....
40% CPU usage and 45FPS, same result even after deleting objects from layers...

Anybody got the solution ?
B
9
S
2
Posts: 76
Reputation: 739


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Syazanie Amirin and 8 guests