The case for a proper layer template system.

Not favoritedFavorited Favorited 1 favourites
  • 5 posts
From the Asset Store
Create large maps with dynamic depth and precise sprite layering control in top-down games.
  • Hey Ashley and DiegoM. I would like to discuss a long-standing issue I've had with Construct, and hope to resolve once and for all. In all my time using Construct engines the only solution I've found to this is meticulous planning, brute force, or utilizing an external level editor, but I think it's worth seeing how it can be addressed internally instead.

    Scenario

    Say you have a level-based game with a ton of levels. Demonoire is a good example, although a full-scale game will have magnitudes more!

    Each level is a layout.

    Each layout has a set of essential layers: background, tiles, objects, foreground, etc.

    ...But now you want to add, delete, move, or rename one or more layers.

    Existing Solution

    Your only option is to do this, by hand, for each level. Every single of them. Every time you want to refactor your layers in some way. Potentially hundreds or thousands of manual operations.

    Close-But-Not Solutions

    Global Layers are a way of solving a similar issue, where you want a static set of objects to appear in multiple layouts, like an HUD or Pause Menu. They do not, however, serve as a template to organize, manage, or refactor layers on a grand scale.

    Actual Solutions

    Recently, the layers bar was updated to display a global layer's sub layers, but they are grayed-out.

    Funnily enough, allowing us to place objects in those grayed-out layers, while leaving the master layers empty, would be a legitimate solution here.

    With this I'd be able to establish a global "LEVEL" layer, with background/tiles/objects/foreground as sublayers. Simply adding this "LEVEL" layer to each of my layouts gives me my template, and it can be easily refactored by adjusting the master layers.

    Of course, I understand that the layers are grayed-out to prevent unexpected behaviors. I only present this as one possible solution that utilizes the existing global layer system.

    Soooo maybe we can either...

    A) Keep everything as it is but give global sublayers an option to not be grayed-out in other layouts. An "only do this if you know why" kind of thing.

    B) Introduce an alternate type of global layer...perhaps a "Template Layer" that functions like a global layer but does NOT inherit the objects from the master layer, and whose sublayers are not grayed-out in other layouts.

    Ideally we'd still be able to, in any given layout, add a unique layer into this "template." This way you can have your basic level template but allow special cases where needed.

    Final Thoughts

    Of course there are maybe other solutions, I'm just trying to think within the box of existing systems. As noted, Global Layers are very close but serve a different purpose. I am not trying to inherit objects here, I just want a sort of Layer Template/Set that I can easily manage and refactor on a grand scale, saving me literal days of arduous work in some cases. Thanks for reading and I look forward to your response!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you tried working with the .json files?

  • Have you tried working with the .json files?

    It would take some pretty hacky scripts to batch process layout .jsons in this manner. Not to mention managing objects in some cases, sids, and it generally being an awful workflow.

  • Global layers wouldn't work for this because in the editor they are effectively the same as the source, making any changes to them is actually changing the source, which propagates the change to all other global layers with the same name. That would be the same for the sub layers, assuming you could edit them directly, I decided not to allow that because of a potential plethora of problems. If you open the layout where the source global layer exists you can edit the sub layers and the changes are propagated to all other relevant layouts.

    What you are describing is different though, we would need some kind of new system to define a template of layers, which when used in a layout, all the layers in the template would be created, essentially acting as a shortcut to creating all those layers manually. Then editing the template would somehow update all the "real" corresponding layers in each layout, that would include adding, removing, renaming and sorting layers.

    Sounds like a massive feature :)

    Edit: Maybe not massive, but larger than it seems for sure.

  • DiegoM Well, on the editor side at least it would still work "exactly" as Global Layers do—Create some layers on a dummy layout, set them to "Template" or whatever, and then when a user makes that same layer elsewhere, its properties and sublayers propagate from the master. Beyond that they're just your typical layers. I would think some of the global layer bones could be reused here, but you know better than me of course.

    To be frank, I know it sounds extreme the absence of this feature alone makes me consider different game engines for level-based games. It's been requested many times over the years and Construct users just deal with it. It's kind of a terrifying thought to have 100+ levels that are wholly unique on a technical level. It's just unwieldly.

    My current project only has 15 layouts, very large and dynamically loaded with scripts and zone objects, and it's already a big hassle to change up a few things with the layers.

    Imagine I had 100+ levels share parallaxing background layers and I decide I want to change the parallax values a little bit for all of them? There are plenty of very normal cases like this that shouldn't be days worth of work and risk a repetitive strain injury in my hand ^^;

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