[VIDEO] Semi Automated Procedural building system in Unreal Engine 4.0

Unreal Engine 4.0 Procedural Building System I made.
A semi-auto system that allows a user to input meshes and it gets ‘arranged’ in a reasonably intelligent fashion. Added some utilities to allow it to integrate with other surrounding buildings better ( such as UV tweaking, smart facade system , etc ) .
The objective of this system is to help us construct modular building in a faster manner and also to allow limited runtime randomization of the environment.?

Very Awesome - Cannot wait to see more!

Impressive work!

That looks awesome! Would it be possible to implement interiors as well?

Great job!

Very cool! I love procedural content :slight_smile: I gave a talk at GDC a few years ago on a procedural building system we were experimenting with in UE3:

I’d love to find a way to do something like this elegantly in Blueprints…

Are you going to share or sell this?

Thanks for the like guys…

@sitrec ; interiors on ground floor would work, but anything spawned by blueprint will not have static lighting. Sadly. thus it will be forced to use dynamic lighting.

@JamesG Oh , so that’s where the UDK ProcBuilding come from. I guess the Custom LOD part would be the biggest limitation approaching this from a blueprint angle. And also the part where I cannot have static lighting on blueprint spawned mesh ( and when the building gets regenerated during run-time with possible changes). Yes, I’m the one who asked the same question on your youtube channel :stuck_out_tongue:
In fact, I had to find workaround on my blueprint-based system by limiting the static lighting to only the root component. I’m now in a dilemma if I should randomize ground floor shops and forcing them to be dynamic lighting or manually place shop
in order to enjoy static lighting. I very much look forward for a construction script that runs only in Editor that affects save-able content without having to touch code.

Why not? Is it not possible to build lighting after the BP generates the buildings? What would it take to be able to do that?

Static lighting certainly should work on components spawned by a Construction Script (as long as their Mobility is set to ‘Static’). If you are seeing otherwise, could you post a repro on Answer Hub and we will get that fixed!

Is it possible to see the U3 Kismit layout? I would love to see if i can addapt this and expand on it and make a tutorial for this. Mainly because I’m a programmer and making Art Assets programatically excites me to no end.

This wasn’t done with Kismet, it was a whole custom system and editor because Kismet isn’t powerful enough for this kind of thing. I hope that I can find a way to let you express this kind of recursive grammar in Blueprints. It is probably possible now, but wouldn’t be as simple as I would like.

Where these’s a will there’s a way. I’ll figure out this da vinci code…

My professor stated that the best programmer is a thinker that’s too lazy to do a given operation multiple times so they will create better solutions.

I will find this solution.

@JamesG appreciate you spending time here.
I am a little confuse by what you mean by “(as long as their Mobility is set to ‘Static’)”? If the assets are spawn via construction script,
wouldn’t it mean that they are not accessible via the components page?

Sorry for bugging you in this forum. I am in fact seeing otherwise. I am posting this in the bug report as of now.

You should be able to set the mobility for Add Component nodes in the User Construction Script by using the details panel to edit their template:


Michael Noland

It would be interesting in itself to provide a dialog for users of your app or game to add content in a procedural manner. I think for meshes that are significant props in the video game, I would not mind allowing users to skin props with decals and stickers or whatever.

Many of us would really enjoy a tutorial on how to build procedural content. If anyone has any examples in mind from You tube, please share.

Great stuff! Some questions: Is the procedural stuff done in the construction script? When exactly is it called - always when changing parameters in the inspector? And does the “click to re-generate” checkbox work (@ 1:05 in the video) - does clicking it call the construction script because the parameter would change but the script sets it back to true? Thanks!

A big thanks on that part. I really did not know Nodes had property like that. I just saw this similar solution in the Answerhub. I guess JamesGolding was right all this while. It was noob of me to missed that entire bar on the left.

Yes it is done entirely in construction script but with many layers of function. I’m happy to share the algorithm. But it’s actually a simple system. The “Click to Re-generate” button thing is a workaround I did because blueprint don’t allow spawning a ‘button’ on the object property. Essentially I split the functions into 2 part.

1)A one-off running. Determined by a checking of a var. If the var is checked, this entire tree will never be run again when construction script runs. However, if I uncheck this var, this part will rerun, and subsequently boolean gets re-checked. Basically everytime I Unchecked the boolean, this part will run and automatically re-checks. I use this section for things like randomizing materials and windows. This is a critical part of my system because if the walls are green, the static lighting will build it as green, and if the building is spawn as blue it’s going to look VERY wrong. Everything in this section only affects modifying of public vars.

  1. Spawning stuff tree; needs to be run every single time so that it keeps checking when the mesh gets moved around. Also this needs to be run so window will be generated when the game launch.

it’s a boolean that gets checked AFTER I randomize the stuffs, so after the boolean is checked, any further running of construction script will NOT run this section, and when I uncheck it.


Thanks for the detailed explanation! I’m currently trying to import tilemaps from xml/json files into the editor and that information should help a lot. :slight_smile:

Great work!