Good way to procedurally generate level from premade rooms?

Discuss game development design and post your game ideas

Post » Sat Aug 22, 2015 1:48 am

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!
Posts: 109
Reputation: 3,380

Post » Sat Aug 22, 2015 2:47 pm

This tutorial by @stemkoski answered all my questions concerning procedual room generation. ... elike-game

It's awesome. Check it out!
Posts: 117
Reputation: 1,872

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest