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

Regarding the Location Picker Map not working, it does sound like your Unity web requests are being blocked by your network for some reason.
If you are on a corporate network your admin may have an idea of why that is.
But CityGen3D will operate with full functionality with no Location Picker Map, you’ll just have to manually set Lat/Lon coords for your locations and use Import data workflow, as you have done. You may also want to minimise the Map display by clicking the little arrow next to “Map” on the Location panel. This may stop CityGen3D from trying to download the images.

After you click Process you should be able to see lots of child objects under the CityGen3D object in the Hierarchy.
This means the map has been processed.
It should then be possible to view the interactive 2D map by putting Scene view into Map view (Tools->CityGen3D->Toggle Map View).
When map view is active your scene view tab will be named “Map”.

Do you have a Generator object in your Hierarchy? This should have appeared when you clicked Load Generator and is the only prerequisite for the Generator Actions being listed.

If I go to OpenStreetMaps website and export an area to map.osm file, in the Data Source window, there’s XML in the dropdown list but I can’t put map.osm in the filename textbox. Is this a bug?

No the XML import is designed for the workflow described in this post.
https://discussions.unity.com/t/799356/18

Copying the query from the Location panel ensures you have the data required for the currently selected terrain tiles for your location.

Its only practical benefit is therefore for users that aren’t able to do web queries from within Unity Editor due to network restrictions and need to perform the same queries in a browser instead.

So the generator is in the scene, it was created once i hit load generator, however the additional options still do not pop up.
6096777--662598--upload_2020-7-16_7-32-24.png6096777--662601--upload_2020-7-16_7-32-34.png
6096777--662604--upload_2020-7-16_7-32-43.png

I’ve tried manually populating the generator actions, however it seems all of the meta data in the generator editor is blank, missing assigned prefabs for buildings,tree’s, water, etc.

EDIT: Just did a test on 2019.1.1 and that seems to work, the generator loads correctly and no prefabs are missing. I would check Unity 2019.3.0f6 is the version I was using, with the big editor UI look change, that might have caused an issue?

Sorry to hear you are having problems, but I’ll try and get you up and running as soon as possible.

Please can you take a look at the Generator prefab in the Resources/Prefab folder.
Does it have a populated actions list?

If it doesn’t then it sounds like something has gone wrong on importing the package for some reason. If that’s the case please confirm your Unity version and try again in a new project (installing Burst (etc) first).

If the actual prefab looks fine then just load the New City scene again and start the process from the beginning to import the data, Process it, and the Load Generator.

New video showing the map editing functionality a bit more closely!
It even has my (rather quiet) voice in it. I’ll try and make the next video a bit louder :slight_smile:
Nonetheless, its a good introduction for learning how easy it is to create a fictional 2D map and have it generated for you in 3D using CityGen3D.

1 Like

Up and running now! I do have to manually enter in the min / max lat lon into the url as it does not auto update on lat lon entry, but only when pressing buttons to move the tiles etc. I do have it up and running though, and am using openstreetmap as a reference for bounds. It would be nice to manually enter in the min and max latitude locations after uploading my xml file. 2019.1 does work though and this is an amazing product! Thanks for the fast replys

2 Likes

Yes I seem to recall puzzling over a similar linking issue a while back, and I think I came to the conclusion that if you create the generator before processing the Data tab, then those objects don’t yet exist in the hierarchy and so the Generator has the refs as blank. Doing it all in correct sequence works, but if that step is out of order then I believe deleting the generator and re-adding it after processing Data should fix it. I’m not at my pc to verify right now, so all of that might be wrong.

1 Like

Glad to hear you are up and running. Yeah, I’ll have another look at the Import workflow. It hasn’t had much use up to now so there may be one or two things I can do to improve it and make it less open to issues.

Thanks for the additional info. I’ll run some tests here ahead of next update.

Now that i’m up and running! Apologies for all the questions, but do you have any solutions for runways? Is this apart of the “Generate Roadside Objects” process. or is it during “Highways”?

Runways are just considered to be a type of road, so Generate Highways will add more detail, such as road markings.

1 Like

Hey, what a nice asset!
Whould you consider to start a Discord for CityGen? I think it will improve support and giving you a active community in a easy way!

2 Likes

Thanks very much!
I actually installed the Discord client yesterday, so this is something being looked at :slight_smile:

How do I edit terrains/landscapes that are already processed and generated? How do I create new materials in splatmap window?

Once you have created an environment using CityGen3D you are able to modify all aspects of it using normal Unity workflow (eg using Terrain tools, or moving prefabs).
Where possible its a good idea to modify 2D map to your design and have CityGen3D regenerate the environment for you, but it really depends on what specifically you want to do.

Splatmap window is for assigning terrain textures to different surface types.
A terrain texture can be any seamless texture you want, it’s just a case of dragging an appropriate material into the list.
To add another slot just press the + button at the bottom of the Terrain Materials list.

How do I modify 2D map to your design and have CityGen3D regenerate the environment? Pressing CTRL-M sends me to 2D map for the last group of terrains/landscapes. How do I get 2D map for a group of terrains/landscapes?

If your entire game world is really massive (I think in your case it is?), then for the same reasons that you don’t create your entire map in one session, you can’t also edit it all in the same session. There would just be too much data for Unity to handle all at once.

Instead, you can go back and make changes to a specific region.
You won’t need to download the OSM data again because it’s saved as a database asset. So by selecting Data Source as Database and finding the database for a specific region, you can load the data in.
They are named after tile references, which indicate the south-west most terrain like “[name, x/y]” and will be as big as your Area size (eg 16 terrains with 4 Area size).

Having loaded it you would then need to Process again to give you the 2D map. Then you can use the Map Editor to make changes before regenerating those Landscapes again.

If you want to preserve 2D map data then you should save this as a scene.
To be honest, I think there’s scope for workflow improvements here, so I’m open to suggestions regarding optionally preserving the link between 2D and 3D data after scene generation.
Perhaps being able to copy the data over as a child of a Landscape itself, or something like that, so 2D data simply loads with the Landscape may make sense.
As more and more users start to push CityGen3D to the limits I think we’ll be able to decide what could help here.

If you simply want to make changes directly on the 3D terrains, then you can just load the scenes for whichever Landscape you want to edit.

There is a handy Load Available Scenes option in Tools->CityGen3D menu, which will batch load all scenes for your current project. This could be improved in future to only load scenes linked to the current database selection.

Edit: Actually I looked today and the Load Available Scenes menu item does already only load landscapes in relation to the active database, so it does help with the workflow if you need to go back and make changes to an earlier generated region.

Here’s an early peek at the work-in-progress Vegetation Studio Pro integration.
This will allow you to link CityGen3D map surfaces (either from OpenStreetMap or custom ones) to Vegetation Studio biomes and have biome masks created for selected terrains automatically with one button click.

4 Likes

After one month on the Asset Store, it’s been great to see so many new people enjoying CityGen3D and we have been riding high on the top new assets chart, so thank you for your support.

Feedback has been overwhelmingly positive, but one of the key areas we’ve been looking at improving is the map processing speed for larger environments.
Work is nearly complete on v1.01, which includes optimisations in this area so you should find larger maps process much quicker, which I’m sure will be a welcome improvement.

Other notable changes include water generation fixes, so plenty to look forward to later this month! :slight_smile:

3 Likes