Good way to procedurally generate level from premade rooms?

0 favourites
  • 2 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hello! (I wasnt sure if should I post it here or in how-do-i section so sorry in advance!)

    Since I am back to working on my 2D rogue-like platformer game I had to start figuring out how to make the procedural generation happen.

    Since the levels will be generated and filled with the premade rooms (each room is a separate layout) I decided to start small,

    make it work and then ask the brilliant Scirra's community some questions!

    This is what I've got so far:

    8x4 array that is filled with "1" numbers wherever the room is placed (black cube - room, gray cube - empty space)

    First it starts at some point and then the generation is continued by random directions and followed up from the next recently placed "room" in the same fashion to reach the desired number of rooms.

    And I am stuck at this point. I want to fill that with the actual rooms, avoid dead-ends and fit all the entrances in the same time.

    Entrances in each room are also premade so one room can have left/right entrances and another room can have left/up entrances, like this:

    I'd like to know how would you do that so I can find an efficient way to work it out. I was thinking about putting each types of rooms in separate arrays and then choose rooms from specific array when the specific conditions are required but I think it's too much since there are so many combinations.

    To sum up:

    I want to generate a level (which I figured out more or less) and fill it with the premade rooms which contain premade entrances and note that each room is a separate layout.

    Best regards!


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This tutorial by stemkoski answered all my questions concerning procedual room generation. ... elike-game

    It's awesome. Check it out!

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