Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building [RELEASED] CScape - advanced building generator

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

  1. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hi OliVR,
    how to get new version of your asset? When it will be available? Could you send me via PM? I will give you my invoice number.
     
    Last edited: Sep 26, 2018
    olix4242 likes this.
  2. chrisrolf

    chrisrolf

    Joined:
    Jun 13, 2017
    Posts:
    7
    Hello:

    Ive unchecked baked lighting as it crashed my app also and am unable to use your postprocessing scripts as it causes too much of a lag in my app as I 'm doing VR. My scene does come out all dark though. Any ideas to light the scene with nice shadows? It seems as if I've tried everything i.e. increased pixel count, turned off shadows, decreased quality, etc. Huge thanks in advance for your reply.
     
  3. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Can you explain a little bit more on what type of project are you doing? How many buildings do you have? What type of target platform?
     
  4. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    just send me a private message and I can send you beta as soon as I have some stable release.
     
    Max1982 likes this.
  5. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133

    Sent you a PM. Thank you
     
  6. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Hi I am testing out the Unity 2018.3 Beta version and have coma accross the folowing issues

    When I click generate city I get these two errors and no city is generated.

    Generate City Button Errors:

    InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.
    UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:322)
    CScape.CityRandomizer.Deletesolution () (at Assets/CScape/Scripts/CityRandomizer.cs:153)
    CScape.CityRandomizer.Generate () (at Assets/CScape/Scripts/CityRandomizer.cs:250)
    CScape.CityRandomizerEditor.OnInspectorGUI () (at Assets/CScape/Editor/CityRandomizerEditor.cs:428)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1599)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.
    UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:322)
    CScape.CityRandomizer.Deletesolution () (at Assets/CScape/Scripts/CityRandomizer.cs:153)
    CScape.CityRandomizer.Generate () (at Assets/CScape/Scripts/CityRandomizer.cs:250)
    CScape.CityRandomizerEditor.OnInspectorGUI () (at Assets/CScape/Editor/CityRandomizerEditor.cs:428)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1599)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    However the city isnt created... but when I click Refresh City the city appears but the road widths and block sizes dont work. Instead it creates a 10x10 city.

    Finally and the real issue for me (to save me having to completely change the road system as I did on a previous project).... the road lane width doesnt appear to be the right scale.



    As you can see in the image the car size is x=1.0 y=1.0 z=1.0... The city buildings, bus stops etc are the correct size in comparisson to the car and the player, but the road lane widths need at least 50% extra each (I am presuming that would be 4, preferably 5 meters wide each for the car to drive down the road normally as in real life scale.

    The 3 meter widths are probably ok for the odd side street but on duel lane roads this is respectfully.. really not right at all.

    Is there a way to widen the roads? To widen the lane widths?

    Thanks again.
     

    Attached Files:

    d1favero likes this.
  7. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This is a bug in Unity 2018.3 that affects prefabs saved in previous Unity versions and this bug isn't related to CScape.. you can find more about this issue here:
    https://forum.unity.com/threads/des...side-a-prefab-instance-is-not-allowed.555868/
    I suggest you to send report on this issue to Unity.

    Standard city lanes are in real life mostly 2.5m to 3.20m. CScape uses 3 meters for convenience on staying on a grid. You should count that a standard car has a width of 1.75 meters.

    No, unfortunately there isn't - and it would be extremely complicated to modify CScape to use a different scale.
    But there is probably a good workaround for this issue. If you go to street Material, and search for StreetDecals texture - set Tiling X to 0.5 and Y 0.5 you could have a double lane size. This will create larger lanes, but it will add a half lane on some of the streets. I have just tested this and it even looks better than before, as that lane looks like a bycycle lane.
     
    Hawk0077 likes this.
  8. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have added one new and pretty nice feature. shops.jpg
     
    rrahim, transat, Neviah and 6 others like this.
  9. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Any ETA, update on the facade tool ?
    Cscape is looking better every day !
     
    d1favero likes this.
  10. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have also noted that you have something like 1600 drawcalls (set Pass calls). This is way to much for CScape - are you using some other assets in your scene? CScape should stay at 100 pass - calls only.
     
    Hawk0077 and hopeful like this.
  11. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Whats stoping one from just creating a street mesh themselves like in probuilder same way the cscape buidling templates are made?
     
  12. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Yes Oliver, there are other assets but its at the beginning of the project so added them just to test things out. I am working on the terrain mainly so wanted to test out the new terrain features in Unity as previously terrains have just wrecked any chance of creating a large open world like game by being far too expensive. For a beginner like me to work around that is.
    I
    Thank you Oliver I will.
     
  13. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Thank you Oliver I will try that... But will most likely end up doing what I did previously... Previously I worked around this by completely overwriting the roads using EasyRoads3D as seen in image below... But this next city will be a lot larger and would be a big job so was looking for a shortcut within CScape...

    roadscity.PNG

    I understand that "as is" CScape roads may be theoretically correct but I am trying to NOT resize objects. Previous cities I created were resized to 0.7 to fit discrepancies within my whole project mailny beginning from the roads and car standpoint and drive-ability within a game. I dont believe this is the same as in real life despite the numbers standing up. Maybe its the car that needs resizing to fit within the road area? But as mentioned I don't want to resize things if at all avoidable. But I believe something will need resizing but not sure which way to go. I/ll figure it out after trying your suggestions, thanks much appreciated..
     
    olix4242 and d1favero like this.
  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Well, sometimes a probelm can arise from wronglybscaled objects. I'm always following real world scale beccause it gives you more consisteny. I can see that some things in gaming design persist: like scaling FPS camera to 2 meters. But it is quite wrong.
     
    Hawk0077 likes this.
  15. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Hi could possibly do a vid tutorial on how to make new city material ive been following the docs but im kind of confused... To make a material i have to make all those different maps and shapes? How can i just change the textures in cscape lile add my own brick walls and other textures?
     
  16. chrisrolf

    chrisrolf

    Joined:
    Jun 13, 2017
    Posts:
    7
    Im doing VR on Android with your buildings. It is just basically a scene looking at the buildings at this point. There is no animation, fog, reflections to slow it down. I have the standard amount of buildings once I import into my scene automatically (I have not added any using only 10 blocks on the Z and 10 blocks on the X). I haven't even built any lights or foilage. Huge thanks for your help in advance.
     
  17. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    You can find a package in CDK folder; Installa that package and you will find a folder named CScapeCDK/Editor/Resources/MegaCity/Surfaces
    In this folder you can find all textures in a standard Metallic format (Albedo, Normal, Metallic and Roughness)You can change them or add you own instead of original ones. Then use CSMaterial Tools script (in CScape City Object) to compile them.
     
    Aaron2348 likes this.
  18. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    "VR on Android" doesn't say too much as I don't know if we are speaking about Cardboard, Gear (on Note 4 or on S9) or Oculus Go - there is a huge difference between devices and you have to keep in mind a capability of specific platform and device. May I ask what is your target device?
     
    Last edited: Oct 2, 2018
  19. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Thank u
     
  20. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    I´ve upgraded to Unity 2018.2.7


    Any idea ?
     
  21. chrisrolf

    chrisrolf

    Joined:
    Jun 13, 2017
    Posts:
    7
    Thank you. I'm doing the Gear with a Samsung S7.
     
  22. ayushb

    ayushb

    Joined:
    Aug 28, 2013
    Posts:
    1
    Just updated my project with this package but I end up with the error: "Shader error in 'CScape/CSBuildingShader': unable to unroll loop, loop does not appear to terminate in a timely manner (1024 iterations) at line 149 (on d3d11)"

    Any suggestions?
     
  23. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    olix4242 likes this.
  24. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Need more help!! So in the surface folder when u add new material, like brick , does it have to have all the maps listed above? Ive followed the steps and my naming conventions are the same as the rest. I think adding new textures should be visual somewhere in inspector where u can drag and drop them and then compile those textures to the megacity
     
    d1favero likes this.
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, it has to have all textures if you want to have good quality and consistent shading.
    Ok. But what is your result? I don't understand if you have some problems and how they look?

    Hmmm.. I don't think that this would help anyone. I've avoiding using this kind of interfaces as there is no any actual need for them. CScapee uses more than 360 textures to compile them into a Texture Arrays. Having interface with 360 textures isn't a best way to organize any interface. That's why most of professional 3d apps use naming conventions, as they are a lot easier to manage and to use across applications. For example, I wouldn't want to have to drag and drop 80 or 360 textures one by one to it's corresponding slot and I hate applications that force me to do things like this.
    And most of all, Unity already has it's own browser where you can see your textures - in your case, just browse to a Surfaces folder and you can have a visual feedback. Also, som e interface like that would be an interface that looses information between unity scenes or projects leading to overall impossibility to manage seriously your textures.
     
    hopeful likes this.
  26. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    The texture does not show up at all on the building but i only tried with just albedo texture i will try all of them and get back to you, and well yeah that makes alot of sense about the textures in inspector thanks for saying all that...
     
  27. d1favero

    d1favero

    Joined:
    Oct 14, 2011
    Posts:
    15
  28. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    olix4242 likes this.
  29. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    317
  30. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    317
    For those having scaling issues Iv got a solution
    You dont need to alter your scripts or anything.

    I noticed the world was just 25% too small scale wise.
    The easy fix for this was Make a Empty Gameobject roughly in the center of you city then drag the CScape City object into it. Rename you object to something like _scaler
    Changing the scale value this will not affect the alignments in anyway. And now it matches the scale of my fine tuned player character.
     
    Aaron2348, Hawk0077 and olix4242 like this.
  31. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have finished integration of CScape with facade customizer tool. I have decided that a CScape will ship with a light version of this tool. This took some time as it required many changes in how materials work. Now I have to make a new updated CScape skin for a default city - and I think that this will be finished this WE.
    Also, I have to do some polishing, but I think that I will be able to submit this to assetstore next week.
    Also, a good news is that I've finally managed to make a support for HDSRP.
     
    Paul-Swanson, transat and blacksun666 like this.
  32. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Thanks for looking into this. But in fact I had just started a new project on PC with the 2018 version. So no emulation or Mac related errors. Guess I have to downgrade again :/
     
  33. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    JamesWjRose likes this.
  34. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    317
    Is there anyway to control the amount of space between each building, so that I can have random alleyways?
    I can move them, by hand, sure. But its sure speed up the process if there was a built in way.
     
  35. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    I know this isnt directly about CScape but Is there anything around that does the same thing for houses... ie housing estates and areas?

    I have just dumped the Industrial, Factory areas and other assets I previously used as they were completely unusable against Cscape... meaning they were just too expensive.

    Literally nothing can touch CScape but finding inexpensive building areas of various kinds is almost impossible.

    I did create factory and industrial areas with cscape that just need a bit of tweaking but is there anything else like it that would build the housing estates etc?
     
    olix4242 likes this.
  36. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    There are few modular residential assets that could be used with something like mesh baker or mesh maker to combine them into a single object with one atlas for all the buildings, using gpu instancing shouldn't be too much of a problem with performance.
    But requires more manual work.
    I've tried Buildr (both v1 and v2), v1 was nice, just drawing a plane, put on a texture, a window prefab and it made you a building, v2 is often broken and requires a lot of steps to achieve almost the same results (it gives you a lot more tweaking options), I'd avoid it.
    I think that if you want lowpoly stuff, just make them in probuilder and use texture atlases, probuilderize windows/doors, and merge them together.
     
    Hawk0077 likes this.
  37. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Thanks, I will look into it although IM not a developer so will need to dig into it a little. Thanks for the response anyways.
     
  38. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Thanks for this!!
     
  39. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Ive asked this before too along with others, @olix4242 is suppose to have a new version with new street layout features...hopefully whats being asked will be added to the new street layout.
     
  40. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It can be easily scripted. Few lines of code. Actually, just iterate all buildings in a scene, and randomly their width. I will came back with a code ASAP.
    New Cscape has this option integrated, so it should be easy to use it.
     
    Aaron2348 and Paul-Swanson like this.
  41. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Here is the code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using CScape;
    5.  
    6.  
    7. [ExecuteInEditMode]
    8. public class DistantiateBuildings : MonoBehaviour {
    9.     public bool runDistantiator = false;
    10.     public int minDistance;
    11.     public int maxDistance;
    12.     public int randomSeed;
    13.     // Use this for initialization
    14.     void Start () {
    15.      
    16.     }
    17.  
    18.     // Update is called once per frame
    19.     void Update () {
    20.         if (runDistantiator)
    21.         {
    22.             Random.seed = 0;
    23.             BuildingModifier[] bm = GetComponentsInChildren<BuildingModifier>();
    24.             for (int i = 0; i < bm.Length; i++)
    25.             {
    26.                 Random.seed = i;
    27.                 bm[i].buildingWidth = bm[i].buildingWidth - Random.Range(minDistance, maxDistance);
    28.                 bm[i].UpdateCity();
    29.             }
    30.         }
    31.         runDistantiator = false;
    32.     }
    33. }
    34.  
    I am also attaching this script here. You have to add this script to Buildings object under CSCape City. It will simlpy add random spacing between buildings on existing city.
     

    Attached Files:

    Last edited: Oct 17, 2018
    Aaron2348 likes this.
  42. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm adding some features to CScape that will be really useful in your case. As a skinning now should be really simple to do, it will simplify making also this kind of buildings. Also, a new feature for CScape is automatic roof shingles mapping that simplifies really a workflow. I also might come back with some model templates for this kind of buildings.
    Right now, a main problem with small building areas is a foliage - unfortunately, Speed trees are so heavy to render and can impact performance.. but trees and bushes are really important for this kind of areas.
     
    Hawk0077, shredingskin and Aaron2348 like this.
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm currently working on a system for adding nice entrances to CScape.
     
    shredingskin and Aaron2348 like this.
  44. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Vegetatiom studio Integration might be a good idea for Foilage performance.
     
  45. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    317
    Worked Perfectly, thank a huge amount!
     
    hopeful and olix4242 like this.
  46. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Here I've tried to use new CScape to make those small buildings.
    PC, Mac & Linux Standalone_ _DX11.jpg
     
  47. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    317
    Very Nice! You made that with the new features you were talking about with the facades and entry ways?
     
  48. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, there aren't new features of entry ways. This is made only by using new texturing system and new shaders ;)
     
    Hawk0077 and Neviah like this.
  49. Bionicfellow

    Bionicfellow

    Joined:
    May 24, 2018
    Posts:
    6
    My Android game scenes are much too dark, and I am getting a warning about a missing script in Windows.

    Which version of Unity should I use? I have just upgraded to Unity 2018.2.13f1 (64-bit), but can load an earlier version.
    I am using the CScape City System.unitypackage that was downloaded on 17 Sep 2018 and has a size of 361,179 KB.
    Which patch should I be applying? I have Unity2018_Support.unitypackage, ShaderPatch2018.0.2f.unitypackage and Patch Shader MegaCity.unitypackage. Usually I employ ShaderPatch2018.0.2f.unitypackage.

    Which CScape City script is missing? I have an unnamed script in the CScape City stack that reads: Script: None (Mono Script) The associated script can not be loaded. Please fix any compile errors and assign a valid script. The other scripts in this asset that are incuded are: City Randomizer, C Scape LOD Manager, CS Lights Control, CS Material Tools (unchecked), Texture Array Tools (unchecked), Prefab Runtime Support, and Detailed Material Tools.
    When I place the camera anywhere and hit play, I get a console warning: The referenced script on this Behavior (Game Object 'CScape City') is missing!

    When I switch to the Android builder, I get additional errors to the one above . These are highlighting variables that are assigned but never used, and include sectionDivision, initAdv from CityRandomizer.cs, baseOffset2 and baseOffsetSymetry from CSInstantiator, and vColorsFloat from CSMaterialsAssign.cs, along with five others.
    When I build in Android for the Oculus Go, the game scene is much darker than the Unity Scene or Game tabs, regardless of any lighting settings. This leads me to believe that there is a shader not working in Android (and possibly Windows).

    Any insight into this problem would be appreciated, as I have been fiddling with this for weeks now, and still can't get it to work properly. Thanks
     
  50. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    A missing script is a debug script that I've used in development. It can't influence anything more than having annoying message of a missing script.
    Also this isn't an error and doesn't influence any functionality or performance.

    Shaders usually work or doesn't work. I don't know any user that had similar issue - nor this happened in my tests. Without screenshots is pretty hard to understand what is going on.
    Are you working in Linear lighting mode (this is the default for CScape) and is it set in build options for android and Editor? HAve you tested if non CScape objects are lit properly in a same scene? Are you using any image effects?