Search Unity

Assets [BETA RELEASED] CityGen3D | Procedural city generation from map data

Discussion in 'Works In Progress' started by CityGen3D, Jan 28, 2018.

  1. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Hi Andreas,

    Thanks for buying CityGen3D! :)

    Normally links are sent within the hour, although for some reason I didn't get auto notification this time from PayPal*.
    Sorry for the delay, you should have it now.

    The website at www.citygen3d.com also now has a sign-up service via the log-in bar.
    This allows you to download the latest version at anytime after purchasing.

    Anyone is able to sign-up whether you have purchased or not (because one day we may have features available to all such as a forum), but access rights to the Download page on the website is manually granted once you have been verified.


    *Edit: to be fair to PayPal it seems they did send one straight away but my mail provider took a day to send it to me, for some reason. To anyone reading this in the future, I recommend signing up to the website at same time as making a purchase, because I'll definitely get immediate notification of that (via a push notification to my phone) and can promptly give you download access as soon as possible afterwards.
     
    Last edited: Feb 7, 2019
    Andreas12345 likes this.
  2. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    367
    Thank you, i am in and will check it out this weekend.
    I will it use for my bicycle simulation, it looks perfect for it.
     
    CityGen3D likes this.
  3. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I'm about ready to pull the trigger on purchasing this. Since I will be using this for generating different time periods (modern, Victorian down to medieval) I want to verify that this will be suitable for medieval levels. I understand I can change the prefabs used for the buildings but I'd like to use dirt and mud textures for the roads. I think some of that is in the works based on your roadmap. Any idea how long until this is available? Plus it'd be nice to be able to generate side objects not just on main roads but also on paths (ex. fences, plants, rocks):

    Auto generation of road markings on highways

    Roads in CityGen3D can be whatever seamless texture you want, whether that be a nicely tarmacked highway, or a muddy farmland track.


    In future it will also be possible to generate road markings on your roads automatically. (Some screenshots on the website show an early preview of this feature)

    Thanks! This is looking really good.
     
    CityGen3D likes this.
  4. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Thanks, yes it should be already be possible to create a medieval look, if you have suitable textures and assets.
    I've setup CityGen3D to have fairly modern looking defaults (although I like the idea of supplying alternative themes to show off it's versatility a bit better).

    One of my earlier posts shows the Road panel:
    https://forum.unity.com/threads/bet...tion-from-map-data.514677/page-3#post-4035937

    This is where you can tell CityGen3D how to interpret different OSM road types (including paths, footways, and even waterways).
    As you can see, every road type you define has an associated Surface.
    With the default settings we have most highways defined as Road surface, some paths defined as Track and some as Footway, etc.

    Then on the Splatmap panel we can control how each of these surfaces are textured.
    This is the interface for mapping surfaces to different textures (demonstrating that by assigning a Surface type to a Road type, in turn allows you to decide how they are textured on this panel).
    Road ends up being textured as asphalt, Track is gravel, and footway is tarmac.
    splatmap.png

    Note that road types also have a Curb checkbox. This determins whether they have sidewalk geometry, or whether they are simply textured terrain.
    Road markings can also be automatically applied to curbed road types. This feature is a bit experimental at this stage but is already working quite nicely.

    Being able to spawn prefabs alongside paths makes sense, I'll look into that. (At the moment it only works alongside curbed road types).

    I have prototyped mesh extrusion along a OSM way (for things like bushes, fences, walls and railways).
    It's not quite ready for release yet, but that will definitely appear over coming months.
    It will work a bit like how Entities panel converts OSM nodes into prefabs (such as bus stops, benches, or waste bins), but this will be for extrusion along a polyline where OSM has a feature described as a way instead of a single node location.
     
    Last edited: Feb 8, 2019
    StevenPicard likes this.
  5. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    CityGen3D Beta v0.4 is now available.

    It's the first release to include some Unity Job optimization and the terrain texturing is much faster as a result.
    I'm looking into improving heightmap generation in much the same way at the moment, so look out for that in a future update.

    Please read the updated manual before updating as it's quite a big change from 0.32.
    It's available for all to read via the link on this page: https://www.citygen3d.com/store

    In short, you must be on Unity 2018.3 and install 3 Preview packages: Burst, Mathematics, and Editor Coroutines.
    (It sounds like a lot of work, but they are very quick and easy to install via Package Manager).
     
  6. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I took the leap and bought the asset today. Can't wait for the download link. :)
     
    CityGen3D likes this.
  7. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I got the link! Awesome!
     
    CityGen3D likes this.
  8. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    I bought CityGen3D Beta v0.4 this morning, downloaded it, installed it, and was going to create Staten Island, NY but it was going to take at least 4 hours to generate a 4096 X 4096 terrain and that covers part of that city.
     
  9. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Hi Jeff,

    Many thanks for supporting CityGen3D during beta.

    Densely mapped locations can be quite slow to process at the moment, so optimisation is currently the main priority (as with the recent terrain texturing speed improvements).
    I’m currently working on optimizing the heightmap generation.

    Please can you give me the lat/lon location you are using and I’ll run some tests there over weekend.

    Was it the data processing that was particularly slow for you or a particular part of the 3D generation?

    Edit: Off the top of my head, when someone mentioned really slow processing before it was because Unity kept attempting to bake lighting while CityGen3D was adding GameObjects.
    Please ensure you turn off the Auto Generate checkbox while working with CityGen3D:
    Window -> Rendering -> Lighting Settings -> Scene Tab
     
    Last edited: Feb 9, 2019
    Umesh00 likes this.
  10. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    367
    When i click on generate terrain:
    Code (CSharp):
    1. MissingMethodException: void UnityEngine.Terrain.set_drawInstanced(bool)
    2. CityGen3D.Landscapes.GenerateTerrains () (at <94803b4bc02741bd9240d4ab715e82bf>:0)
    3. CityGen3D.EditorGenerator+<ShowHeightMapTerrainsPanel>d__47.MoveNext () (at <94803b4bc02741bd9240d4ab715e82bf>:0)
    4. UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    5. UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    6. CityGen3D.EditorGenerator:OnGUI()
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  11. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Hi Andreas,

    Please can you confirm what Unity version you are on (needs to be 2018.3) and whether you successfully installed the required Preview Packages (Burst, Mathematics & Editor Coroutines).

    Thanks.
     
    Andreas12345 likes this.
  12. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    The lat/lon location is about 40.6143,-74.1019. I'll turn off the "Auto Generate" in Window -> Rendering -> Lighting Settings -> Scene Tab after Unity3D is finished generating the terrain. I think that I forgot to copy the TagManager.asset file to my project.
     
  13. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Yeah it's an annoying part of the setup, but there doesn't seem to be a way in Unity to automate this, unfortunately.
    I can't guarantee things will work as intended if you drop it in afterwards. You maybe better off starting again, but let me know how it goes.

    Re lighting, I think I mention it in the FAQ on the website but I'll make sure I put that in setup instructions as well.
    (I may even be able to switch it off automatically while CityGen3D is doing stuff, so you don't have to worry about it).


    I've just been testing a 4km x 4km environment in Staten Island. I did 40.58 / -74.15

    Here's a screenshot (I've not generated any buildings yet).
    I've noticed some bodies of water didn't generate a water mesh, so I'll look into that further.

    This size map is very close to Unity scene limit of 4GB so after heightmap generation it's advised to click the Convert To Scenes button on Heightmap panel so each 1km tile is saved separately as shown in screenshot.
    (Make sure you have a "Scenes" folder in your project parallel to the CityGen3D folder or it will give error - I've just noticed that!).

    staten_island.png
     
  14. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    703
    That's a pretty big project for one person, lol.. Hey, I respect people with big dreams ;)

    I know what it's like to need 10 more programmers. Too bad we can't program agents that could write code for us, right?!
     
    eaque and CityGen3D like this.
  15. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    CityGen3D currently only ships with UK coastline data so I've uploaded a coastline JSON file for USA East Coast (-80 to -71 : 36 to 46):

    USA East Coast (NY NJ) [-80_36_-71_46].json


    So you can download that, drop it your project at "CityGen3D\Resources\Data\Coastlines", and assign it to the Coastline JSON field on the Data-Location panel before processing. This will allow CityGen3D to identify coastline better in that region.

    To demo why a coastline file is important (unless your chosen scene is land-locked), here's a with and without appropriate JSON:

    With (identifies sea water):
    with_coastline.png

    Without (doesn't find sea water):
    without_coastline.png

    I'll be adding more coastline files throughout the beta, but please shout if anyone needs a specific one I'll try and put it higher on the priority list :)
    (Rather than bloat the main CityGen3D download I may start making them available via the website so you can simply download the ones you want).
     
  16. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    @unity_tom0_ux6sZM41A has worried me with the video he posted in this thread. There probably is someone somewhere working on programming agents to make us redundant!
    https://forum.unity.com/threads/bet...tion-from-map-data.514677/page-3#post-4134670
    So going to work hard while we still have a purpose! :)
     
  17. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    703
    I think we are doing some programming work complicated enough that we don't have to worry about that anytime soon. It will be the noobs that get replaced first by Terminator Agents. :)

    Speaking of, I'm actually developing an extremely sophisticated agent system for npc's right now, ironically.

    I've actually built my AI system to load code at runtime, I call it an algorithm matrix framework. All I need now is a neural network that can learn how to write code and im good to go!

    Keep an eye on my youtube channel, lol.. so you can see me school Bethesda on how to write software for NPC's and then actually put them in the game... ahahahaha.

    I think ill be making fun of them until the end of time, after fallout 76.

    (sorry to go off topic, back to work for me!) Have fun with your city project it looks very interesting.
     
    Last edited: Feb 9, 2019
  18. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    I was able to generate 2X2 terrain of part of Staten Island, NY, and roads but there are no bridges/overpasses. I tried to generate houses but they don't appear on the scene.
     
    CityGen3D likes this.
  19. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Bridges are not currently auto generated.
    I've done a lot of testing around River Thames, so definitely something I want to include eventually!
    I'll add this feature to the RoadMap on the website, so it's clearer it's not something that's currently supported.

    Better news for the houses, I think that's just a case of tweaking a setting.
    The default Generator settings for Roadside prefabs are set so that houses will only appear over Residential areas, which won't necessarily be specifically mapped in some locations.
    You should see street lighting appear alongside all roads though. If you compare the selected surfaces for both these objects, it should be clearer how to tweak things to your liking. (If you select "Everything" from the Surface drop-down next to the house prefabs on Roadside panel and respawn, they should appear just like the lamp posts).
    Documenting some of these features is also on my todo list - the manual currently stops around that point :)

    If you are interested in generating real buildings from the OSM data, BuildR2 support should be available later this month.
     
    Santa36 likes this.
  20. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    How about some kind of a grid based on number of terrains to be generated on the map so that I can generate groups of terrains, one group at a time?
     
  21. Santa36

    Santa36

    Joined:
    Dec 1, 2018
    Posts:
    22
    V 0.4 (If you are a advanced user you already know/done most of it so skip)
    Setup at the moment for those who download it at the moment - Post maybe redundant at some point but for now:
    First read the instructions that come with folder if not read this
    Step1
    Download Unity 2018.3 and further / Download Citygen3D
    First things first Unity setup: Create a Brandnew Project
    In that you need the following:

    Step2
    Preview packages: Burst, Mathematics, and Editor Coroutines.

    File Edit Assets Gameobject Component Jobs Tools Window Help


    Package Manager
    All packages Advanced

    Show preview packages
    Burst, Mathematics, and Editor Coroutines. (install)

    Step3
    Scripting Runtime Version to “.NET 4.x Equivalent” and API Compatibility Level to “.NET 4.x”

    File Edit Assets Gameobject Component Jobs Tools Window Help


    Project Settings
    Player
    Configuration:

    Scripting Runtime Version - .NET 4.x Equivalent
    Api Compatibility Level - .Net 4.x


    Step 4
    File Edit Assets Gameobject Component Jobs Tools Window Help
    Import Package - Custom Package

    (Import Citygen3D)
    Now were NOT finished - you want to run smooth dont you? Invest the time for the whole Setup were almost finished

    Sidesteps:!!!
    Open your folder with Citygen3D see the TagManager.asset
    copy it
    Open your "MyUnityproject-that-I-named-differently"

    replace TagManager.asset
    in Project Settings


    Hotdamn I have the best Workstation there is why is still taking so long ...
    Ahh yes, dont Light Your Scene with Realtime Global Illumination

    File Edit Assets Gameobject Component Jobs Tools Window Help
    Rendering
    Realtime Global Illumination (untick)

    One Last Thing

    Once you set up the Data Panel & Generator Panel
    Go to Project
    Assets
    Scenes
    Open New City

    ----
    So are we finished? Can I finally start testing if this asset is for me? Yep!

    ---
    Oh come on "X" isn't rendered
    go to openstreetmap.org - to the location - rightclick - query features - chose the one you need from the list on the left/west
    Tags
    this is the information your looking for
     
    Last edited: Feb 10, 2019
    CityGen3D likes this.
  22. Santa36

    Santa36

    Joined:
    Dec 1, 2018
    Posts:
    22
    @CityGen3D - WaterIssue - I had this sometimes too, but strange enough it was generated but below the map and i manually lifted it up.
    Still whats with layer 31.
    BTW I also think you shouldt be that worried of beeing replaced. If it helps you getting better focus on the project, good. Just don't pressure yourself too much. The only thing that really will get replaced are things that hold you of a long time because there laborintensive.
    And since your a racingfan - sketchfab has a koenigsegg in lowpoly for free last time I checked.
     
  23. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    367
    Is there a way to save the Bing map key for further projects?
     
  24. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    When you first generate the terrains you should have a checkbox grid allowing you to decide which ones to generate.
    This is also useful if you want to work on an area that's not a square, because at the moment the data download is always a square.
    heightmap_panel.png

    After that, nearly all functions require you to select the landscapes you want to apply changes to before clicking an action (so you can group them how you want). For instance before texturing the terrains you have to select the ones you want to apply changes to before clicking Texture Terrains button.
    Actually clicking the terrains, or selecting them in the Hierarchy, seemed the most intuitive way of doing this but I can look at ways of improving this if it doesn't work well for you (if this is what you meant).
     
  25. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Yeah hopefully we are a few years away from AI taking over!
    Joking aside, the advances in procedural tech and AI are actually really exiting for artists and developers. There'll always be room for creative thinking and hopefully tools (like CityGen3D) will actually help rather than replace.

    Water - yes that's a good point. Sometimes they are there, it's just the default positioning is a bit off and you can easily tweak it by changing y-axis position of the GameObject. But I will investigate further.

    Layer 31 - I don't get any warning about that on my setup for some reason. Do you still see this? If it's still an issue I can change it for next update.
     
  26. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    In a new project, unfortunately not, because it's importing from the unity package*
    For different scenes within a project, yes.

    Any changes you make to the Generator prefab in Resources\Prefabs become the new default settings when you load the Generator, so adding your Bing key into that prefab should do the trick.

    Using the inspector, look at Generator prefab, Heightmap object, and edit the Bing Key field so it's your key.


    Of course this opens up the possibility of creating your own Generators and pointing the Generator Profile field on Location panel to your own version of the Generator. For instance you could have a Generator setup for a medieval, or western style, using vastly different textures and prefabs, and it would simply be a case of loading the Generator you want at anytime.
    This is why the Generator is separate to everything else. You can delete it and reload a different one with different settings, essentially allowing you to have different ones for different templates.

    * You could manually copy a Generator prefab (with the key set) from one project to another though, after importing CityGen3D into your new project.
     
    Andreas12345 likes this.
  27. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    In the window where the map is shown, there's a grid on the gray background as well as on the map. I want to generate the terrains for whole Staten Island, NY but the 10X10 terrains won't cover the whole area. What I want to do is to put the light gray rectangle representing the terrains to be generated on each of the grid square, generate the terrains, move the gray rectangle to the next grid square, generate the terrains, and repeat until the terrains for the whole area are generated.
     
    CityGen3D likes this.
  28. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    I see what you mean.
    Perhaps a useful function would be arrow buttons to shift the map coverage up/down/left/right exactly 1 terrain tile (1024m).

    I think a short term fix will simply be to remove the 10km limit so you can download a much larger area and just select the terrains to work on at any given moment from within the massive data set.

    I’ll give this some more thought, thanks for the feedback.
     
  29. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    178
    After updating Unity 3D to 2018.3.6f1, I get this error message after downloading OSM data, using USA East Coast (NY NY) coastline file, and trying to process the data.

    ExitGUIException: Exception of type 'UnityEngine.ExitGUIException' was thrown.
    UnityEngine.GUIUtility.ExitGUI () (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:156)
    UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:173)
    UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects) (at C:/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:25)
    UnityEditor.EditorGUI.ObjectField (UnityEngine.Rect position, UnityEngine.GUIContent label, UnityEngine.Object obj, System.Type objType, System.Boolean allowSceneObjects) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:3418)
    UnityEditor.EditorGUILayout.ObjectField (UnityEngine.GUIContent label, UnityEngine.Object obj, System.Type objType, System.Boolean allowSceneObjects, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8433)
    UnityEditor.EditorGUILayout.ObjectField (System.String label, UnityEngine.Object obj, System.Type objType, System.Boolean allowSceneObjects, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8419)
    CityGen3D.EditorData+<ShowLocationProcessingPanel>d__51.MoveNext () (at <94803b4bc02741bd9240d4ab715e82bf>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    CityGen3D.EditorData:OnGUI()
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  30. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Hi Jeff,

    I believe this error comes up when you click on the Coastline JSON field to assign a file to it. For some reason Unity throws the exception when the file select dialog shows up with the Location panel in view.
    (It also happens if you attempt to change the Database asset in the same way).

    It shouldn't affect the subsequent CityGen3D processing in any way, so it's fairly harmless.
    You can click Process and you should be able to view the processed map data as normal.

    I'll work on a fix. It notably doesn't happen on file select dialogs on the Generator (eg assigning a new Terrain Material on SplatMap panel), so I suspect it's something amiss with the way the Location panel refreshes for the OSM map.
     
  31. Santa36

    Santa36

    Joined:
    Dec 1, 2018
    Posts:
    22
    Well time to spitball again, so you want procedural Maps (well me too), but for myself at least I have no experience so far with the following https://opengeofiction.net/export#map=16/18.5585/33.1255
    Well, I got so far that I downloaded the osm file just renamed it to xml put in the folder like said on page 3 this thread but i only got a green map.(everything was at preset)
    thats a goal for me http://www.gvsig.com/en/diffusion/e...2/content/aprendiendo-sig-con-juego-de-tronos
    (gis map with an example how to map with the tool in the Game of thrones Universe)
    Maybe some of you have already expirience with the Opengeofiction, if so let me/us know

    And about layer 31 its just me trying to be on the save side, but like you said if its not a big deal and you can change it anytime just leave it be.

    Cya
     
    CityGen3D likes this.
  32. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    I think loading fictional maps may work, but you might need to manually set the latitude and longitude on the Location controls to match the centre of the map you are importing and set the area size so it's big enough.
    Try setting lat/lon to 33.1255, 18.5585 with a suitable area size and reprocess, see if that works.

    I'll try it out when I get a moment, as it's definitely something I want to support.
    Ideally the XML feature will automatically read the lat/lon location from the file, which would make it much easier, but I don't think this happens for now. So CityGen3D may just be looking in the wrong area when attempting to process the XML, which is why you got blank map.


    I do like the idea of being able to create fictional maps in OSM Editing tools and loading them into CItyGen3D.
    Although as I've said previously, I'm really keen to have a 2D map editing solution built into CityGen3D itself.
    I have prototyped aspects of this previously, so as soon as something is ready for release I'll include in a build.
     
    StevenPicard and Santa36 like this.
  33. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    A bit more info on the Heightmap changes being worked on...

    When CityGen3D downloads the heightmap data from Bing Elevations it takes 32x32 real world samples for each 1024x1024m terrain, so everything inbetween has to be interpolated.
    At the moment this is done via a very slow smoothing function, that requires multiple passes, which is one of the reasons the heightmap generation takes such a long time.

    I'm working on speeding this up fairly substantially, by implementing both Bilinear and Bicubic interpolation and giving you the option of which one you want to use.
    Bilinear is very fast, but has a low-poly look.
    Bicubic is nice and smooth, but a bit slower (although still much faster than the old method).

    I'm also transferring some code into jobs which will speed up the per surface heightmap modifiers, in much the same way the terrain texturing was made faster in previous release.

    So overall, heightmap generation should be much better and faster in 0.41.
    Not sure when it will be ready yet, but we are talking around a week most likely.
    I'll hopefully share some screenshots over the weekend.

    BuildR2 Integration is coming very soon after that.
     
    Santa36 likes this.
  34. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I tried using the height map generation (I got a Bing Map key) and it seems if I use that I can never generate anything after that. No textures mapping, no objects, no trees, no details, etc. In fact when I try and generate trees the progress bar gets stuck in the middle and never finishes. I can still click around on Unity but the window is floating above. I've been successful not using the height maps.
     
  35. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    Is it just me or do the buildings generated by BuildR2 look very cheap and fake? My opinion is just based off of what I've seen done with them, though, but I've never seen realistic and impressive building made by it.
     
  36. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    That would be awesome if you added that!
     
    CityGen3D likes this.
  37. Santa36

    Santa36

    Joined:
    Dec 1, 2018
    Posts:
    22
    The Video released by jasper stocker, the creator of that asset, suggest that it is possible too create realistic Buildings.
    So I'm keen of how it will turn out, but even if they turn out to be dull that wouldnt matter too me. What interests me is that you can walk into the buildings and if they can be generated automaticly im totally sold. Sure you may have too tweak them manually afterwards too your liking, but hey thats just me ^^.

    And Richard good see you working steady from one release too the next.
     
    CityGen3D likes this.
  38. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Sorry to hear you've had issue with heightmaps up to now.
    It should work if you click Generate Terrains -> Download Heightmap -> Apply Heightmap, in that order with a valid Bing key.
    But I think the workflow on that panel can be a bit confusing, which causes most problems.
    For example you shouldnt be allowed to click Download Heightmap before Generate Terrains, so I need to enforce that on the UI.

    So hopefully things will be improved after next release and less prone to issues.
    If you still have problems with it after the 0.41 fixes and improvements, please get back to me and we'll work through it.
     
    StevenPicard likes this.
  39. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    I'm far from an expert with BuildR2, but I think it's possible to create realistic looking buildings.
    A lot will depend on the quality of textures you use with it, but the resulting geometry is very good, I think.
    Once the heightmap improvements are finished I'll start releasing some more example screenshots using BuildR2, so you can see what you think.

    I tend to use BuildR2 for larger buildings such as office blocks, and use house prefabs to fill in the gaps automatically using CityGen3D's Roadside prefab spawning system.
    The integration will have a filter so you can tell CityGen3D to use BuildR2 to generate buildings over a certain size, but not do the rest.
    You'll also be able to click on a specific 2D building and get CityGen3D to generate it using BuildR2.

    I'll probably release the BuildR2 integration as open source (for owners of CityGen3D).
    It's fairly experimental and this will allow you to play around with it more freely, and even add new features to it to suit your project.
    It will serve as a good way of showing you how to access some of the data in CityGen3D via the API with a working example, perhaps opening up possibilities with other assets too.
     
    StevenPicard likes this.
  40. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Yeah it's a feature I'm really excited about so it will happen eventually.
    What I wanted to do with CityGen3D was start with real world data because it focuses the mind on what challenges need to be overcome for that to work (as opposed to creating an environment generator and then attempting to support real world input afterwards).
    This approach means it's relatively straightforward now to implement various different forms of input into the system.

    In addition to allowing user to draw maps in 2D, I also really like the idea of a random map generator.
    You'll use sliders and drop-downs to determin the constraints of your environment instead of downloading real world data.
    A bit like a Civilization game setup, where you tell the game what sort of map you want to play on.

    You could effectively use that as a template to get you started and then the 2D editing tools for specific customization. That's the long term plan anyway.
     
    StevenPicard likes this.
  41. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I am not sure if it is possible yet but it would be nice to have biomes. For example, a town in one area and a city in another (different style of buldings and props), or like certain type of trees and plants around the lake and a swamp environment somewhere else, etc. Opens up a lot of possibilities. Another example would be a town in one spot and a ghost town in another. That along with drawing 2D maps would be the most awesome thing. I know you're only one man but you are doing amazingly well so far so I don't feel too bad throwing these suggestions out. :D:cool:
     
    CityGen3D likes this.
  42. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Thanks for the support!

    Different biomes in CityGen3D are basically OSM Surfaces and they control much of how the 3D generation works.

    The defaults are setup really simple so trees appear in Forest and houses appear in Residential areas.
    But it’s possible to achieve really diverse and realistic environments with the tools already available, I just need to document more of it really.

    If you take a look at the Detail panel you can see that the default generator is setup so wheat will appear in Farmland and grass and bushes appear in Forest.
    Distribution within each surface is controlled via noise filters.

    Trees and Roadside panels are also surface based so you can define what appears in each one.

    Let’s take another example. Say you have some ghost town prefabs you want to spawn.
    If your location has an industrial area you could have the Roadside panel spawn those prefabs in the same way residential areas spawn normal houses.
    You could even go to Data->Surfaces panel and define Ghost Town as a new surface and link it to OSM industrial areas. So wherever an industrial area was mapped, CityGen3D would generate a Ghost Town surface when you click Process on the Location panel.

    So much of what you say is possible, you are just limited at the moment to the OSM data in that you can’t draw a surface where you want one (that will come with the 2D editing).
    But even now a OSM surface can be defined to be anything you want it to be. You can then use that to control distribution of everything else.
    I hope that makes sense, I promise to document more of this with tutorials ASAP!
     
    StevenPicard likes this.
  43. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    That makes sense. Thanks!
     
    CityGen3D likes this.
  44. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    I believe I've fixed this and the fix should be included in next update.
    (In the meantime it's fairly harmless, and doesn't affect functionality).
     
  45. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    I forgot to get back to you on this. I followed those steps and did get it working. I also found that my virus checker was just causing so much influence with my Unity projects. When you are dealing with over 30,000 files I think the virus checker just got too nosy. Plus I definitely need more RAM.

    It's a fantastic product.

    Anyways, I think allowing 2D drawing would just elevate this to a near perfect tool (IMO). I would definitely make use of it the same day you released it.
     
    Last edited: Mar 5, 2019
    CityGen3D and Santa36 like this.
  46. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Thanks for letting me know, and I'm happy to hear you got the height mapping working.
    As mentioned previously, big improvements are planned in this area for the next update.
    Not only have I transferred some of the work to Unity Jobs for parallel processing, but I've also made use of the new Terrain API to move some of the heightmapping processes onto the GPU.

    So the heightmap generation should much faster from 0.41. I've delayed release of this a bit just while I finish it off and do final testing, but it shouldn't be too far away now.

    I thought I'd share some screenshots of a recent test.
    Aside from the "Hollywood" sign, everything in the scene was generated by CityGen3D in just a few minutes.
    Although interestingly enough, each letter in the sign is actually mapped in OSM so I could have used the CityGen3D Entities feature to map each one specifically with its own prefab.
    I was mainly testing the heightmap system so I didn't spend much time on getting the vegetation to look that realistic, just a few tweaks to the gradient filter on the Detail panel to stop trees obscuring the Hollywood sign.

    screenshot10.png

    screenshot13.png
     
    StevenPicard and Bartolomeus755 like this.
  47. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    Looks good! Can you add the flattening feature for entities? I have some houses that stick out over the edge of slopes.
     
    Last edited: Mar 6, 2019
    CityGen3D likes this.
  48. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    Eventually it would be nice for CityGen3d to automatically use R.A.M. or Cascade for rivers and bodies of water (and CTS or Microsplat for texturing.) It's not as important to me as the flattening, though.
     
    CityGen3D likes this.
  49. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    169
    Yes this wont be in next update, but should be on the horizon.
    I'll probably tie it in with the BuildR2 release because a lot of the time you are using that feature to build very large buildings and therefore need to flatten terrain under and around them. Although I agree, it's a needed option on Roadside and Entities as well.
    With the new Unity Terrain API it's fairly trivial thing to do now (and it will be quite fast because its on GPU).

    I'm also planning to add in an option for the Roadside and Entities panels where you can specify a maximum range for valid height differential. Or to put it another way, if you don't want to flatten terrain, you can say instead "don't generate a prefab where the min/max altitude range of terrain underneath it is over x amount". This can prevent prefabs being spawned on too bumpy or sloped terrain in situations where you don't want to make adjustments to the heightmap.
     
    Last edited: Mar 6, 2019
    Santa36 and StevenPicard like this.
  50. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    610
    Exciting stuff... :)
     
    CityGen3D likes this.