Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building [RELEASED] CityGen3D | Procedural city generation from map data

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

  1. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Thanks for your crash report.
    I don’t think it’s specific to v0.92 so it should be safe to still update to anyone that hasn’t.

    This crash seems to happen when attempting to use the Buildings generator on a landscape for which a 2D map isn’t currently processed.

    I’ll need to safety this up so the interface warns you about this and doesn’t allow you to use the Generator in this way.

    Intended workflow is: download data, process map, use generator on this location, change location tile, (back to download data, etc).

    Remember that you can generate more than one terrain at once by increasing Area size at start of project.
     
  2. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    A Generator and all its settings are saved in a single prefab. So you can save a modified version of the Generator as a prefab and drag it into the field above the Load Generator button (or manually drag it to the scene).
    I think you should be able to copy Generators between projects as well, at least from the same CityGen3D/Unity version.

    You can do a similar thing with the CityGen3D object. Just save it as a prefab before processing and drag that into any scene to retain your data settings.
     
  3. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    v0.92 includes changes to the CityGen3D API so that 2D map objects can be created in script.
    Here is an example component you could attach to and empty game object and use it to create a new 2D map building using a button on the Inspector, by first listing the lat/lon coordinates that define the shape of the building.

    It doesn't really have a useful purpose in itself (who wants to manually add lat/lon cords on the Inspector!?), but hopefully shows you how you could easily read in lat/lon building data from an external source other than OSM and use that data in CityGen3D.

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4. using System.Collections.Generic;
    5.  
    6. namespace CityGen3D
    7. {
    8.     // Example script showing how you can create a 2D map building in code
    9.     // This approach can be easily applied to other map object types
    10.     // In this example we have to add the lat/lon coords in Inspector, but in practice you would most likely be reading them in from a file from external source
    11.     public class CreateBuilding : MonoBehaviour
    12.     {
    13.         public int type = 0; // building type ID
    14.         public List<GeoCoord> coords; // lat/lon coordinates
    15.  
    16.         public void CreateNewBuilding()
    17.         {
    18.             // need at least three coordinates to make a building
    19.             if( coords == null ||
    20.                 coords.Count < 3 )
    21.             {
    22.                 Debug.Log( "CreateNewBuilding - need at least three coordinates" );
    23.                 return;
    24.             }
    25.  
    26.             // convert lat/lon to Unity world space
    27.             List<Vector3> points = new List<Vector3>();
    28.             foreach( GeoCoord location in coords )
    29.             {
    30.                 points.Add( location.GetMapCoord( Map.Instance.data.GetOrigin() ).GetPosition() );
    31.             }
    32.  
    33.             // create 2D map building
    34.             GameObject obj = Map.Instance.mapBuildings.Create( type, points );
    35.             if ( obj != null )
    36.             {
    37.                 obj.GetComponent<MapBuilding>().RefreshPivot();
    38.                 obj.GetComponent<MapBuilding>().BuildMap();
    39.             }
    40.         }
    41.     }
    42.  
    43.     [CustomEditor( typeof( CreateBuilding ) )]
    44.     public class EditorCreateBuilding : Editor
    45.     {
    46.         public override void OnInspectorGUI()
    47.         {
    48.             DrawDefaultInspector();
    49.  
    50.             EditorGUILayout.Separator();
    51.  
    52.             CreateBuilding cb = (CreateBuilding)target;
    53.  
    54.             if ( GUILayout.Button( "Create Building" ) )
    55.             {
    56.                 cb.CreateNewBuilding();
    57.             }
    58.         }
    59.     }
    60. }
    61.  
     
    chmodseven likes this.
  4. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    I'm curious what other people are using CityGen3D for? I'm a grad student at Univ of Illinois working on generating environments for autonomous vehicles. The resulting FBX will either be used in LG Simulator (Unity autonomous vehicle simulator) or converted to another format for other simulators.
     
    CityGen3D likes this.
  5. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    I got this working which is helpful, thanks. What I was referring to is the ability to not have to click Generate Terrain, Generate Highways, Apply Plot Leveling, etc, Can I call a function in a script that will effectively click that button?
     
  6. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I tried CityGen3D v0.92 on Unity 2019.4 and it worked better then v0.91. I was able to edit some streets on 2D map. When I press "Play", some terrains are missing. Streaming is enabled. When I try to build the game, nothing happens and there is no game.exe file. I think that the instructions on building the game may be wrong in the docs.
     
  7. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Oh I see what you mean.

    I'm currently researching how best to document the API for more advanced uses of the tool, so this is on my todo list.

    In the meantime, I will run some tests to try to provide a useful code example.
     
    overthrowrobotics likes this.
  8. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    If you attempt to build and no exe is generated then you’ll get errors in the Unity console.
    Please let me know what they are so I can point you in the right direction.
     
  9. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
  10. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Thanks Jeff.
    It looks like you are attempting to include the CityGen3D.EditorExtension.dll in the build.
    As indicated in the manual, you must ensure it's excluded.

    I think confusion may have arisen because it should be setup correctly by default in recent updates.
    Older versions of CityGen3D required you to manually set this (but I left the explanation in the docs for reference).

    However, you should be able to fix by selecting the dll and editing the import settings so it's not included in Standalone builds. (Just toggle the Standalone checkbox to invert it).

    If you still have build errors please post them if they are different, or send me screenshot of the DLL's import settings if the same.
     
  11. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276

    Still get build errors.
     
  12. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Please make sure you have Windows 10 SDK and VC++ Toolkit installed.
    You can do this using the Visual Studio Installer, which you'll likely already have on your machine.
    (In your Windows search bar type Visual Studio Installer if you don't know where it is).
    Then for your installation, click [Modify] button to make changes and install the Desktop Development with C++ module, ensuring the Windows 10 SDK is selected as well.

    sdk_install.png

    I'll make reference to this in future versions of the manual
    (I don't think it used to be required, but recent versions of Burst seem to generate this error if you aren't up to date with this).
     
  13. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    I need to make a few API changes to get heightmaps working from script, but this script combines all the other common Generator calls into one button press.
    Basically download and process your location as normal, then click this Start button and it will just build the entire 3D scene for you. :)

    Code (CSharp):
    1. using UnityEditor;
    2. using CityGen3D.EditorExtension;
    3. using Unity.EditorCoroutines.Editor;
    4. using System.Collections;
    5. using UnityEngine;
    6.  
    7. namespace CityGen3D
    8. {
    9.     // Example script showing how you can extend the functionality of CityGen3D with your own window
    10.     // This creates a Scene Generator item in the CityGen3D tools menu.
    11.     // Clicking it will show a window called "Scene Generator", which has nothing but a Start button on it.
    12.     // Pressing the Start button will automatically run several Generator tasks, typically performed using separate action buttons.
    13.     // Simply download and process a location as normal, but instead of using the normal Generator tabs, click this Start button instead and have it all done for you!
    14.     public class SceneGenerator : EditorWindow
    15.     {
    16.         [MenuItem( "Tools/CityGen3D/Scene Generator" )]
    17.         public static void ShowWindow()
    18.         {
    19.             // show existing window instance, or make one if needed
    20.             SceneGenerator window = GetWindow<SceneGenerator>();
    21.  
    22.             // set title and icon of window
    23.             Texture icon = AssetDatabase.LoadAssetAtPath<Texture>( "Assets/Editor Default Resources/Icons/citygen3d.png" );
    24.             GUIContent titleContent = new GUIContent( "Scene Generator", icon );
    25.             window.titleContent = titleContent;
    26.         }
    27.  
    28.         void OnGUI()
    29.         {      
    30.             Map.Instance.data.StartCoroutine( ShowButtons() );              
    31.             Repaint();
    32.  
    33.             // if user interacts with inspector we'll mark the scene the Generator is in as dirty so Unity knows it needs saving to apply changes.
    34.             if ( GUI.changed )
    35.             {
    36.                 EditorUtils.MarkSceneAsDirty( Generator.Instance.gameObject.scene );
    37.             }
    38.         }
    39.  
    40.         public IEnumerator ShowButtons()
    41.         {
    42.             EditorGUILayout.Separator();
    43.  
    44.             if ( GUILayout.Button( "Start" ) )
    45.             {
    46.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.GenerateTerrains() );
    47.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.water.Generate( Generator.GetLandscapes() ) );
    48.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.splatmap.RepaintTerrains( Generator.GetLandscapes() ) );
    49.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.highways.GenerateHighways( Generator.GetLandscapes() ) );
    50.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.buildings.Generate( Generator.GetLandscapes() ) );
    51.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.roadside.GenerateSideObjects( Generator.GetLandscapes() ) );
    52.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.entities.Generate( Generator.GetLandscapes() ) );
    53.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.features.Generate( Generator.GetLandscapes() ) );
    54.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.trees.GenerateTrees( Generator.GetLandscapes() ) );
    55.                 yield return EditorWindowCoroutineExtension.StartCoroutine( this, Generator.Instance.details.GenerateDetail( Generator.GetLandscapes() ) );
    56.  
    57.                 yield break;
    58.             }
    59.         }
    60.     }
    61. }
     
    IJas13, overthrowrobotics and hopeful like this.
  14. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276

    Some terrains are missing!
     
  15. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Is there any pattern to which terrains are missing?
    Are they included in build and are listed in the Available Scenes list on Landscape Manager?

    You can enable the Debug setting on the Landscape Manager which will indicate on screen which terrain the camera is above, which can help work out what terrains are not being loaded.

    In Editor there should be console warnings about any scenes Unity attempts to load but can’t find.

    It looks like alternate terrains may be missing, so I wonder if the terrain size setting on Landscape Manager doesn't match your project settings.
    (eg. the Landscape Manager's terrain size setting may be Large - 1024m but your terrains are actually Medium - 512m?)
     
    Last edited: Jun 13, 2020
  16. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    I've made some changes so the heightmap functions work from script (from v0.93, out soon) and here's the result.
    It shows off the power of the CityGen3D API quite nicely in that it combines lots of different Generator actions into one button press. @overthrowrobotics @Stephen_O

     
    overthrowrobotics likes this.
  17. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I deleted the project and started over. Now, I can see all of the terrains, roads, and buildings.
     
    CityGen3D likes this.
  18. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Great, thanks for letting me know.
    (Another possibility is the layer changes from 0.91 to 0.92 may have had a knock-on here, so if anyone else runs into an issue with upgrading, and can’t easily regenerate scenes from scratch again, please let me know).
     
  19. pokruchin

    pokruchin

    Joined:
    Apr 24, 2019
    Posts:
    38
    Hello, I'm having some troubles with Mapshaper (I need to make a coastline). Here are steps I'm doing: I'm importing downloaded data there. After that I see a b/w world map. I'm openning console and here is the problem: clip function not working for me at all. I mean that even if I type the line from docs "-clip bbox=-5.4,36.1,-5.2,36.2" it gives me just a blank squere. And the same happens with my own coordinates. May be somebody know what am I doing wrong here?
    Снимок экрана (7).png Снимок экрана (8).png
     
    Last edited: Jun 14, 2020
  20. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    The first two numbers in the clip bbox command should be at lower left corner and the last two numbers should be at upper right corner. When you move the cursor, look at the coordinates at the bottom of the screen.
     
    CityGen3D likes this.
  21. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    I just tried it and same thing happened, but it's just the data being out of view.
    If you click the Home icon (house on the right), the window should refresh with your left over data centred on screen.
    (I'll update the manual with this tip!)
     
    pokruchin likes this.
  22. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I downloaded, processed, and generated terrains, splatmaps, roads, and buildings for four sets of 4X4 tiles. I downloaded and tried to process fifth set but Unity 3D stopped responding and I had to call up Task Manager to terminate Unity 3D tasks. This happened two times. I'll try sets of 2X2 tiles.
     
  23. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    If you are doing a lot one after the other in the same session remember to unload scenes you have done from the Editor, so you don’t just keep increasing the amount of stuff in memory without freeing some up.
     
  24. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    v0.93 is out now.

    I decided to combine the functionality demonstrated in the script above into an in-built feature of CityGen3D.
    So you'll notice a new Run Generator button on Location panel (after you have processed map data).
    Simply click the button and it will perform the actions listed, which are changeable using the list boxes and associated controls.

    Each list box item represents a button click on a Generator tab, so along with custom Generator profiles, you can use it to automate things quite extensively.
    I think it will also help new users get into the tool a bit more easily because they can create a new scene without leaving that window and get deeper into the Generator options later on.

    run_generator.png
     
  25. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    What are the differences between small, medium, and large terrain sizes?
     
  26. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    The size of your map in metres is indicated on the Location panel and determined by terrain size and area size.

    Individual terrain sizes are:
    • Small = 256m
    • Medium = 512m
    • Large = 1024m
     
  27. IJas13

    IJas13

    Joined:
    Jul 27, 2017
    Posts:
    19
    Is it possible to export a Landscape in a format like fbx or obj? I tried the fbx exporter by Unity and it gives some weird behaviors (Buildings in the editor aren't visible until you select one?!). In Blender it shows somehow correctly. But this also gives some texture problems on the street. Also the obj exporter on https://wiki.unity3d.com/index.php/ExportOBJ doesn't seem to work since it gives an empty folder.

    I would like to export it to blender so I can optimize the Landscapes.
     
  28. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    Lane width for railway tracks in 2D map should be 1.5 meters. Width of USA tracks (spacing between rails) is usually 4 feet 8-1/2 inches.
     
  29. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    The default width for railway on the Data-Roads panel isn’t referring to the gauge, but how much ballast texture you want applied around the railways.
    The default is arbitrarily set to 5m but you can set this to what you want.

    The 3D railway is setup on the Generator-Features panel, where the actual gap between the rails on the railway (the gauge) is set to the 1435mm standard through the combined values of the offsets of the rail extrusions.

    So the default setup should be at a fairly realistic scale, but you can tweak the settings to suit local variations.
     
  30. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    CityGen3D terrains are just Unity Terrains, but I’m not sure what the best workflow is for exporting those.

    Have you run into specific performance issues with them? Much of the bad reports on them predate recent features and optimisation improvements that are present in Unity 2019.

    Don’t forget you can try to reduce Pixel Error setting if you need to.

    You will lose auto LOD and terrain mesh instancing by moving away from Unity Terrain workflow, so it’s hard to imagine that you’d get better performance from a traditional mesh.

    I’ll have a play with the FBX exporter when I can to see if I can provide any further insight regarding exporting of CityGen3D procedural meshes.
     
  31. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    Hello.
    I use Unity 2019.3.11f1 personnal
    I have tried generate coastline with both b0.92 and b0.93 and have the same problem : when processing my San Francisco map (1 tile, whatever size) if I have processing filter "coastline" (meaning "all" select) No grass and no sea displayed on 2D map (so 3D doesnt come properly).
    If I uncheck coastline, I have of course grass everywhere and 3D map is ok but of course no sea.
    If I edit existing canal water shape, I can draw the seashore manually and it works but not with the geojson file.
    I tried several json map size to be closer from calculated map but it doesn't help.
    Geojson files visualy look ok when I upload them back in https://mapshaper.org/ so I Don't think I missed Something Following the generation process.

    I attach a Screenshot with 2D map generated with no grass, no ocean, and the San Francisco json if you see Something I should try to solve this problem.
     

    Attached Files:

    Last edited: Jun 17, 2020
  32. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    These MapShaper commands seemed to work fine for me for this location.
    As you can see, I just saved the resulting geoJson export as "San Francisco.json" and referenced it in the Coastline field before Processing in CityGen3D.

    SanFran test.png
     

    Attached Files:

  33. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    When I go into 2D Map and click on a road to edit it, how can I add or delete the white dots? Your video doesn't have closed captioning.
     
  34. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    The Map Editing preview video has a keyboard overlay bottom-right showing me adding nodes with Numpad+ and removing them with NumPad-.



    I intend to publish a more detailed map editing video fairly soon showing an example custom map workflow complete with perlin noise heightmap and map editing toolbar functionality, which were added after that video was made. (I'll also be adding a Map Editing section to the manual asap).
     
  35. IJas13

    IJas13

    Joined:
    Jul 27, 2017
    Posts:
    19
    So just wanted to let you know what I want to archive with that.
    I want to combine all Meshes into a single Mesh with a single Texture. That way I can reduce the Batches from couple of hundreds down to under 20. Also with that not having multiple Materials instead only one with a single Texture and Material.

    Maybe I should buy Mesh Baker since it does all of that (and also support custom Shaders?) Has someone here maybe used CityGen3D with Mesh Baker?

    In Blender I could delete unnecessary Tris/Verts and slice that whole Mesh into e.g. 4 pieces and activate the appropriate one when the player is nearby for more optimizations. I have wrote a custom Editor Script which deletes all LOD Objects and Components so only the Object with smaller Tris/Verts is left.

    The Unity Terrain is not that important since I have already made some optimizations in the Terrain Settings so I can put the combined Mesh on top of it (Don't need to combine it with the Terrain).

    I am targeting mobile devices. On my iPhone 6s it works smoothly with constant 60 fps. But its getting really warm after a couple of minutes. Also on some newer Samsung devices its having some fps drops. I think on both devices the lowering of the Batches Count will drastically help.
     
    CityGen3D likes this.
  36. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Thanks for your detailed explanation.

    Post first full release I have already promised another user that I will investigate the possibility of adding built-in support for low poly mesh based terrain for a different work flow and art style.
    It's unlikely anything will happen with that over next few months, but just thought I'd mention that it is on my radar as a possible angle for future development.
    (Although depending on how much work that is it may be an optional add-on).

    In the short term there's a few tips that may help you target low end hardware (all of which I'm currently adding to an updated manual).


    By default, CityGen3D procedural buildings create two LOD levels.
    LOD0 is a higher res mesh with a "Facade" shader applied that on supported hardware will add even more additional detail at run-time through tessellation.
    LOD1 is a lower res mesh with a "FacadeSimple" shader applied that is very low poly and doesn't tesselate at run-time.

    For mobile, it's really easy to change this so that the fancy LOD0 mesh isn't generated.
    (This will mean buildings are generated much quicker as well).
    Select Assets/CityGen3D/Resources/Prefabs/Building.prefab and view the LOD Group in the Inspector.
    All you have to do to change LOD settings for your buildings is to edit this before generating them.
    Note that no mesh renderers are assigned (because they are procedurally generated), Unity will just use these settings for your buildings and assigns the meshes for you per instance.

    So delete one of the LODS in the LOD Group so only LOD0 and Culled remain.
    Then when CityGen3D goes to generate buildings it will see that you have set it up to only generate one LOD level and therefore only build the lower res version of the mesh without tessellation shader. In other words, it will build a LOD0 mesh and not a LOD1 mesh for each building, but the LOD0 mesh will be low poly FacadeSimple version instead.


    More broadly, CityGen3D has basic Mesh Batching that combines geometry into a single mesh (although it doesn't combine textures). For example when extruding Feature prefabs such as walls and guard rails, CityGen3D does this by joining up lots of prefab instances and then batching them together so you are left with a single long mesh, which is more performant than lots of individual objects.
    (Cloning of identical objects such as street lights doesn't using batching so you can take advantage of instancing, although I may expose this as an option at some point).

    The CityGen3D MeshBatcher API probably needs a bit of love and attention, but even in its current state you may be able to achieve some batching using this without a third party add on.
    It works by batching child meshes, so you simply add the MeshBatcher component onto a parent, it works its magic with one function call, so you are left with a single mesh.
    Now obviously this isn't going to be as advanced as a fully fledged Mesh Baking utility, so if you are looking to atlas textures as well, you will likely need a third party add-on such as MeshBaker.

    Code (CSharp):
    1. // CityGen3D batching example code, assumes GameObject obj has child game objects each with a mesh and that you want to batch them into a single multi-material mesh.
    2.        
    3. // add Mesh Batcher component
    4. MeshBatcher batcher = obj.AddComponent<MeshBatcher>();
    5.  
    6. // batch all child meshes into single mesh
    7. batcher.Batch();
    8.  
    9. // delete original meshes by destroying parent (assuming you want to)
    10. DestroyImmediate( obj );
     
    IJas13 likes this.
  37. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Just to let everyone know, that after some consideration over the last few months, I've decided to remove support for Bing and MapQuest server heightmaps for v1.0. (I don't believe they are currently working anyway on latest build).

    Their implementation pre-dates the NASA SRTM implementation which I think is much better, and has been the default since it was put in. It doesn't rely on third party servers because it's just a download with no key tracking.

    So I'd rather drop them and concentrate future development in this area on improving the NASA implementation (perhaps auto download from within Unity and such like), rather than having to maintain the older implementations, which are relatively complex due to the third party server access.

    However, I'll keep the code safe in case things change in the future and there's a good reason for it to be brought back.
     
    Santa36 likes this.
  38. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    To perform test from zero I used hub to install Unity 2019.4.1f1 instead 2019.3 I had, and used Gencity Beta 0.93
    New project using your San Francisco.json file.
    Unfortunatly I have the same problem with no grass and no ocean.
    Anything else I could test ?
     

    Attached Files:

  39. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    OK, I found how to have it worked.
    I switched Windows display and regional settings from French to English UK, log out, log in, process again the Json file in the same scene and it works.
    There is maybe something in code relying on Windows local digit seperators settings that is "," and not "."...Or something else but this can help you to find why costline is not working when my Windows is setup in french
     

    Attached Files:

    CityGen3D likes this.
  40. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    That’s very helpful feedback, thanks very much.
    I’ll run some tests here and should be able to get a fix in for next update.
     
  41. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    I'm talking to the developer of FBX Exporter. There is a known problem with exporting terrains that he is actively fixing.
     
    IJas13 and CityGen3D like this.
  42. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    One more thing on exporting FBX, don't export the scene, select Landscape 0 and export that. When I do that the buildings all export fine, it's just the terrain that doesn't come through.
     
    IJas13 and CityGen3D like this.
  43. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    I have an error when building project. I was able to add assets "Realistic Car Controler" and "module based city pack" that has scripts for destructible assets like street lamps and fire hydrants. Objective is to spawn new objects on road side. All can be run in the scene with no blocking error.
    Unfortunatly when I build the scene I have the error on createbuilding.cs script that is in screenshot.
    Errors are the same when starting an empty new project with just cityGen3D and want to build it.
    There are still errors with createbuilding.cs even is no building have be generated
    Any idea what it could be ?
     

    Attached Files:

  44. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Thanks for reporting this. I’ll fix properly for v0.94, but for now easiest solution is just to delete the CreateBuilding script.
    It’s just an example script that can safely be removed.
     
  45. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    This works, thanks.
    I search now how to have larger sidewalk and how to finely tune the sidewalk height above the road to keep better car control when driving from road to sidewalk (it's already good but I would like to have control on this).
    I went through all Generator menus and didn't see that there was a specific roadside sideway prefab listed or in any other menu to remove and generate again, or to set the width or height of roadside.

    Will it work if I edit sidewalkLeft.3DS or sidewalkright.3DS or is there an easier way now or in the future ?

    Is there a place I missed for global sidewalk texture ? maybe it picks up already on of the terrain splatmap texture at generation but I am not sure ?
     
  46. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Unfortunately there isn’t an easy way to change sidewalk width and curb height at the moment.

    I will look into whether I can expose these options for an upcoming release.
    CityGen3D is feature locked for Asset Store submission now, so this probably won’t happen before v1.0, but I think it should be achievable for an update soon after.

    I don’t think editing the sidewalk meshes directly will give you the results you need. But I’ll keep you informed of any future improvements in this area. (Also note that the .3ds meshes are to be .obj in future updates for Asset Store compliance).

    There was a bug with the sidewalk texturing interface but this is believed to be fixed now.
    Sidewalks are set up to take the underlying terrain texture, but you can assign them a texture based on the surface type that they are on.
    This is done with the Sidewalk Texturing section of the Generator-Highways panel.
     
  47. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    This is an odd request, but is there any way to download a smaller map? I went into the Data prefab and tried to manually set the min and max GPS coordinates but it gets overwritten. I also went to openstreetmap and selected the small scene I wanted and click the overpass API export option and then select XML option to import it. It quickly processed it but the scene is just all green, just a green block, no roads, buildings, etc.

    I want to test an export of a really small scene into another program (Gazebo simulator) and a full map eats up a ton of memory in it.
     
    Last edited: Jun 21, 2020
  48. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    The smallest you can do at the moment is 256x256m.
    How small do you need, I could perhaps add in an additional option for 128x128, or do you need smaller than that?
     
  49. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    680
    Hi everyone,

    Just a quick note to say there’s a known issue with heightmap generation on multi terrain environments in most recent update.
    This is being fixed for 0.94 which should be out later this week.
     
  50. overthrowrobotics

    overthrowrobotics

    Joined:
    Jun 19, 2015
    Posts:
    47
    128x128 is probably ok.

     
    CityGen3D likes this.