Search Unity

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

Discussion in 'Assets and Asset Store' started by CityGen3D, Jul 8, 2020.

  1. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Thanks for your response, if you used something like mesh baker would that work to create an atlas for the replaced textures? and how long is the asset on sale for please?
     
  2. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    The sample building materials were created and atlased in Substance Designer.
    But any tool that can combine different materials into an evenly spaced grid on a single material will be suitable.
    (I think Mesh Baker is probably capable of doing that but I haven't tried it).
     
  3. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    The mouse controls in FreeCam prefab don't work properly. When I move the mouse forwards or backwards, the camera "zooms" in or out instead of moving forwards or backwards as if the camera is "walking". I tried to use Realistic Car Controller and Vehicle Physics Pro but they don't work properly because they use Layer 8 which CityGen3D uses for post processing. How can I fix the problems?
     
  4. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    FreeCam controls are WASD for movement, hold LeftShift to go faster, mouse to look around. (I'll put a help box on the component with these controls for next update).
    If you view the FreeCam Inspector you'll see the transform update as you move around, showing it's changing it's actual position in the scene.
    If that's not the behaviour you are seeing in Play mode then there's probably another script doing it.

    You can change the layers CityGen3D uses using the CityGen3D Layer Manager to avoid clashes with third party assets.
    There are known issues in changing Map layers (16-21) which I'm working on for an update, but certainly the Post Processing layer can be changed using the LayerManager and all should work well.
    Note you should ideally setup layers at the start of the project as the Layer Manager hasn't evolved enough to update existing objects yet if you change something. So more improvements coming to this system in future, but it in most cases it should give you enough freedom to change stuff around to avoid unwanted clashes.

    layer_manager.png

    Edit: also just noticed the help box for the layer Manager tells you to click Apply Changes, which is what it used to be called. I'll fix that, it is now the Setup Layers button :)
     
  5. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi Purchased the asset the other day and have read through the documentation but it doesn't really explain how to replace the textures for buildings under Building, construction, blueprints.

    I have looked at your videos also and can't see any explanation on how to do this.

    A video explaining how to edit the blueprints and make them custom with custom textures would be very helpful as it would give the package a lot more versatility to meet customers needs for there projects. The tool seems really powerful and could potentially save a lot of time with some initial planning and legwork and figuring out how things work.

    1. Can the textures just be swapped out on the material for the facades and then will these be applied to the blue prints that are placed on the buildings?

    2. How are the blueprints edited? (you mentioned about there being texture atlases.) is this what you are calling them in the plugin?

    Sorry for all the questions new to the plugin and texture atlases.

    Thanks in advance :)
     
    CityGen3D likes this.
  6. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Hi Toby,

    Thanks for purchasing CityGen3D and for your message.

    So I started writing more thorough documentation in the manual for the buildings system back before v1.02 came out, but while writing it I identified some improvements I wanted to make to the interface.
    Therefore I only partially released the updated documentation in v1.02, which is why there is currently only one chapter in the buildings section of the manual.

    Now the good news is, these improvements should be ready very soon and will be included in the v1.04 release later this month along with a lot more information and how to go about customizing the buildings with extra chapters in the manual.
    I'll almost certainly do a video tutorial on this subject around the time of release as well.
    In the meantime I can explain a bit more about the system here to get you underway, as everything I say now will still apply once v1.04 is out.

    Basically each building type is defined by a Blueprint prefab, which is a collection of Plans, and each Plan defines what a storey in the building will look like from the material atlas it uses.

    Editing of Blueprints and Plans is done via the Inspector, and its here that you'll hopefully see more improvement in v1.04 to make it more graphical, but the fundamentals will remain the same as they are now.

    If you locate the Shop blueprint, you'll see it has a ground floor assigned to "Office Ground Floor 01" plan, while middle floors are assigned the "Residential 01a" plan.
    The end result is a building that looks like a shop on the ground floor with apartments on the upper floors. (We could specify a different plan for top floor if we wanted to, but in its absence CityGen3D just uses the Plan assigned to Middle floors for the top floor).

    You'll also notice that all Blueprints have a Basement floor assigned to them. This normally looks the same as the Ground Floor, but without windows, and is used to fill in any gap between the bottom of the ground floor and the underlying terrain, when ground underneath isn't flat.

    A material used in a Plan is called a Facade Material and, as you pointed out, actually consists of one or more materials arranged in an evenly spaced grid.
    Something like the supplied Residential Facade Material is made up of 16 different materials in a 4x4 grid and includes different coloured doors, different windows, with and with guttering, etc
    Whereas the Glass Office Facade Material is just a single material which is also valid. Plans also support 2x2 layout to give us 4 different materials.
    Only important thing here is that each cell in the grid has to be of equal size, but this keeps things very simple to work with.

    We use the Plan prefab to group the different materials in a Facade Material together, so CityGen3D has a concept of what part of the material it can use for a door or a window. For example, this is how we ensure doors are only generated on the ground floor.

    Locate the Residential 01a Plan in the Facades folder and view the Inspector. You'll see 7 groups defined and each texture in the atlas (0 to 15) is assigned to one of these groups.
    Then take a look at the Red Brick House blueprint. You can see the Residential plan being used in a different way for each of the floors in a house in order to get doors on the ground floor and guttering on the top floor.
    So you can see with a bit of creativity you have quite a lot of control over what a building looks like using this approach, and it's also performant because relatively complex building facades can be made out of a single material, which reduces draw calls.


    The actual materials themselves can be created with whatever software you are familiar with, but I used Substance Designer to create them and then batch them into a single material.
    The heightmap texture in the material tessellates the mesh to provide the additional geometry on an otherwise flat mesh (on supported hardware), so you don't have to worry about 3D modelling with this workflow.
    But they are fundamentally just normal materials, so you can swap out the textures very easily just by assigning them to the slots in a Facade Material.

    if you have no previous experience in generating textures or materials I highly recommend looking at the work of Jonathan Benainous.
    You can download some of his Paris architectural materials for free and you can see how certain things are done.
    As I recall the substance graphs are well commented and arranged so are really good at demonstrating things.


    Hopefully this explanation helps a bit. The other settings will be covered in the updated manual, but feel free to ask specific questions if you need any further assistance in the meantime.
    I suggest just copying one of the Blueprint prefabs and associated Plans and making some changes, that's the best way of understanding how everything all fits together.
     
    Recon03 likes this.
  7. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    It can be a lot of work to get the buildings replaced with custom ones. Any chance you'll modify this so that any prefab can be used (as is) as an alternative method?
     
  8. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    So the aforementioned workflow is specifically related to the procedural building system (Buildings tab of the Generator), which will create a 3D building based on a 2D shape, whether that be a custom shape or one mapped in OSM.

    One of the advantages of this system is that it allows you to create custom buildings without any 3D modelling (which can be very time consuming), and instead transfers the workflow to material creation.

    However, this system is primarily designed for incidental background buildings, such as those you’d see in a driving game or flight sim.
    If you want to create buildings that you can interact with, open doors and walk inside, then you’d want to consider a prefab based workflow.

    You can already automatically spawn prefabricated buildings in CityGen3D using the Roadside panel, but this won’t place individual buildings where they are mapped. Instead it instantiates buildings on certain surfaces so you can easily spawn house in areas mapped as residential or factories in industrial areas, etc.
    (Most of the early screenshots of CityGen3D in the old work-in-progress thread demo this, from before the procedural building system was implemented).

    What I do want to make a bit easier, is to spawn building prefabs in their 2D mapped locations, where you aren’t bothered about matching up a specific shape exactly, but do want full control over their placement (in the same way the Entity system works for placing post boxes and such like).

    I recently bought some nice prefabs ahead of a tutorial on this subject, so I promise to demo this in more detail as soon as I can.
     
    StevenPicard likes this.
  9. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    hi, suppose we want to make a traffic system on a generated environment, can we access the road data to place splines or checkpoints, thank you.
     
    CityGen3D likes this.
  10. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Yes you can access map data for implementing your own solutions or to hook up third party assets.

    The intention is to release an official traffic add-on later next year, so part of that process will involve improving the core system to accommodate it.
    But even now you can easily query road and lane waypoints.

    The upcoming Vegetation Studio Pro integration will demo this more thoroughly, because it will demonstrate in code how to access CityGen3D Map Surfaces (and in this case apply VSP Biomes to them).

    However, if you need any help in the meantime, just send me a message.
     
    StevenPicard likes this.
  11. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    recently purchased this and enjoying it, good product.

    yesterday i tried the scene streaming feature(8x8 grid, 512x512 terrains), a few years ago i also experimented with the async scene loading feature but the loading of the scenes were noticeable and it was useless for me. i can see the same behavior with yours so it seems there is no improvement on the unity side. am i missing something here? when a scene load happens there is a slight hiccup and i can easily feel it while driving especially if making a turn, you can easily loose control of the car when this happens.

    *tried with an actual release build not talking about editor time.
     
    CityGen3D likes this.
  12. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Thanks for the compliment, I'm happy to hear you are enjoying CityGen3D!

    I've done quite a lot of research on this Unity Async topic, but there's more I want to do in the coming months.
    As you alluded to, there's only so much you can do outside of modifying the Unity source code, but I feel I definitely made progress in this area last time I looked at it.

    In my tests it was actually the unloading of scenes (rather than the loading of new ones) that seemed to occasionally cause micro-stutters and in particular the unloading of Unity Terrains.

    I did put some improvements in one of the updates (I think v1.02) with regards to how CityGen3D manages this process, which reduced the problem for me quite considerably, but from what you say it sounds like there's still room for further improvements.

    I also have a driving game prototype in the works, which is essentially a testing ground for this type of thing, so I'll revisit it and see if I can isolate the problem further.
     
  13. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    you might be right about terrains, my attempts did not include terrains and my problem was not about the actual loading of the scenes but the activation of the gameobjects. for ex. if all of the gameobjects in the scene are deactivated and saved then loading has no impact but activating all of the objects at once causes problems. so my theoretical solution is to load all objects as inactive then sort them according to distance to camera and activate a small set of them per frame.

    looking forward to your further work, have a nice day.
     
  14. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    I think you should always have new objects monitor load and time and turn on in stages.
     
  15. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    @CityGen3D is there a plan for optimizing the scene size, for ex. in some scenes buildings take a lot of space or is it normal?
     
    Last edited: Dec 22, 2020
  16. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I checked out Cesium Stories and it seems to have better terrain than the one generated by CityGen3D. I also found out than Unreal Engine V5 will make it easier for people to create cities from GIS data (I think).
     
  17. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Normal optimization rules apply to CityGen3D scenes, so the best way to reduce it is to reduce texture size.
    There's some general Unity tips here.

    The only CityGen3D specific tip I can give is that if you find the Building prefab in CityGen3D\Resouces\Prefab and remove LOD1 so you just have LOD0 and Culled, then CityGen3D will only generate the low-poly non-tessellated version of the building when you Generate Buildings, which is recommended for mobile, and will reduce scene size.
    (This tip has been added to the manual ahead of v1.04).
     
  18. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Most GIS tools like Cesium (which costs minimum $1800 per year for a commercial license), use photogrammetry and satellite imagery, so they good from afar, but are not suitable for first-person rendering at ground level.
    In the same way you couldn't use MS Flight Sim tech (Bing) or Google Earth meshes to create GTA, you can't really use these tools for creating most game world solutions.

    So this type of technology is very good for a specific purpose, but not for an all-purpose world generation solution.
    Perhaps the main advantage of something like CityGen3D for game dev is the ability to customize everything relatively easily (including making your own maps), allowing you to deviate from the real world substantially if you want to, while retaining the procedural generation capabilities. That's not really possible with raw photogrammetry or satellite images.

    However I do think satellite imagery has a place in CityGen3D, and I'm currently prototyping a module that can automatically texture your terrains with Bing satellite images, which is handy if you are making something like a flight sim, or want it in Unity as a reference.

    Other terrain improvements coming very soon in CityGen3D include:
    • automatic removal of erroneous SRTM height data where buildings are.
    • automatic download of SRTM height data from within Unity for your selected terrains.
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    The terrain height level improvements sound great. I was testing the plugin with Philadelphia, and I noticed that the current data produced sharp hills in the downtown area where the skyscrapers are, when Philly is mainly flat as a tortilla.

    I also like the option to include satellite imagery as a reference. :)
     
    Recon03 and CityGen3D like this.
  20. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    is there a way to put the procedurally generated stuff to prefabs or copy to other scenes?

    and can we somehow change the way roads are generated, i think roads should also be separate meshes just like sideways.

    sorry for asking too many questions :)
     
    Last edited: Dec 23, 2020
  21. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    SRTM data is only accurate to 30 metres, and while CityGen3D does its best to interpolate between those points, this can inevitably lead to odd-shaped contours whenever there is a steep gradient somewhere.

    Many government websites at either local/state/federal level offer open data DEM downloads, that are usually more precise than SRTM. For Philly, I can see https://www.opendataphilly.org/ gives a 5 foot accuracy LiDAR DEM. The process of importing such DEM files and then lining up the coordinate systems to overlap and replace the SRTM DEM is extremely difficult, however, but it can be done - I have managed to get it working with both UK and Australian open data, using libraries such as GDAL to ease the pain of coordinate maths somewhat. Every data provider is different of course, so you'd have to treat each city on a case by case, but it can be done.
     
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    Yeah, I suspect that manual smoothing and other such adjustments are going to wind up being the practical thing. But better data is always welcome.
     
  23. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    The main problem I want to solve is the data issues where buildings are present. There are often notable spikes in the SRTM data where tall buildings appear.
    In this screenshot you can see raw SRTM data reporting much higher terrain height values where there's a tall building despite the terrain being relatively flat and consistent in the area.

    building_srtm.png

    So I intend to provide an option to filter out these spikes by identifying heightmap samples that overlap a building position and then trying different self correcting algorithms.
    Either by offsetting known building heights (from OSM), or by adopting a nearby safe sample if the sample is over a building.
     
    chmodseven and hopeful like this.
  24. nemeth-regime

    nemeth-regime

    Joined:
    Feb 13, 2017
    Posts:
    40
    Is there anyway to get the road name of the road that a character or object is on?

    I have tried using raycasts but that does not seem to work correctly.
     
    CityGen3D likes this.
  25. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    There's actually a demo script for this called RoadInfo.
    If you add this component to a Camera object (eg the Camera child of the FreeCam), then the road variable will update as you move around the world.

    Code (CSharp):
    1. using UnityEngine;
    2. namespace CityGen3D
    3. {
    4.     // attach to gameobject to get road data at its location
    5.     public class RoadInfo : MonoBehaviour
    6.     {    
    7.         public MapRoad road; // the road at current location
    8.         public float checkRadius = 1.0f; // how far away from location do we consider to be within bounds
    9.         public float checkFrequency = 1.0f; // how often should be check for change (seconds)
    10.  
    11.         void Start()
    12.         {
    13.             InvokeRepeating( "RefreshRoad", 0.0f, checkFrequency );
    14.         }
    15.  
    16.         void RefreshRoad()
    17.         {
    18.             road = Map.Instance.mapRoads.GetMapRoadAtWorldPosition( transform.position.x, transform.position.z, checkRadius );
    19.         }
    20.     }
    21. }
    You could easily extend this so that the road name is shown on screen.
     
    nemeth-regime and hopeful like this.
  26. thor42168

    thor42168

    Joined:
    Sep 17, 2020
    Posts:
    2
    Hi. I'm a new user of the CityGen3D Asset. Sometimes a existing road is not generated as a road, just empty. Inside openstreetmap it has a darker grey color. Any hints about how to improve that detection?
     
  27. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Please can you send me the lat/lon location and road that's missing and I can investigate for you.
     
  28. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Two questions , first is there any way to adjust the street width, say scale it to 1.5

    Second are any waypoints generated ?

    I have some scripts to map an array of points to some of my gameplay logic .


    Edit : 3rd

    Any intergration with Gaia ?
     
    Last edited: Dec 30, 2020
  29. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Hi,

    You can edit lane widths for each road type via the Roads tab on the Data window. This will require Processing of the map again.
    After processing, you can also edit individual roads by clicking on them in the 2D map.
    Any changes you make there will be reflected in the 2D map immediately, and you'll need to regenerate the scenes.

    You can get road waypoints like this:

    Code (CSharp):
    1. List<List<Vector3>> positions = road.GetPositions();
    2. foreach ( List<Vector3> path in positions )
    3. {
    4.     int count = path.Count;
    5.     for ( int i = 0; i < count; i++ )
    6.     {
    7.         Vector3 pos = path[i];
    8.     }
    9. }
    You can access lane waypoints like this:

    Code (CSharp):
    1. List<List<Vector3>> lanes = road.GetLanes();
    2. foreach ( List<Vector3> lane in lanes )
    3. {
    4.     int count = lane.Count;
    5.     for ( int i = 0; i < count; i++ )
    6.     {
    7.         Vector3 pos = lane[i];
    8.     }
    9. }
    The y-axis of these positions is always 0, but you can use this to get a height value for a position:
    Code (CSharp):
    1. Generator.Instance.GetAltitudeAtWorldPosition( pos )
    I might add this call in as an optional parameter inside the functions at some point, but I don't do it by default because it can be a bit slow if you are querying a lot of positions, and often you only need the position in 2D space.

    I'm aware of some users using CityGen3D with third party terrain tools like Gaia.
    There's a bit more info on this thread with some users having tried it.
    https://forum.unity.com/threads/rel...eal-world-map-data.927984/page-3#post-6497176
     
  30. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Awesome, does this intergrate with Easy Roads at all ?

    HDRP support ?

    I'm not going to need to use any of these calls at runtime, I'm going to create some editor scripts to set up my AI logic though. If you could add some more code examples of how exactly to say get like a list of all the roads, ETC that would be great. I'll probably buy it this weekend
     
    CityGen3D likes this.
  31. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Is there an way to move the map view in the Data tab Location screen?
    My area selector is not centered, it is always at the very far right edge. Kind of useless when determining if the area I am interested in is in focus. I do not want to move using the filled arrows, as that changes the focus to the next area.
    upload_2021-1-1_10-51-24.png

    Also, is there a way to shrink the map view so that I don't have to use the scrollbar so much? Why can't I use the mouse wheel to move the entire tab view up and down? Consider adding horizontal and vertical scrollbars to the map view so we can move around easier.

    Mark
     
  32. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    CityGen3D works alongside EasyRoads, which has it's own OSM integration.

    CityGen3D now has an HDRP package (in Packages folder) which you can extract and then import into an HDRP project instead.

    You can get road data like this:
    Code (CSharp):
    1. foreach ( MapRoad road in Map.Instance.mapRoads.GetMapRoads() )
     
  33. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    You should be able to move around the map by holding right mouse button and dragging.

    I intend to improve usability of the Location interface which will include a fix to the scrollbar on that tab, and possibly a location search facility.
     
  34. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    I'd be interested to see some guidance on how to handle the workflow there, as EasyRoads3D Pro was one of the assets I bought in the recent sales. Also Vegetation Studio Pro integration, which I believe you mentioned coming soon. Maybe some more video tutorials showing how you've worked with them might help?

    Also, I'm wondering if BuildR integration is still a thing? I keep putting off buying that as unless it adds true value to CityGen3D beyond what's already there then I can't justify it, but the sale is ending soon.
     
  35. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @chmodseven @CityGen3D I hope Buildr Integration is still a thing! Regardless, I own Buildr (v1) and Buildr2 (V2) and absolutely love this asset. I highly recommend buying it. I paid full price for that one and do not regret it. Jasper provides great support too.

    I create a "dev project" just for Buildr, and use it to generate my building models & prefabs for placement in my working levels. I like that Buildr allows you to build LOD-1 style building shells and LOD-0 with full interiors now. I have not tried using them in CityGen yet. It's on my ToDo list.

    EDIT: Oops, just looked, it's actually Buildr v3.1.1, not 2. :)

    Just my 2¢. Collect the whole dime!
    Mark
     
    Last edited: Jan 1, 2021
    twobob likes this.
  36. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    You have convinced me, sir! Just bought it. :D
     
  37. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    So latest news on integrations is that Vegetation Studio Pro is coming in the next update (v1.04), which I delayed until this month to squeeze some other height-mapping features in, but that is arriving once those are complete.

    I'll then revisit the BuildR integration which I should be able to release in v1.05.

    However, a very simple integration can be done by accessing the building data in CityGen3D like this:

    Code (CSharp):
    1. foreach ( MapBuilding building in Map.Instance.mapBuildings.GetMapBuildings() )
    Then you can get the waypoints for the building shapes:

    Code (CSharp):
    1. List<List<Vector3> shapes = building.GetPositions();
    2. foreach( List<Vector3> shape in shapes )
    3. {
    4.     // pass in shape to BuildR to create building from 2D shape
    5. }
     
  38. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Can you add a new tutorial on im porting height map data.

    I tried to pull in the NASA data and it doesn't work
     
  39. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    The most common reason it appears not to work is that the altitude data is out of range, or in other words higher than your Peak setting.
    Please increase Peak setting to something like 1000 and try again.

    I'll see if I can output a warning for this if a sample higher than Peak is read from the SRTM data.

    Auto Range is also useful to avoid this problem, because this will ensure the Peak setting is set high enough to accommodate your selected location. It's just not suitable if you intend to stitch multiple regions together because Peak and Nadir should be consistent across all your terrains in the same project (and Auto Range can only check the current region).

    If it's the actual downloading of the data that you are having issues with, this is being simplified in v1.04 so CityGen3D will download and unzip HGT files for your selected terrains if it detects they are not present.
     
    Last edited: Jan 2, 2021
  40. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    For the NASA heightmap creation, I couldn't find a way to download a set coordinate from the website, I can only download the tiles.
    I'll explain a little bit what I'm doing for a better context:
    Large scale environment (100+km²) that I'm generated with Real-world terrain, vegetation with Vegetation studio. I was using the buildR and easy roads integration, but looking to swap out buildR with CityGen ( and maybe easy roads, since the roads generated from OSM in CityGen feel pretty good to me.) Terrains are already created, which is why I was trying to find a way to match what the NASA heightmap + citygen generate to terrains that do not align with the dataset CityGen is pulling from.
    Any clues on how to proceed would be greatly appreciated.
     
  41. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    SRTM data is provided in HGT files which cover a fairly large region.
    But in a normal CityGen3D workflow, it will pull the data for your terrains from the HGT file that covers your location.
    So the only thing you need to do is to ensure the correct HGT file is present in your project (and from v1.04 CityGen3D will get this for you if it's missing too).

    But if you already have terrains generated, what are you trying to do with the heightmap data?
     
  42. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    To place the generated buildings correctly on the heightmap ( generated a twin of the terrains I've created with buildR, matching them 1:1 and just use the buildings generated by CityEngine on top.)
    I'll test again the generation - Unity's rebuilding library for the past 2 hours :/
     
    Last edited: Jan 2, 2021
  43. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    CityGen3D doesn't reference NASA data after a heightmap has been applied, the raw SRTM data is just used for heightmap generation.
    Once the heightmap has been applied, all other references to altitude at a location are calculated by sampling the Unity terrain itself, which will give you a true value.
    (Keep in mind that raw SRTM data only has samples every 30 metres, so even if you did sample it it wouldn't be very useful for this purpose).

    So you just need to do something similar to reposition CityGen3D buildings over a third party terrain and sample the actual terrain height underneath the building.
     
  44. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    Oh that sounds exactly what I hope was happening under the hood. I'll take a look, thanks!!

    The integration with vegetation studio is coming in 1.04 correct?
     
    CityGen3D likes this.
  45. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Yes, it should be out this month. As with all future official integrations, they will evolve over time based on feedback.

    The main function of it in first release will allow you to easily pair up CityGen3D Map Surfaces to Vegetation Studio Pro Biomes, in the same way you can match up Map Surfaces to different textures on Splatmap window.
     
    hopeful likes this.
  46. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    So for the next version, can you just make sure to automate the entire process. As in provide recommended settings, because right now it just feels like the asset is broken. I'm not going to bother to for refund but I would like you to address this in the next version
     
  47. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Yeah as I stated above, improvements to aid usability and improve workflow for heightmap generation are already in progress for v1.04.

    In the meantime if your issue is not solved by simply increasing the Peak setting on the Heightmap interface (to avoid unwanted capping of the altitudes) please reach out to me again and I can help you out.
     
  48. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Due to popular demand a Discord server has been set up for CityGen Technologies and you can find the CityGen3D room here: https://discord.gg/j92dGpsagy

    With your help we can make this a great place for the CityGen3D community to ask questions, share tips, seek help, show off their CityGen3D environments, and discuss features.

    Anyone is free to join so if you don't own CityGen3D you can still add the channel to learn more about the asset.
    If the channel ends up outgrowing itself I may split it further into different rooms, but for now feel free to jump right in and discuss all CityGen3D related stuff there.

    Please note that the Discord channel is meant to supplement existing support channels (and not replace them), so you can still email me or use this forum thread if preferred.
     
    Last edited: Jan 5, 2021
    chmodseven and Autarkis like this.
  49. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    Sorry for the late reply, I missed this message before Christmas.

    Yes you can use CityGen3D's procedural geometry in other scenes.
    The best way is often to export the required mesh as an FBX using the free Unity package in Package Manager.
    If you run into a particular issue please let me know.

    Tools like EasyRoads already support generation of road meshes from OSM data.
    However, the limitations of that approach is one of the reasons CityGen3D exists, because it's very difficult to cater for all the edge cases that exist in the real world and it really only works procedurally for simple junctions.

    One of the key goals with CityGen3D was that I wanted a system that you could throw anything at it and it would work and CityGen3D is capable of handling highly complex real life road networks that would normally require custom made junction meshes with a traditional approach.

    That said, EasyRoads is a great tool and compliments CityGen3D very well, especially while CityGen3D doesn't have built-in support for bridges, so I think many users tend to use a combination of both approaches.

    That's not to say CityGen3D will never have a mesh based roads option, but I hope that this provides a bit of insight in to why it was deliberately avoided initially.
    In that it's already done very well in other assets, but has limitations that I wanted to provide an alternative to.
     
  50. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    Hi, I bought this a few months or so ago, I had not had time to check it out until recent.... Now the reason I bought was to be able to use the buildings, I had made modular. You had replied I was able to do so. Now, I have been having some issues finding where to do this?? in the docs, I see some houses in roads side. Now, how can these be spawned, where the other buildings are being spawned.??? is there way to replace them? alls I see is BP but nothing explaining how to do this.. I can add road side, but its just that random how can we be able to spawn our own stuff, in the place of what is being made by City Gen procedurally.



    I see house 1, House 2 etc. but not to sure how to be able to spawn them, as I want to replace all of the buildings already there with my own.

    So for example, what I asked back when I bought this, was to be able to use my own models, I had ZERO interest in using the procedural ones being built, as I have no desire to make a flying game or anything. So, can you give a brief run down, on a way to handle this so that I can spawn my buildings, houses, in place of what City Gen already made, or a new scene with the same data. Which ever is fine but I see nothing in the docs about it. Unless i'm missing something... I only see it saying I can use road side for the building types, i'm after, and I feel that is very vague. how it would be spawned.




    Also, if you add to your list of prefabs is there a way to regenerate or update changes made?? if I do this, it seems to be greyed out and not allow this. Is there a way to make changes after the City is made?

    Thanks for any information.


    PS: I see the color codes, for residental and so forth. I assume that plays some part. I recommend to make a custom tab/Modular, so folks can just add there own, the same way we can the ones you are building procedurally. This would make this x10 easier to understand and to follow as well. Since many folks will want to use CITY GEN to add there own or ones they bought. ( Just saying)
     
    Last edited: Jan 8, 2021