Download

[WIP] Procedural City Generator with full interiors

**Latest Devlog:

Workflow Showcase:**

Older Devlogs:

**PCG Road Generation Test 3 - 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).

One of the criticisms of PG sometimes is that it relies a bit too heavily on a perfectly-flat unrealistic city grid.
But you’re already aiming to solve this generally using sloped Landscapes, which is tremendous stuff dude! :slight_smile:

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)

The density zones and connecting highways look terrific. :cool:

  1. Will we see some landscapes merged in-between the cities soon?

  2. Maybe ‘altitude’ raising one of the 3 cities would be interesting as well…

  3. The foliage spawners (trees / bushes) in the landscape level look natural, versus the foliage spawned in cities. That will be the tricky part I think. So my suggestion is, why not drop foliage spawning in cities altogether for now, and focus on new zones called unoccupied green zones and parks instead etc…

Overall the potential here is huge, because the road network already looks realistic.
Its just great work dude… Is this 6 months work??? :stuck_out_tongue: . BTW: What’s your Rig spec…

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.

No worries … I just meant a single-level demo, combining your Landscape PG progress with your Cityscape PG progress together into one holistic level. If you opt to raise altitude of one of the cities using Landscapes, and add a park / green area using landscapes also, you’ll actually end up answering all 3 requests at once. :slight_smile:

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:

Hey dude, looks like you’ve had another idle week… :stuck_out_tongue:
No audio on the preview clip but it still looks interesting…

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.