I have some models such as rocks, mountains and cliffs and I aim to create a number of variations of peaceable Blueprint Actors from these assets. E.g. A canyon with huge cliffs covering each side and the canyon has 2 entry points, or a small circular area encircled by rocks that has 3 entry points, etc…
My question is, I couldn’t find anything about this subject, how can I generate a level using these Blueprints from my pool of selection, by procedurally connecting these BPs by their entry points only?
Here the generation starts off with Room A, which has 4 entry points. And the red and green rooms are added by their entry points procedurally to Room A’s different entry points. I’ll have a lot of constraints however, to keep things simple a simple connection is enough. Entry points that are not connected can be considered sealed doors. And for the sake of simplicity again, let’s consider this is the whole level.
How can I make these separate BP’s connect by their entry points?
But how can I start implementing it? I couldn’t find any tutorials or any discussions about this subject. The connection points will be set in the BP of any “terrain piece”, it’s just a matter of connecting those. However, I do not know how to do it in Unreal.
I understand that to attach something to a mesh, or skeleton, sockets are used, but I couldn’t find a way to add a socket to a BP Actor class.
Thanks so much for the effort to create this for me! I’ll put it in my project in a few hours and understand what it does and how it does.
As far as I can tell, you started off with all exits stored in an array for the starting piece BP (aka Room A), and you iterate through that array while placing new Room Pieces on those exit points with an offset. I do not yet know what Box Overlap actors does so I’m just assuming. Will this also be connected to the new piece’s connection point?
Is GI_C a custom class you have created btw?
How should I store exit1, 2, and 3? Will they be empty collision boxes or sth?
And maybe it’s because I’m using UE 4.27, that I cannot find some functions or I didn’t understand some of it:
I’ve checked the video out but I can say it’s different than the method I’m trying to use. Mine should be much more simpler and gives me more control on how I want the levels to generate to some extent. I just gotta find out how to spawn actors by their predefined connection points and that’s it!
I’ll add many more conditions to create more compelling dynamic levels but first I need the base set up done correctly. And that would be spawning Room A and Connector X by their connectors!
Spawn stuff at location, offset it by the other piece’s socket location to align them.
Mine should be much more simpler and gives me more control on how I want the levels to generate to some extent.
For something more advanced, it’s hard to not recommend Wave Function Collapse - it’s a staple of procedural generation. Too many applications to list them.
I’ve kind of solved the problem. What I needed was simple. The game would spawn a Start Piece on the world (selected from an array of Start Pieces) and then loop through its connection points, in this case I made them Capsule Colliders, and spawn random Connector Pieces (again from an array randomly).
Now I’m trying to match the connection points angles face each other. Once it is solved it’ll give me a huge flexibility to use different angles with different heights too. I’ll just need to model and create Blueprints that can be placed next to each other looking seamlessly!
The z coordinates are different that’s not a big deal, I’ll just need to reposition and rerotate them to look seamless. However, this is the big step for me! This might look horrible but it’s working And it also generates new shapes with each playthrough.