How do I Rogue Legacy Style Room Generation

Get help using Construct 2

Post » Mon Apr 03, 2017 11:42 pm

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!
B
35
S
5
Posts: 411
Reputation: 3,406

Post » Tue Apr 04, 2017 12:23 am

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!
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 237
Reputation: 2,296

Post » Wed Apr 05, 2017 1:18 pm

I wonder if that's what they used here for this tripped out game:
tripped-out-rogue-quot-lite-quot-action-platformer-game-devlog_t164603
B
35
S
5
Posts: 411
Reputation: 3,406


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests