Dungeon Generation System

I work at the moment at a Dungeon Generator script with tiles in Blueprint and searched a lot about how to do this. Recommended here seams doing Tiles with Connectors which then decides which tile to place next depending on the allowed Connections.

My Question right now is how to start with this. I guess i need to use blueprints cause i need to store Data of the Connections and stuff but isnt this a performance problem at some Point?

So maybe a Option is to use streamed Levels but how i then get the Data of the Connection Points? Or is there another Option i missed?

And at least how i handle the placing. Like do i place the first tile and then check all connection Points from it to place the next ones or do i go in one Direction?

Some detailed answers would be really nice.

Here is a Example of a System in 4.18

What i want to get at some Point

Just let me know if there are more Questions

You are asking a highly creative question which leads me to believe you don’t have enough experience in coding, and you have a low-level account which might mean that you literally just started using UE4. You don’t need to overcomplicate this random generation thing, it can be quite simple to do.

I don’t see how it would be a performance problem unless your level is absolutely huge and lots of high res textures.

There is plenty of ways you could do random generation, the one you are showing is a good way to learn UE4, but can look quite bland and feel uncreative in a finished game. (In my opinion)

I would start out by making a bunch of models that fit together and are colour coded for their purpose, they would be basic Tetris shapes.

In the image you shared, try and break down how it was done.

It looks to me like the biggest part in the very middle is the root part for all the other islands. It would have the beginning connections and it would store all the main information for the entire map. But you can make the root look different every time if you want to, just by making some models that fit the task of adding together to make a single island (clipping will be a fixable issue).

You can also see an intersection island, check it out, its the + shaped island in the bottom left with a circle in the middle of it, and look it doesn’t spawn in one direction probably because there was no room.

There is also another unique feature which is the small floating rocks, I imagine that they can be used as something to walk on, this part is tricky, it looks like they are used to connect two islands that have been already spawned together. Hmm, when you figure that one out you will have levelled up as a blueprint coder for sure.

I’m not sure if the stairs are modelled as part of the islands or if they are procedurally generated, you could certainly try both. Just make each stair its own mesh and spawn at a location and the next one at the same location of the last stair with an offset on the z and the x (or y)

It looks like this Island was made on a square grid, its beginner-friendly, but not so appealing.

You are only showing one image of what you want, but what if you had a hundred images of these randomly-generated islands, would it look random? I don’t think so, I think it would look all very similar, this is why random generation isn’t always the answer. But this will be good practice for future projects 100%.

In each blueprint before spawning, you would probably check if the island you want to spawn is overlapping with anything, and try to spawn all sizes and shapes before finally giving up and spawning a little nub at the end.

You could store how many islands you want to branch off from the root island in total, that would control how big your level gets. You could also store the length in each direction of each island in some floats, that would store how far away it’s going in one direction.

And one important feature is that the finishing islands have a more rounded and unique shape, this makes the whole thing look more organic. Which is nice, otherwise the whole thing would look bland. This counters my previous comment, but you can see that the centre of the island does look square and uncreative.

So, each island has its unique purpose, to spice up the decoration, to create more directions for the player to go in instead of just going in a linear direction, the root, some floating islands and stairs to add a little bit more on the Z axis.

Yeah, if you wanna discuss more on the subject then feel free to ask more questions. It’s actually quite interesting. I would be interested to see other versions of this island.

1 Like

Did this information help?

well it helped me