Level Generator with Rooms Presets

1 favourites
  • 6 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Today, I'll show you an extremely simple way to build an unlimited number of levels for you platformer game. So, one of possible way to create level generator is to make several smalls scenes that will be combined into the main level.

    For this template I took the graphics and trap mechanics from the Construct 3 Example Browser.

    How its works

    Layout "Presets". Has several layers, each of which is a small scene containing a tilemap and objects (coins, enemies, traps, etc.).

    Family "Objects". Includes all the objects placed in Layout "Presets". The family is necessary to reduce the number of events and simplify working with objects.

    Dictionary object. On start of layout "Presets", all objects are added to the Dictionary. The name of each key is "object name & layout name & object IID". The content of each key is the objects JSON.

    Layout "Main" is an empty level. When this layout starts, the level is build by a loop and random preset selection. The object data (JSON with position, variables and everything else) is taken from the Dictionary. The coordinate of each object gets additional adjustment using "curX" variable, which means X-offset for current scene.

    Try this on Arcade

    Download template

    Please, upvote this post if you like this. I have a few more ideas for developing this template, but I would like to know if anyone is interested and if you want to see more my templates.

    Tagged:

  • This is fantastic! Thanks a ton for sharing it. The approach you took is really interesting (and so simple!) and I'd certainly love to see how you develop it!

  • Really simple to understand and easy to use, thanks for sharing! Could be used in a lot of cases while generating procedural levels. I've saved it for later.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much for yours feedback! It's really important to me. So, I have prepared an update to this template with several new features.

    Added a start and finish rooms. Now a levels have a more complete looks. When the player reaches the flag (located in finish room), they move to another generated level.

    Added a variable maxLevelWidth, which allows you to set maximum width for generating level.

    Added a function that automatically matches the Y-offset of each preset. This allows you to make more complex level geometry.

    Try this on Arcade

    Download this Template

  • I love the improvement, adding extra layer of dynamic to level generation.

  • This is awesome, thanks DarkViGaCi for sharing! Everything works very nicely and level presets are easy to set up & edit, great work!

    Some ideas that came to mind that could make nice additions to this template if you decide to develop it further:

    - Random seed value that would always spawn the same randomized level layout when the same value is set.

    - Option to have pre-determined level presets at set points of the level (could be useful for checkpoints, power-ups etc.)

    - Option to allow level preset to appear only once per level to prevent same preset appearing multiple times in the same layout

    - Way to set the level theme (different tilemaps) / difficulty (which difficulty level presets to use), maybe controlled by a variable?

    Just some ideas to consider in case you continue to work on this template:) In any case it's already very functional and cool way to create randomized levels as is. Thanks again for all your work and for sharing this template, it's very much appreciated!

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