procedural generated building
This is 35 E Wacker, one of Chicago’s iconic landmarks. Using the power of the PCG tool and a model from Fab, I was able to procedurally recreate this stunning architectural-style building in Unreal. My goal is to maintain the signature tower while seamlessly auto-generating it alongside the structure, ensuring that the intricate wall patterns and edge loop decorative designs remain consistent across specific level—from the grand lower floors to the elegantly detailed top.
Make a new PCG blueprint, rename it, drag and drop into the level map. Then create a trigger box and but it inside the PCG frame in world space. Tag the Trigger box to find it in PCG blueprint using the Get actor data.
There are 3 different pieces of mod-kit to make one side of the wall, The Windows, The Column, and The Corner
But The distance between each mod-kit pieces are not the same, to fix that I generated 3 groups of points for each type of pieces and manually rearranged and assembled them
This is the code for one side of the wall, "Self-trimming" the points from Volume Sampler, then use transform point to assemble them, repeat this 4 times and you get the 4 side of the building.
Windows
Corner
Column
Final result
The total floor of the bottom level is always 5 stories tall, no matter how tall the building is.
"Self-trimming" the volume sampler points to get the lowest points of the building as the "ground level". Group all the points, merge windows point, column point, corner point separately.
Use distance note to get a density level from the ground level and use density filter to spawn each level of floors
3 group of merged points
Final result
Final result
I want to add a door that I can move to any point at the bottom floor and it will auto generate a door for me
Solution: Make new collision box, tag it, use it to trim of the wall pieces and generate a door
Final result
Here I am applying the same logic as we are making the bottom floor to build the top floor, "Self-trimming the top point first, then use distance note to get density level.
Here I am applying the same logic as we are making the bottom floor to build the top floor, "Self-trimming the top point first, then use distance note to get density level.
I used the white density level part from the bottom to as the distance source, this will avoid interfering the bottom level
Final result
Once again, we are using the "Self-trimming" method to get the top floor like this
notice the for corner and the center are different color? Density filter time!
Get four corner and the center to spawn the towers
Final result
I want to make the towers disappear when the roof is small enough and regenerate when there's enough space
Solution: The Distance note has a unique property, when the distance target disappear, it will make the source point output White density level, so when we use density filter to only show non-white points, the white part will disappear. Therefore making the tower disappear
The hawker's shop is now complete and looks realistic. It can alter the amount of spice, bags, basket of fruits, and location of individual items.
Final result