[UE 5] Blueprint - I need a better way to control the loop

Just joining in what has been an interesting discussion to read. Great advice from @ClockworkOcean - I would just add, before you do too much more design on the linking and orientation that you need to think about the size of the rooms and what to do if a corridor chain comes back on itself. At the risk of making this too academic you might want to look at some of the work done on maze design algorithms. Wikipedia is a good start for this. Maze generation algorithm - Wikipedia

I don’t know how to do it if I have two or more directions :smiling_face_with_tear:

I agree with you and @ClockworkOcean that what he suggested looks more logical and better than what I’m trying to do.

Then, I think that it is impossible to do it in such a way as mine?

It’s possible, but you might go mad… :wink:

Ah, I thought you were talking about the rotation of the piece. You mean, where to connect the next piece?

You need to have a loop for each possible connection point:

I think maybe that’s what you were missing?..

1 Like

yes, but I summed up all the information that I received from you and from @Light_Shock, and now I think that I really will go crazy, since I will have to find out the free space for the rooms later. May I ask other questions in this thread that are not related to the topic topic?

P.S But I look at this screenshot and see that I have a chance and I want to try to do it

Give it a try.

I can tell you, because I did this in my game, that this maze thing is pretty involved.

What was the other Q?

I just thought about doing it manually, because I think that I will not succeed. And I wanted to ask how can I make object presets? For example, I have a wall and doors, and I want to place them together at once, not separately.

Ok. Your head’s going to explode :smiley:

Let me show you what I have here. I’ve got it down to ONE piece of code, there is NO other code:

In my master BP

It already gives me unusable combinations, even without doors and rooms!:

maze

2 Likes

If you want to make ‘presets’, then just put some meshes in a blueprint. No code, just like this:

1 Like

I repeated the code that you did earlier, and I got what I wanted. It remains to correct the errors in the numbers. And then I can fully explode :rofl:

your code:
image

I just noticed that nothing has changed there practically, but it works :sweat_smile:

Very cool. It looks very simple but at the same time very difficult for me. :rofl:

It’s all to do with making the pieces correctly. The bits need their pivot points in the right place, and the spawn points.

They have the correct pivot points, it’s just that my corner branch doesn’t match in size :sweat_smile:

3D version, same code :wink:

maze3d

1 Like

I’ll tell you what is easier, from a lot of viewpoints, and that is spawning the maze as the player is walking round.

That gets rid of a lot of problems, like overlapping corridors, rooms etc.

Because you only need to make the bit near the player, and you can destroy the parts they are not in.

For this stuff i don’t have a stairs 3D model, but it’s very cool, i like it

1 Like

Yes I used the spawn as they go approach - took it to an extreme by just having each node know what it was connected to and having doors that closed when you went though them I was able to deliberately have the maze not make real world senses so I could turn them around or have them keep going forward but end up in a room they had been before etc.

1 Like