Download

Procedural Creation through Blueprints

Some folks in the interwebs asked for a sample of how to spawn things procedurally via blueprint.

Here is a sample project for 4.9.2that illustrates the method. The main idea is to store references to Actor blueprints. In this project I have two base actor types, planets and houses. To begin your dissection, start in WorldBuilder->BeginPlay.

The primary work-horse in the project is the WorldBuilder actor. The way it is meant to work is that you drag a WorldBuilder actor into any level, set all the parameters in his dropdown and when you hit play BOOM it creates everything.

There are lots of ways to go about this and I could list a dozen caveats and issues with this project. It’s not perfect, but is meant as a starting point for those that aren’t sure where to begin.

This should probably be moved to the Community Content or WIP forums.

It will more than likely get more exposure there for the type of content it is.

Looks great though, well done! :slight_smile:

I played with such stuff, and there is one big problem, you cannot see created world in editor. Construction script fails for this miserably. Also “Begin Play” as i heard is not reliable, not everything is loaded on begin play event.

So for now only one way is like “dungeon architect” does.

You must have heard a specific example.That’s not the case here, begin play is as reliable as you make it. Also there’s a bit of difference between procedural creation and randomization, this example falls on the randomization end where every play is different.

Dungeon Architect is a plugin that uses threading and other stuff that you can’t do in blueprints. So beyond using the plugin itself, there’s not a way to just use the same method in the blueprint world.

Yeah, I don’t think begin play is unreliable if you are using it right. It can only sometimes be a problem because you don’t know which actors’s Begin Play event will have been called first. People should be explicit about the order things happen, and not rely on Begin Play if things have to happen in specific orders.

hey man i dled the sample project but theres no content in there when i open up the project in Ue4 but theyre in the folders. How can i get them in th