Random room generation

I have been trying to create a spelunky clone like level generator.

Can somebody give me a blueprint that will generate levels like this?

^This^… :stuck_out_tongue_winking_eye:

1 Like

I think there are several options in the unreal marketplace
Have you checked it?

I share a lot of my knowledge for free in these forums, I don’t know why people can’t ask for something free before looking at other options, without being harassed.

Ok here is a more in-depth explanation:

There are 5 rooms, Each has a location in an array

The game starts with a random integer that is gonna determine where the StartingRoom is spawned

Let’s Call this integer A (0-4)

This is the starting room, Let’s say this has an orange color

Then another random integer is rolled, Let’s call this integer B (0-4)

that is gonna determine where the UpRoom is spawned

This is the UpRoom, This is the room that has to have an opening at the top

Every room between the Up room and starting room is a corridor room, They have to have openings at both the left and the right so the player does not have to use any bombs to create a way

all the other rooms become optional rooms, these rooms can have openings, but can also be closed

Then when everything is done move all the actors where the location is saved in the integer up 1000 and repeat, But instead of a starting room a DownRoom is spawned above the UpRoom, This room has to have an opening at the bottom

Then integer B is reRolled to determine where the next Up room is gonna be, Fill in the rooms in between the DownRoom and the UpRoom with corridor rooms

When that is done all the rooms left become bedrooms

Repeat this until the last layer where instead of an UpRoom a finish room is spawned¨


If A = 1 and B = 3

Room 1 become a starting room and B become an uproom

2 become a corridor room and 0 and 4 become optionalrooms

If A = 4 and B = 1

Room 4 become a starting room and 1 become an Uproom

3 and 2 become corridor rooms and 0 become an optional room

If A = B then a special room is spawned that is both an UpRoom and startingRoom at the same time, The rest become optional rooms

I suggest exploring MP products like Dungeon Architect and searching for procedural in the Community Tools section for 2D sample projects / games. :wink:

  1. OP hasn’t done anything to show they’ve tried to solve this on their own… I could have just ignored the thread completely and let it die like so many other zero-reply threads on here. Would you still have replied anyway that’s the question (as I did bump the thread at least). Recently challenged three other OPs. Why? The UE forums are dying. Posters often just spam the same question across multiple channels anyway hoping to catch a fish. Think Discord, Reddit, Polycount, YouTube, Twitter, Twitch, Github, Daz3D, StackOverflow and so on. Even if someone on here takes time to reply or provide an answer, many times the OP doesn’t even follow up, not even a one-word thanks. That seems counter-productive, as it just makes the forums die even quicker. So challenging the OP a little confirms if they’re planning to return. So it offers some idea if its worth posting anything or not.

  2. Overall, things can’t continue the way they are, where the same usual suspects answer threads and no one else does. Where’s the positive-feedback-loop to create incentives for new contributors to join-in on and keep the forums going? Epic are primarily to blame here. First they asked for suggestions about rebooting the forums 2/3 years ago, but never followed up on any of the suggestions. Second, Epic give out free assets each month to everyone for nothing. That just rewards failure! Instead they should only give out free-marketplace-credit / one-time-UDN-access / promotion-on-EGS, or other incentives to those who actually help. Third, even the Unity forums are better and get more interaction from official reps. This has been confirmed multiple times on here if you want to search.

  3. I’ve less time to post now than I used to. But I still want the UE forums to be a thriving community a decade from now when UE6 / UE7 / UE8 ships. But if there’s such a sharp falloff in the forums or an imbalance of people just posting now to get help / solve their problem / get assets, and yet they give nothing back - how long can this go on? Posting answers now often just feels self-defeating. Other people need to step-up and keep the Community alive other than devs who’ve been contributing across 3+ Epic engines for a decade or more. Otherwise there will be nothing left of the forums, with info split-up across so many other channels its impossible to find, versus having valuable info contained in one place here. :wink:


Dang bro that’s deep

I’ve been trying to learn unreal for 5 weeks now, been doing pretty well in fact (besides procedural generation it’s not working with me) but you have now got me motivated to help people
That’s cash money homie



Never expected that someone will use my comment anywhere XD

@DomusLudus - nobody’s being harassed here :o

If he wants something for free - look the internet through for examples, codes, ready BP’s, whatever
Coming to a forum, placing the first thread ever and “gimme bp that makes rooms”, if he gets it the same day another post “gimme working character”, another day “gimme enemies and bosses” and so on…

There are plenty of places where you can find this useful stuff called information and googling stuff doesn’t harm you

Also sometimes buying some good stuff is a good idea to support creators
here some cheaper one which is also amazing!

@abugust - Remember that 3D technique will also apply to your 2D game as it also exists in a 3D space anyway

Regarding the post again:
In my eyes it’s just spam, you may see it other way but try asking random people on street for clothes, cars, houses, coffee beans, nivea shampoo or whatever’s not a cigarette or food if they will give it away to a stranger :slight_smile:

If they know you - it’s easier, as a stranger - at least put some effort into it to convince people ;]

Even some nice posts are being skipped and not visited so much therefore if your post looks good - it makes the people happy and soft to at least point you in the right way. Well, later he updated the post and the comment looks AMAZING now! ( I kindly advice you to put that text as post description :stuck_out_tongue: )

@AntiGravity #Point 1 - I totally agree with that!

We don’t mind to help people look for stuff, sometimes our Google does better :P, we also don’t mind advicing or sharing our stuff but like just said - it looks like he didn’t even put any effort into searching, maybe he did but the original post looks like waiting for others to do your stuff done and that’s it…

And I like that you @DomusLudus offer help as well, that’s always good, we do as well but we also wanna have the Forum organized in some ways, for us no effort from poster - no effort from our side (at least regarding requests, cuz we put much effort into writing the comments XD) and once again - Nobody’s being harrassed here!

And the update on his post looks so well that I even started googling! XD
He showed he knows already something about the Engine, knowing that I know now that I can advice him with this, this or this and this one even has an example project so you can play around! Oh, check this one out as it also contains a project!

I know, they all don’t look like in Spelunky
Check out this video - it explains exactly how such levels are generated and instead of Noise pictures - you can work with numbers to generate different things ;]

It’s not as difficult, you just need some strict rules, as an example - you know the map XY size, from that you can apply math to create some long floors that will never reach X max size to create a hole, add some blocks above and below to create differences and so on, it’s not something to explain in raw text but it’s a tip from my side that with math and some rules (booleans and math again) you’ll be able to create simple map, more complex just needs consideration of more rules

Also a lil teaser of my room generator based on some settings

// Sorry for 5 edits - made some spelling changes XD and added some more text

1 Like


For anyone looking to learn how to make Procedural BP work it’d also be worth looking at what @CoquiGames is working on and dissect PCG to see what’s possible. Thread / Video.

1 Like