Sci-fi City generator with customizable biome
Build cities with buildings following different patterns in different biomes while avoiding overlapping
With pre-build landscape textures, I managed to build 3 landscape layers from it: Sand, Water, and Snow
I used another sample weight to define foliage area
Add the foliage
Now we can generate different biome with ease!
To let the PCG tool know where to spawn the city, we need a tagged spline actor to create a region
And get the difference between this area and the foliage area
Awaiting construction...
Now is the exciting part...but we need to start from the base
These nodes spawn actors that'll randomly choose from 2 kinds of bash kit with random size and rotation
To fill the gaps as much as possible, the keypoint is going to be using the density falloff curve to create a gradient toward the center
Start from larger pieces...
...getting an approximate bound with medium pieces...
...and finally small shapes at the edges
We could probably start developing from here!
I start with this randomizer that chooses among a bunch of pre-built buildings
Then going through a similar process as we did with the base
We now have a city that's filled with randomness!
Split our city with a highway, while not simply cutting it but spawning smaller buildings below?
Build it first with a spline and tag it with this tool PCG_01 Mesh Sampling
I wish to have a city center so I tagged this as well
Merge points from these two kinds of stuff and scale them into 3 different masks, referring to 3 kinds of buildings
...so that we can add them to the building's spawners, preventing larger blocks from spawning under the bridge and near the landmark!
Use Attribute Filter to mask the buildings from other biomes
I experimented with this to spawn platforms depending on the mesh size to make them stay reasonably on the water
And they did their job by staying above the water~