I’ve been working on a Procedural City Generator as a side project and wanted to share what I have so far.
Current Workflow:
Create your road network (manual for now)
Lay down your zones
Spawn your buildings and adjust
Convert buildings into HISMs
Setup your foliage settings and spawners
Spawn foliage and adjust
Convert foliage into HISMs
Spawn props (not implemented)
Final scene adjustments and testing…
What I have so far:
Use any road actor as long as it has a spline component to create your city layout
City Zones - define your parameters per zone and let the generator do the rest! You can create as many custom zones as you like
Foliage spawner - quickly spawn foliage along your roads with ability to spawn foliage per zone or per road! The Foliage Spawner spawns foliage in a general area to create parks / forest with customizable “buffer” area per tree and minimum slope per spawn
Convert your spawned actors to Hierarchical Instanced Static Meshes quickly - both buildings and foliage to improve performance
Building Interiors - quickly setup your building interiors. Interiors can be randomized on a per building basis and only spawn on Player proximity allowing for better performance
Still Planned:
Prop spawner system - spawn “props” along the roads (stop signs, benches, custom meshes)
Made algorithm more efficient - now colliding roads intersect easier and less roads are created overall. I also added 2 placement modes for landscapes - conform to landscape / keep same height). Each mode modifies the landscape to fit the roads (with really bad results towards the end lol).
1 - what do you mean with “landscapes merged”? Are you referring to making a demo video where I create separate cities in a landscape? If so, yes, thats the plan for the next workflow demo video
2 - Yup - will keep it in mind for the next demo vid
3 - Thanks! The “city foliage” is simple, so I’ll probably leave it as is for now since I have to focus on more important things…like better road generation :D. You can technically already create “parks” by creating a custom zone - will make sure to show that in the demo vid as well!
Thanks for the encouraging words! Good to know people are excited :). I’m still not sure how much farther I want to take it - whats still missing: Prop spawner (WIP), more road types (minor, rural) with tweaked algorithms to generate a more realistic layout. Also, Im thinking about “sidewalk” generation with something like the procedural mesh component (not explored yet) and code to replace my simple splines with actual roads like MRT or some of the other popular tools in the MP like Snappy Roads. Then there’s general optimization ofc and whatever else I can think of / is suggested while I work on this lol.
I have a GTX 1070 with an I7 and 16GB DDR4 ram…a bit above average, but nothing crazy.
New Highway generation method that connects all cities to each other
Added Minor Roads - these roads generate from the main roads creating the residential side of your city
Added a way to individually create roads and spawn cities on a per city basis. This saves on performance and allows for each city to have its own style of roads!!!
Batching System - my solution to the performance issues seen on the Mega City video. Now you can spawn buildings in batches (user defined). This way your editor doesn’t lock up and you are free to adjust the batch size based on your machine!
The Foliage Spawner - it spawns trees along the road and can use Foliage Spawners to create parks within the city. Street generation now respects the spawners
Prop Spawners - very early look. You can add fixed props (always spawn at set distance) and random spawns (every X distance it has Y chance to spawn - user defined). Still very buggy as seen on the video, but you get the idea
This is the first time that you can now generate a city from beginning to end based on my original proposed workflow!