Layer questions

For questions about using Classic.

Post » Fri Jun 04, 2010 6:17 am

1. Do layers cause slowdown? In MMF2, if you use more than 1 layer it usually causes the game to slowdown a bit.

2. Is there a limit to how many layers you can use? I'm probably going to want to use 50 - 100.

3. I was wanting to use a lot because I wanted to move objects to different layers to have more control over the Z order. Just like you can "set Z elevation" of sprites, except I didn't want the objects to change size. So hopefully this is the best way to do it?

I'll probably have 2 sets of layers one with point sampling and the other with linear, so I can swap the objects between the billions of layers depending on if the user wants the objects smooth or not.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Fri Jun 04, 2010 6:24 am

That's a lot of layers, but really the only thing that should slow it down is objects, fx, and what ever actions you have going on.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Fri Jun 04, 2010 11:56 am

50-100 layers is way too many in my opinion. Layers should not be used for fine grained Z ordering, that's what Z ordering itself is for. Layers are useful to group large numbers of objects in Z order, like background, foreground, parallax layers, and so on, which means generally you'd have under 10 layers.

Layers are fast if they have no effects (no shaders, and opacity must be 100% and filter white). In this case objects are just drawn directly to the screen as if everything was on one layer. Otherwise, the effect has to be processed on a separate texture, which can be expensive, but is still fully hardware accelerated. Processing 50-100 layers with effects will be very slow, but without any effects they have no performance impact at all.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Fri Jun 04, 2010 1:56 pm

Thanks for the replies. I won't be using any filter effects, so I should be fine it seems. This would save me having to 'always' run a loop to sort the objects.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 13 guests