procedural generation and connecting layouts

0 favourites
  • 2 posts
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • I've downloaded the free version of construct and I've been doing tutorials for the last week on platformers and arrays, and looking at some procedural generated arrays that create random layouts.

    I really like construct 2, it feels almost like the Starcraft 2 editor.

    Here is my question / problem:

    I've learned how to "teleport" the player to the next layout when they leave through a door, and appear in the next layout.

    I want to create something similar to rogue legacy. The rooms / layout are pre-made, but they are connected randomly. So the game would have to know which rooms have doors on their left, right, top or bottom and which don't, place a room next to it that fits that criteria, and do it again until finished. It would also have to remember the the order, so they player can back track, and possibly create a mini-map of the floor plan.

    It would also need to be able to loop around, find a room that has already been placed, and connect to it if possible.

    I fear I've bitten off more than I can chew, I just can't wrap my head around getting it to work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not that hard. Use an array. Different values in arrays could mean which room to load. "0" would mean no room there.

    Then you can make a nice loop to check for each array location to check neighbouts, and if 0, no door there. If not 0, there is a door. And to which room that goes is defined by the neighbours "number".

    Only difficulty lies in rooms that have more than one doors towards same direction. Imagine a large room with two exits to right. For this to work, the large room itself should take two "squares" or "positions" in the array.

    Or you could use a 3D array perhaps?

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