[RELEASED] CityGen3D - Procedural Scene Generation From Real World Map Data

After a long and successful Beta I can finally announce that CityGen3D has been released on the Unity Asset Store!

You have a great idea for a game, but no environment to prototype it in?
With CityGen3D you can select any location in the world and have a 3D scene based off that location in just a few minutes.
More than just a real-world terrain generator, CityGen3D can also generate complex road networks and building exteriors with no coding, all from within the Unity Editor.

Take a look at this video to see how easy it is to go from a blank scene to explorable 3D environment in just a few button clicks:

But what if you want to make changes to the 2D map data before generation. Or even not use OpenStreetMap data and draw your own 2D map instead?
CityGen3D is also a fun level design tool that allows you to add/remove/edit 2D map objects before converting the 2D map into a 3D scene.

Also, because you can hook up CityGen3D to your own prefabs and textures, you can use it to make all types of project in your very own art style.

I’m really excited to see all the great projects you will all make with CityGen3D!

Key Features:

:ballot_box_with_check: Worldwide coverage from OpenStreetMap.
:ballot_box_with_check: Easy to use interface with no coding required.
:ballot_box_with_check: High Definition Render Pipeline (HDRP) package with materials and shaders all set up for you.
:ballot_box_with_check: Import real world terrain heightmaps from NASA.
:ballot_box_with_check: Perlin Noise heightmaps.
:ballot_box_with_check: Automatic terrain texturing for different map surfaces.
:ballot_box_with_check: 2D map editing functionality for custom map creation.
:ballot_box_with_check: Automatic generation of roads using a combination of procedural geometry, terrain modifications, and decals.
:ballot_box_with_check: Automatic levelling of terrain for roads and buildings.
:ballot_box_with_check: Easy to use terrain smoothing.
:ballot_box_with_check: Procedural buildings with auto LOD levels.
:ballot_box_with_check: Spawning of roadside prefabs such as street lighting.
:ballot_box_with_check: Instantiate entities such as post boxes, litter bins, and power towers.
:ballot_box_with_check: Mesh extrusion for features like railways, fences and guard rails.
:ballot_box_with_check: Define different biomes to have trees and terrain details automatically applied to terrains.
:ballot_box_with_check: Water meshes for oceans and lakes.
:ballot_box_with_check: Built-in support for large environments with scene streaming and world origin shifting.
:ballot_box_with_check: Some operations multithreaded for faster generation of environments.
:ballot_box_with_check: Selection of textures & prefabs included and all setup for demonstration in Unity’s built-in renderer.
:ballot_box_with_check: Fully customizable to use your own textures and meshes, so useful for all types of project.
:ballot_box_with_check: Call CityGen3D functions from script using the advanced API.
:ballot_box_with_check: Ever expanding documentation that is freely available to view from the website before purchase.

Limitations:

CityGen3D is massive in scope and has a lot of functionality. It is already being used by lots of developers for various different projects.
However, it’s also worth pointing out it’s current limitations and where there’s scope for future development:

  • It wont generate bridges or tunnels yet, this is a key planned feature for the update cycle but no ETA yet.
  • There’s no built in support for traffic. The core CityGen3D product is based around geometry creation. A separate AI traffic and pedestrians module may come later. At the very least, support for a popular third party traffic system will be made available, but no ETA on this either yet.
  • CityGen3D generates scenes within the Editor at design time. It is not for generating scenes on demand at run-time. However large environments can be pre-generated and streamed in at run-time using the built-in scene streaming functionality of the Landscape Manager.
  • URP is not officially supported yet, but a URP package should be available soon in a future update. (HDRP package is now included in Packages folder inside your download).
  • Although the manual is around 30 pages long, some features are not fully documented yet. Buildings and Map Editing in particular are currently being documented more thoroughly as priority.

Please see the Roadmap on the website for more information regarding future plans, and let me know if you have any feature requests.

6 Likes

Here are some of my favourite videos showing off CityGen3D!

Driving around Millbank, London (Car from Edy Vehicle Physics, not included)

Scene streaming test in Manhattan

Driving around a hilly Andorra (Car from Edy Vehicle Physics, not included)

Here are some tutorials looking at CityGen3D specifics:

2D Map editing

Scene streaming set up

1 Like

Congratulations.

You might want to point to this new thread from the other as well as your store page.

1 Like

Thanks very much!
Yeah I just had one more reply to send this morning on that thread before sending people this way :slight_smile:

Great news, congrats to the release of this fantastic asset.

1 Like

Thanks, it’s taken a while to get this far!
A lot of hard work, but also a really fun project to work on.

Note the top folder was the 19th revision of the first prototype. So I must have started early 2016, possibly 2015 on the original concept.

6071199--658278--old.png

Then as you know, first public release in November 2018.
And now finally at v1.00 on the Store! :slight_smile:

2 Likes

I’m skimming through the new documentation. One thing that’s been slipping my mind to mention for a while is a small gotcha in the recommendation to delete the CityGen3D folder whenever upgrading to a patch. This will also as a consequence cause the loss of the CityGen3D/Resources/Data folder, where users may have added SRTM and Coastlines data for building up terrains. It isn’t really a problem if people are careful, but might be worth mentioning in the doco that we have to be mindful of manually retaining any data (or other changes, like adding materials, prefabs, etc) in the project folder hierarchy under that folder. Maybe down the track there could be a separation of the folder structure into necessary official CityGen3D files that can be deleted and recreated for updates, and a sibling folder for user data and additions - perhaps the pathing could even search under both the official files and the user data path as a best of both worlds.

1 Like

Yeah in recent months I’ve taken steps to move other data areas such as Terrain, Scenes and Databases into folders outside of the asset for this very reason. So I think it’s a good idea to do the same for the other things you mention as well, so I’ll look into that.

To be honest I wasn’t expecting to get approval in under 10 days (Big thanks to Asset Store team for fast turnaround!).
Therefore I’m still hard at work on adding to the docs (especially re buildings and map editing). So should be more stuff to read through in next update

2 Likes

As one of the earliest purchasers of this asset I can attest to how cool this is. It’s fun to just even play around with.

Good work on this and congratulations on getting it into the store!

1 Like

Hi Richard,

Do you have any existing API calls for converting a Unity position into a GeoCoord? I am hoping there is something like that (presumably driven via some offset from the origin value in the Landscape) where a given Vector3 position within the Unity landscape’s bounds can get converted accordingly into a WGS84 coordinate.

Reason I need it is that I’m converting my old Google StreetView panorama-syncing code to work with CityGen3D and that’s the last missing piece:


You can see in the above where the offset value is pretty far off the mark. I used to have some logic which corrected the rotation and bumped the Unity camera to the exact lat/long from the metadata, but that only works on the assumption of being able to move the camera to the equivalent spot in Unity.

If there isn’t an existing function then no worries, I can probably endure the horrors of projection maths again and figure one out, but it’d be great if I could just plug one in ready to go. Once it’s working, I’d be happy to comment up and share the script on here if anyone else wants to use it.

1 Like

This is a reference to your chosen lat/lon location:

GeoCoord location = Map.Instance.data.origin

But you can also offset it in Unity world space with the x and y parameters like this.
For instance, if you wanted to know the lat/lon of [200,0,400] in Unity:

GeoCoord location = Map.Instance.data.origin.GetLocation( 200, 400 );

Hope this helps, be great to see the end result if you get it to work!

Thanks, that’s what I was after. I did see that function before, but I wasn’t sure what the units of measurement were so it didn’t occur to me that it might be the one. Here’s how it looks with a dockable StreetView editor window moving in sync with my player camera script:

6078762--659520--capture.gif

It’s never going to be 100% positionally or rotationally accurate, of course, but it’s a rough way of verifying the scene against the reality. I used to have some code in my old script that would reposition the camera more precisely based on the panorama metadata’s lat/lon (which covers a bounding box based on where the Google car was that applies to whatever lat/lon you search for). I might try and get that working with the new version and then I’ll clean up the scripts at some point and pastebin them up on here.

4 Likes

So cool! Nice work :slight_smile:

Hi all,

I have finished tidying up my StreetView sync scripts and am happy to share them with our new CityGen3D community.

You’ll need these two scripts:

Setup and usage instructions are in the first file’s comments, and you will also need a free Google Cloud Platform developer account so that you can paste your Street View Static API key in the inspector. It’s been a while since I set my key up, so I don’t recall the step by step of how to hook it all up, but it shouldn’t be too hard to figure out. Keep in mind that the free tier has a limit - from memory it’s something like $7 per 1,000 tile views (each panorama you load or reload is 6 tiles worth) and you get your first $200 per month of usage free - so do the maths and keep an eye on your usage in the developer console to make sure you don’t exceed that and cross over into paid.

Enjoy!

6 Likes

Great stuff!
Thanks for sharing your work on this.
I will try it out myself when I can. :slight_smile:

CityGen3D isn’t just for city environments. There’s a powerful terrain generator too!

So I thought I’d revisit a location from one of my early tests to take some screenshots for the Water module on the website, which is currently absent.

As a result, here’s the island of St. Mary’s, procedurally generated from OpenStreetMap with CityGen3D v1.0

2 Likes

Hey CityGen3D amazing work! Do you have any reference on corporate proxy issues and how to solve them? I’m not able to see the openstreetmap viewer and am hit with an Error HTTP/1.1 401 Unauthorized when I try to download the data source.

Hi,

Thanks very much!

Are you able to access OpenStreetMap from a browser outside of Unity?

As I recall, during the beta only one user reported problems downloading OSM from within Unity, but we worked out that the queries still worked in a browser.
So I implemented a data import system whereby the same query is run in your browser and you simply reference the downloaded file.

So hopefully you can get round this by selecting XML as your Source on Location panel.
Then copy the query into your browser, which will download the data to a file.
This file should then be dropped into your project and referenced in the appropriate field on Location panel.
Then you click Import button and proceed to Process data as your would if you had downloaded it from within Unity.

Please let me know if this helps in your case. But if your network admin is blocking OSM completely then that is a tricky one!

It looks like I can import the xml file and that imports successfully, however I still cannot view the map, in the editor viewer. I also do have access to openstreetmap the website on network

Map processed with offline xml query following that link! However, the mini preview isn’t there in the editor, which is alright, but now when i hit load generator, it does not show all those little generator steps that I saw in the tutorial video!
6094257--662250--upload_2020-7-15_15-1-3.png