Dungeon Tile Connection 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.

I have a self spawning maze:

300649-inmaze.gif

The nice thing is, only the part you’re in exists ( this is from above ):

300662-abovemaze.gif

I have re-coded it several times and it’s now quite elegant. Would you be interested in this system?

Thanks for letting me know but this sadly doesnt answer my questions :S ?

How not? This is exactly what you’re talking about, no?

( what I mean is, I don’t want to go into a lot of detail if it’s not for you… )

And iam interrested in understanding how it works :slight_smile: and not in buying something or so.

It’s ok, I’m not selling :wink:

I will give you a very brief idea now ( coz I have to go in a moment ), just ask for the bits you’re most interested in.

Ok, so you basically ‘segments’ of the dungeon, which can either be blueprints ( just a BP containing meshes ) or merged meshes.

As the player moves through the scene, the main BP spawns new sections, destroying the old sections as we go.

The nice part is in how to connected them.

Initially, I kept records of what was connected to what, releasing thing as we went, but that ( I can tell you ) is major pain in the butt. Because of the different ways the player can move, you can end up with the parent of a new segment begin destroyed by the child it has spawned. It’s a bit messy.

The system I have now has overlap volumes at the connection points. Whenever new parts must be made or old ones removed, the BP just looks at these volumes to know what to do, no need to keep records of what is where.

Tell me if you want to know more, and I will give you more details later, when I have more time…

I put a comment on this which seems to have magically dissapeared.

I’m not selling anything.

The system works with overlap volumes, much easier than working out what is connected to what.

Will get back later with the details, but have to go in a minute…

Okey do this :slight_smile: would be nice ofc maybe i can get some idea and work it out a bit. But i guess its not that what i need at the moment cause the island part are static so they need to be there the whole time.

Ah, so you want the whole thing to just generated once, and then the player walks around it?

If that’s the case, then my idea is not for you.

You might want to re-post this, as it looks like we’re deep in discussion here, might put some people off. Also, the forums is a better place for this, if you want discussion, that’s the place :slight_smile:

Ye exactly but maybe ur idea gives me a overview how to handle what to place next ? :slight_smile:

Ok, back.

So, first thing you need to ask yourself is ‘why generate the whole thing up front’?

Doing that gives you 2 problems:

  1. Drain on the system of having a couple of hundred BPs or meshes, when all you need is enough to surround the player

  2. More difficult algorithm. If you’re spawning around the player, you don’t have to worry about segments overlapping each other, because by the time the player gets to point B, point A has been destroyed. If you’re generating the whole maze in one go, you have to make sure things don’t intersect.

That said, here’s basically how my system works. If you want more info, come back to me.

( rest coming in a moment )

I have blueprints containing the building blocks of the system, here’s an L:

Things to notice are:

  1. Red arrows are spawn points. I don’t want to have to think about where exactly to place something when I get to spawn. This way, I just set the ‘transform’ to the arrow component.

  2. Collision boxes ( 4 ). These are to do with the dynamic system. I want to know when the player is ‘walking in’ and ‘walking out’ of the L because, that’s when you spawn or destroy.

Once running, you can apply different materials to the L, ( garden ):

Sci-fi:

and so on.

You also have different shapes ( center ):

T:

You can see with the T shape, there’s a lot of ways of connecting segments from the arrow components. Also notice the small boxes, separate from the larger in/out boxes:

300719-smaller.jpg

They control the coupling.

Every shape has overlap boxes at connection points. You can tell if something is connected by a test:

  1. Is there an overlap?

  2. Did I spawn this or did it spawn me?

Number 1 on it’s own is not enough because as you make more complex systems, there will by chance be overlap when the segments actually have nothing to do with each other, hence the second test.

When a segment is spawning connections all it has to do is use a ForEach loop on the arrow components, each time asking ‘is something here?’, if not, it’s ok to spawn.

When a segment is destroying itself, it just has to loop round the connectors and use a function to get a reference to the connected actors ( no need to store this info ), and destroy them.

There’s other subtleties I haven’t covered here. If you are interested in using this concept, come back if you need more info :slight_smile:

Wow nice detailed anwer :slight_smile: Actual i did some BPs with like Entry Points. My struggle right now is where i handle it like spawning the next tile. I dont know how you handled that or do you start with only the start piece and then when the Player walks into the collision box the Collisionbox Script will spawn the Next tiled cause its connected to the Arrow ?

Or do you spawn like 3-4 pieces at Start but then where and how you handle the Spawing ?

Do you spawn the first tile then get the Points stored in the BP?
If yes how :slight_smile:

Guess this getting a long long Comment Section here xD

The level actually only contains one piece. The player gets spawned right above an overlap volume and the the moment they drop, the piece spawns other connected pieces. You can’t see it happen at all.

Each piece decides what gets spawned, much easier than having a central controller, that is a nightmare ( been there ).

So as the player walks into the T ( for instance ), all you need is to spawn the pieces at the top of the T. So you have where they just came from, and the two top pieces. There’s actually nothing else.

So the T knows it needs spawning. The center knows what it needs etc etc like that.

Same when the piece die, they know what they need to kill. They know what’s connected.