How do I Rogue Legacy Style Room Generation

  • Wondering if there's anything that can generate a map using premade rooms like in Rogue Legacy. I can't find anything, but that's what I'm looking for!

  • These are referred to as 'prefabs'. They're used a lot in roguelikes, and the community over at reddit.com/r/roguelikedev recently had a Q&A on this very subject, it's well worth a read here ( https://www.reddit.com/r/roguelikedev/c ... p_prefabs/ )

    Your shopping list should be:

    1. A way of writing prefabs to storage

    It depends on how you want to build your world. If you can use tiles to build your world, brilliant - you can use a multi-line string to represent your prefabs. If not, you're in for a rockier ride which will likely involve writing a basic level-editor to save the correct metadata for you.

    2. Storage device for holding your prefabs in your project

    Again, assuming a tile-based world, I would use an array for this. Fill the array with a different prefab on each Z-index from (1).

    3. A way of stitching them together into rooms

    In its simplest form, this would probably look a lot like Primm's maze generating algorithm. ( https://en.wikipedia.org/wiki/Maze_generation_algorithm ) Essentially you start from a given point, and continue adding prefabs into vacant spaces in the world until it's large enough for you. As you go, connect each new prefab to an existing prefab placed before it. Et voila.

    I am aware this is a vast over-simplification, but a full explanation would be... lengthy. Good luck!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I wonder if that's what they used here for this tripped out game:

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