Layer questions

This forum is currently in read-only mode.
  • 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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)