Search Unity

World Building [RELEASED] CScape - advanced building generator

Discussion in 'Tools In Progress' started by olix4242, Mar 11, 2017.

  1. CurryKitten

    CurryKitten

    Joined:
    Dec 22, 2016
    Posts:
    36
    Hello there all.

    I'm a new Cscape user and have been using it to put a city into my quad copter flight sim. I haven't finished tweaking the city, but decided to see how it would run on an iPhone. My regular builds are Mac/Windows/Linux but I wanted to add iOS/Android soon.

    I had a bit of a weird experience on my iPhone XR it looks like this



    I should point out that this is a normal illuminated scene. In the desktop versions, everything is fine and we see the building materials, but this disappears in iOS. As interesting as the shiny black surfaces are, I think I'd prefer actual buildings :)

    It looked so odd that I figured someone would recognise it easily if it had come up before. I'm using Unity 2018.4.25, iOS 13.4 and Xcode 11.3
     
  2. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    I just tried it in Unity 2020.2.6f1 with HDRP 10.3.1. The streets aren't visible:

    cs.jpg

    The river is pink and there's a shader error with the rooftops:

    Code (CSharp):
    1. Shader error in 'CScape/CSRooftops': Couldn't open include file 'Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl'. at line 1003
    2.  
    Regarding HDRP: are there more than 1 cameras in use? There is that Relighting Camera. HDRP doesn't support more than 1. If there are more than 1 you can forget about performance.

    And the RigidBodyFPSController has a missing script.
     
    Agatho_Kakological likes this.
  3. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    at least your city is visible dude i have something green in it and the whole city blur
     

    Attached Files:

  4. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Cscape is supported only on Hdrp 10. Not on older versions.
     
    hopeful likes this.
  5. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    hii, i just imported cscape in an empty project and found this, post processing setups are asking for a script
     

    Attached Files:

  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Post processing has been an issue in Unity since Unity 5. I'm not trying to invalidate your comment. Just know it has happened a whole heck of a lot with Unity assets over the years - and in my experience, it's practically the rule - that it is broken upon import. So, if you encounter it, IMO it's generally better to expect it, deal with it, and not get hung up on it.
     
    Last edited: May 8, 2021
    olix4242 likes this.
  7. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Right :)
    Post processing has changed over years, and lost any back compatibility. As I really can't make a different scenes for each version, it was defaulted to a original one (as there are still many users that use it).
    It doesn't break anything in a project, and if you have this problem, just delete that component.
     
  8. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    nahh it ain't giving any problems but i thought the post pro which comes with the asset might get me better effects than those which i create myself
     
  9. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    imported cscape in unity 2020 empty project and found black puddles , how to solve it?
     

    Attached Files:

  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Not sure this is it, but just in general things that reflect may need a reflection probe.
     
  11. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    cscape adds a reflection probe automatically
     
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Be sure to configure sky environment correctly (and to enable it in hdrp). Black puddles happen when there is no sky to reflect.
     
    Agatho_Kakological likes this.
  13. analogupstudios

    analogupstudios

    Joined:
    Jul 3, 2019
    Posts:
    14
    Greetings, I just recently purchased your CScape asset from unity store and am not getting the results you do in the videos in HDRP. I have installed the extra package and everything is green [see reference photo]. Any idea as to what could be causing this?
     

    Attached Files:

  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    What version of HDRP? Cscape requires version 10.
     
  15. analogupstudios

    analogupstudios

    Joined:
    Jul 3, 2019
    Posts:
    14
    HDRP 10.4.0/Unity 2020.3.7f1
     

    Attached Files:

  16. gamesbydre

    gamesbydre

    Joined:
    Nov 25, 2014
    Posts:
    58
    Can you please move the URP and HDRP downloads to the original post?
     
    olix4242 likes this.
  17. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    You can get those from a link in description in CScape documentation
     
  18. MatheusPereiraBarros

    MatheusPereiraBarros

    Joined:
    Feb 21, 2015
    Posts:
    10
    Hello, guys!

    Firstly, I want to say: CScape is amazing, powerful and lightweight.

    I'm want generate a city with a suburbian, a residential city style, like this image bellow:



    You have any tutorial, or guide explain how to generate a residential city-like with CScapes?

    Since now, thanks a lot!
     
  19. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    For creating your own buildings and style you need to work through the following 2 tutorials:
    - creating your own CScape material (building facades / windows)
    https://olivr.info/customizing-cscape-materials-with-cdk/

    - creating your own building shapes, which then can be adjusted by height, width, etc..


    At least for the material creation, it is recommended to use the exact unity version specified in the asset-store (5.6.2, you can find this version in the unity download archive). After the creation you can export this material and use it with other unity versions.
     
  20. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi,

    First of all I also want to say this asset is AWESOME! :D
    But I have a small problem. Once I try to copy / paste a building it seems to messes up the rooftop stuff of this object. once I hit play I get errors like:

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    CScape.CSRooftops.OnDestroy () (at Assets/CScape/Scripts/CSRooftops.cs:342)

    Is there some way to fix this for a copy pasted object?

    Thanks ;)
     
  21. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Ok, the error appeard because I had the CScape City gameobject disabled. Anyway Somehow the rooftop object won´t work correctly on a copy pasted building.
     
  22. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    This would need some more information, of how it is not working correctly, not shown at all, flickering, etc., so a video or an image would help others to identify your problem.

    I tried it that way and it worked:
    - select a building and press Ctrl + D
    => the building was dublicated, but the original rooftop stuff was now on the dublicated building
    - selecting the original building again => the rooftop stuff was created again and everything worked as expected in edit and play mode
     
    Last edited: Jul 2, 2021
    JamesWjRose likes this.
  23. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    While I am not the dev, and this might not be the answer, the rooftop items are in a separate group. So likely there isn't a rooftop object for your "new" building
     
    buc likes this.
  24. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Thanks for now. I will make a video on Sunday. Btw is it possible to somehow create a building without generating a city and saving that object as a prefab for example?

    Thanks
     
  25. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    It is possible if you mean not to have that big city GameObject with that amount of buildings, but it is not possible if you mean the CScape city system, because CScape needs this to work. But a CScape city could consist only of 1 building. To achieve this you would need to invoke some methods via script in order to have the building drawn as a building, otherwise if you drag a building into the scene you have just the raw shape, which could be just something like a cube and visually not even close to a building (this is the cool stuff and why CScape is that fast :)).

    And of course there is a way to just remove all the other buildings. So if you want to customize the system further, you would need to dive a little into the code, just looking for how the inspector GUI elements (buttons) are doing the stuff should be enough.
     
    marcell123455 likes this.
  26. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    can you please elaborate like what sky environment do i have to enable and from where, as of now my scene has the normal sky every unity scene contains, the standard blue one
     

    Attached Files:

  27. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yea, you can. Best way is to generate a whole city, and then delete buildings that you don’t need.
     
  28. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    do you plan on making a discord server for Cscape???
     
  29. Agatho_Kakological

    Agatho_Kakological

    Joined:
    Dec 27, 2019
    Posts:
    16
    any help for this?????????????????????????????????????????????????????????????????????????????
     
  30. ZhongshiLiuAndyLaw

    ZhongshiLiuAndyLaw

    Joined:
    May 11, 2019
    Posts:
    1
    Hello guys,
    In which version of unity hdrp can I use Cscape?
    im using 2020.3.12, and it dooesnt function.
    thank you very much
     
  31. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi @olix4242

    I want to submit my useful changes I made to CScape here.

    First of all I fixed a bug in CityRandomizer.cs StripScripts(). On some objects I got a error that it could not remove the BuildingModifier script because CSFloorDetails relies on it. So I added this before removing the BuildingModifier script:
    Code (CSharp):
    1.             foreach (Transform go in buildings.transform.Cast<Transform>().Reverse())
    2.             {
    3.                 CSFloorDetails csInstantiator = go.GetComponent(typeof(CSFloorDetails)) as CSFloorDetails;
    4.                 DestroyImmediate(csInstantiator);
    5.             }

    Then I added two useful methods. One button to spawn a single random building, and one button to save all buildings and rooftop meshes as asset files (This is needed if you want to save the buildings as part of a prefab and want to export them into a other unity project for example). So I added in CityRandomizerEditor.cs after the else in line 499:
    Code (CSharp):
    1.  
    2. if (GUILayout.Button("Create Building"))
    3.                 {
    4.                     ce.SpawnBuilding();
    5.                 }
    6.  
    7.                 if (GUILayout.Button("Store Mesh Assets in CScape_Meshes Folder"))
    8.                 {
    9.                     foreach (Transform B in ce.buildings.transform)
    10.                     {
    11.                         if (!System.IO.File.Exists(Application.dataPath + "/CScape_Meshes/" + B.name + ".asset"))
    12.                         {
    13.                             AssetDatabase.CreateAsset(B.GetComponent<MeshFilter>().mesh, "Assets/CScape_Meshes/" + B.name + ".asset");
    14.                         }
    15.                        
    16.                         AssetDatabase.SaveAssets();
    17.                         B.GetComponent<MeshCollider>().sharedMesh = B.GetComponent<MeshFilter>().mesh;
    18.                     }
    19.  
    20.                     foreach (Transform RT in ce.rooftopDetails.transform)
    21.                     {
    22.                         if (!System.IO.File.Exists(Application.dataPath + "/CScape_Meshes/" + RT.name + ".asset"))
    23.                         {
    24.                             AssetDatabase.CreateAsset(RT.GetComponent<MeshFilter>().mesh, "Assets/CScape_Meshes/" + RT.name + ".asset");
    25.                         }
    26.                        
    27.                         AssetDatabase.SaveAssets();
    28.                         RT.GetComponent<MeshCollider>().sharedMesh = RT.GetComponent<MeshFilter>().mesh;
    29.  
    30.                     }
    31.  
    32.                     foreach (Transform AD in ce.adverts.transform)
    33.                     {
    34.                         if (!System.IO.File.Exists(Application.dataPath + "/CScape_Meshes/" + AD.name + ".asset"))
    35.                         {
    36.                             AssetDatabase.CreateAsset(AD.GetComponent<MeshFilter>().mesh, "Assets/CScape_Meshes/" + AD.name + ".asset");
    37.                         }
    38.  
    39.                         AssetDatabase.SaveAssets();
    40.  
    41.                     }
    42.  
    43.                     foreach (Transform BD in ce.balcony.transform)
    44.                     {
    45.                         if (!System.IO.File.Exists(Application.dataPath + "/CScape_Meshes/" + BD.name + ".asset"))
    46.                         {
    47.                             AssetDatabase.CreateAsset(BD.GetComponent<MeshFilter>().mesh, "Assets/CScape_Meshes/" + BD.name + ".asset");
    48.                         }
    49.  
    50.                         AssetDatabase.SaveAssets();
    51.  
    52.                     }
    53.                 }
    54.  
    and in CityRandomizer.cs I added this method:
    Code (CSharp):
    1. public void SpawnBuilding()
    2.         {
    3.             GameObject prefabToInstantiate = null;
    4.             int prefabChoice = Random.Range(0, buildingStyles[Random.Range(0, buildingStyles.Length)].prefabs.Length);
    5.  
    6.             prefabToInstantiate = buildingStyles[Random.Range(0, buildingStyles.Length)].prefabs[prefabChoice];
    7.             BuildingModifier buildingModifierx = prefabToInstantiate.GetComponent(typeof(BuildingModifier)) as BuildingModifier;
    8.             GameObject cloneH = Instantiate(prefabToInstantiate, Vector3.zero, Quaternion.identity);
    9.  
    10.  
    11.  
    12.  
    13.                     cloneH.transform.parent = buildings.transform;
    14.                     cloneH.transform.name = "Building" + buildings.transform.childCount.ToString();
    15.                     cloneH.layer = 19;
    16.  
    17.                     BuildingModifier buildingModifier = cloneH.GetComponent(typeof(BuildingModifier)) as BuildingModifier;
    18.                     CSRooftops csRooftopsModifier = cloneH.GetComponent(typeof(CSRooftops)) as CSRooftops;
    19.                     CSAdvertising csAdverts = cloneH.GetComponent(typeof(CSAdvertising)) as CSAdvertising;
    20.                     buildingModifier.buildingWidth = 10;
    21.                     buildingModifier.buildingDepth = 10;
    22.                     buildingModifier.floorNumber = 15;
    23.                     //buildingModifier.cityRandomizerParent = ;
    24.  
    25.  
    26.                     cloneH.transform.Rotate(0, 180, 0);
    27.  
    28.  
    29.                     if (csRooftopsModifier != null)
    30.                     {
    31.                         csRooftopsModifier.randomSeed = Random.Range(0, 1000000);
    32.                         csRooftopsModifier.lodDistance = 0.18f;
    33.                         csRooftopsModifier.instancesX = 150;
    34.                     }
    35.                     if (csAdverts != null)
    36.                     {
    37.                         csAdverts.randomSeed = Random.Range(0, 1000000);
    38.                     }
    39.  
    40.  
    41.                     buildingModifier.AwakeCity();
    42.                     buildingModifier.UpdateCity();
    43.          
    44.  
    45.      
    46.         }

    One thing I want to note is that I manually created a folder called "CScape_Meshes" in the projects Assets folder. Otherwhise saving of the building meshes does not work. Maybe a if could be implemented that creates that folder if it does not exist but it was good enough for me. I hope this is useful to anyone ;)
     
    Last edited: Jul 29, 2021
  32. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm currently working on a full support for HDRP with some new and powerful CScape features. It should be available soon.
     
    buc and hopeful like this.
  33. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    I'm really curious now, which features? And will they be available on built-in?
     
  34. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm currently working on some more artistic related features:
    -custom buildings based on floor plans. Those buildings are there to add an easy way to build any custom shaped building, very useful if you want to match some real life buildings.
    -more robust and better custom faccade creation (custom skins).
    -full HDRP support with better visual quality and realism made possible by using improvements that HDRP brings.
    -optimizations of shaders for standard and URP pipeline.
    - some interface improvements for better custom building placement. For example, a possibility to place building on a terrain automatically, and then extend it's foundations to fit a curvature of a terrain.
    Overall, this will be probably a last update for standard pipeline shaders, as I will be moving more into HDRP and possibilities that it gives.
    For now, new cscape versions will be available in beta as a separate download (with a download link in original package).
    Unfortunately, maintaining all pipelines will be impossible so I will have to move my attention on HDRP and URP that are now almost in production ready state..
     
  35. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    Thank you for taking time. There are really nice features :)

    Yes HDRP looks really good. But I think my game will be in built-in. Put a lot of work to look pretty close to HDRP. But performance and dependency to other assets (clouds and water, etc.) have formed this decision.
     
  36. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    "-custom buildings based on floor plans"

    This sounds very promising to me. But how can I imagine the workflow? I mean, do I have to use a custom model I made in blender for example? Or would it be possible to use a mesh I created with Probuilder as floorplane for example?
     
  37. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, it is more like an integrated modeler. You just place building prefab into a scene, and move, add, or subtract floor plan points. It is pretty easy to use without messing with any external applications.
    Also, you can define boud points by scripting, and this is pretty useful when making custom city importers, for example, from Open Street Map.
     
  38. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    Is it possible to enable smooth shading for faces, so especially round parts of concrete are shown more smoothly?
     
  39. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It should be pretty hard, if not impossible due to the data that Cscape has to inject into meshes (and all the UV mapping that it does). It does many things on level of vertex colors, normals, multiple UV maps, and this would lead to big workflow performance drops. But as I'm rewriting some systems, I might look into it - but still don't have any idea how I could procedurally map those things.
     
  40. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    I accidentally have found a solution to that. So, enabling smooth-shading alone doesn't result in smooth shaded faces. And as often, some complicated approaches didn't help and just wasted time to find the right one, but a pretty simple approach did the job: in the modeling software I just added an edge split modifier and voila: smooth shaded faces :)
     
    olix4242 and chelnok like this.
  41. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Any ROUGH idea on when the next version is going to be released?
     
  42. YongHe

    YongHe

    Joined:
    Sep 11, 2015
    Posts:
    3
    Why not create a Discord
     
  43. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    hi folks,

    I thought I share what I did with cscape, because I totally love to do stuff with it:
    btw, you can download the pc build as well to see it running on your machine.

    Waiting for an update too!

    Please Capitano! :D

     
  44. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    I think because it's a one man show, who has to dig into hardcore processes to achieve stuff like cscape, or the deckard renderer, support it, do new stuff, bug fixing etc. If I were such a dev, I would fear to host a discord server, without losing my focus on such things and having a life next to it xD only my thoughts
     
  45. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Great usage of CScape :)
     
    Rensoburro_Taki likes this.
  46. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Actually, I have made a discord server, but still not sure if I want to activate it. I already have my youtube, facebook, twitter, Unity forum, and support mail to control, all by myself. And this can take a pretty big amount of time. Amount of time taken from actual development. Also, I'm pretty new to discord, so there might be some usefull reasons that I'm missing.. so if you think that this is a case, please enlighten me ;)
     
  47. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    In fact a real good reason that might be helpful for you could be that you can channel everything in discord, from what I've noticed when joining unity devs. For example, having a support and update section for each of your plugins, in where you can post updates and lead your customers to the certain section, up to what issue/need they have etc. It has some nice structuring features. I think that's why it is more and more used by developers.
     
    RabidBat likes this.
  48. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Then lets try :) Here is a link.
    https://discord.gg/mfBQQDGTAg
     
    Last edited: Sep 10, 2021
  49. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
  50. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    https://discord.gg/mfBQQDGTAg
     
    Last edited: Sep 10, 2021
    Rowlan and blacksun666 like this.