[WIP] Procedural City Generator with full interiors

**Latest Devlog:

Workflow Showcase:**

Older Devlogs:

**PCG Road Generation Test 3 - YouTube

PCG - Early preview of the prop spawner systems and more! - YouTube**

**PCG - Devlog 7 - New UI! - YouTube

**

Hi everyone,

I’ve been working on a Procedural City Generator as a side project and wanted to share what I have so far.

Current Workflow:

  1. Create your road network (manual for now)
  2. Lay down your zones
  3. Spawn your buildings and adjust
  4. Convert buildings into HISMs
  5. Setup your foliage settings and spawners
  6. Spawn foliage and adjust
  7. Convert foliage into HISMs
  8. Spawn props (not implemented)
  9. Final scene adjustments and testing…

What I have so far:

  1. Use any road actor as long as it has a spline component to create your city layout
  2. City Zones - define your parameters per zone and let the generator do the rest! You can create as many custom zones as you like
  3. 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
  4. Convert your spawned actors to Hierarchical Instanced Static Meshes quickly - both buildings and foliage to improve performance
  5. 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:

  1. Prop spawner system - spawn “props” along the roads (stop signs, benches, custom meshes)
  2. Road Network Generator - generate road network procedurally
  3. General improvements (ofc!)

Reserved for updates

Quick update!

Started experimenting with auto road generation! Here are some very early tests

This is super awesome !! :wink:

Thank you!

Amazing work indeed. Looking forward to what’s next

Thank you!

Another quick test!

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).

Thanks @franktech !

Devlog 3!

Another big update:

  • Added “Density Zones” and City Limits
  • Highways automatically connect all your cities via Density Zones
  • Main Roads spawn from zone and stay within city limits
  • Improved spawning algorithm now works with “organic” preset of roads (no more overlaps!)
  • Improved Foliage Spawner
  • Started working on the Prop Spawner (very early)

Thanks man!

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 :slight_smile:

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.

Ah, gotcha. Yes, thats coming for the next demo map :slight_smile:

Devlog 4

Added:

  • 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!!!

Early preview of the Prop Spawner System

Shown in this video:

  • 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 :slight_smile:

This is the first time that you can now generate a city from beginning to end based on my original proposed workflow!

Cool already! :slight_smile:

Thanks!

Haha - yeah lately its been really hard to find “quiet time” to record a proper video - so you get my silent testing at midnight lol.

New update - Added Procedural Parks!

Features:

  • Adjust the number of “center actors” spawned with a random range
  • Adjust number of entrances within a random range
  • The pathway generation is a modified version of the roads algorithm which allows for the same presets and customization (grid-like, organic, etc)
  • Spawn fixed props along the pathways (lights in this case)
  • Spawn random props along pathways with customizable percent chance to spawn per prop!
  • Spawn random area props around the park
  • Spawn grass that automatically avoids pathways and props
  • Spawn foliage with avoidance
  • Convert props and foliage into HISMs for performance

Super! Parks feel living now

Thank you!

Thanks @franktech - everything is coming along nicely :). Thanks for the support and suggestions!

This is cool! Is it possible to swap out meshes with your own ones? I’d totally use this, is it on marketplace yet?