Search Unity

World Building [RELEASED] CScape - advanced building generator

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

  1. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    @olix4242

    Got "Generate Buildings" working, however I have a ton of ! messages and I thought I would ask if these are anything I should care about:

    Combine mesh instance 42 is null.
    UnityEngine.Mesh:CombineMeshes (UnityEngine.CombineInstance[])
    CScape.CSArray:MergeMeshes () (at Assets/CScape/Scripts/CSArray.cs:364)
    CScape.CSArray:UpdateElements () (at Assets/CScape/Scripts/CSArray.cs:311)
    CScape.BuildingModifier:ModifyBuilding () (at Assets/CScape/Scripts/BuildingModifier.cs:752)
    CScape.BuildingModifier:UpdateCity () (at Assets/CScape/Scripts/BuildingModifier.cs:366)
    CScape.StreetModifier:GenerateBuildings () (at Assets/CScape/Scripts/StreetModifier.cs:1077)
    CScape.CityRandomizer:GenerateSlantedBuildings () (at Assets/CScape/Scripts/CityRandomizer.cs:1094)
    CScape.CityRandomizerEditor:OnInspectorGUI () (at Assets/CScape/Editor/CityRandomizerEditor.cs:467)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Thanks
     
  2. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hi.

    How can I get a beta of the new version?
    Thank you.
     
  3. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
     
    jeroll3d likes this.
  4. mjamie

    mjamie

    Joined:
    Sep 4, 2017
    Posts:
    11
    Is there any chance that the CScape works with URP or is this still in development?
     
    DavidZobrist likes this.
  5. Malintis

    Malintis

    Joined:
    Jan 25, 2019
    Posts:
    6
    For me, this works in editor but has problems in build. Sometimes none of the buildings at all change, sometimes only a few. I think this code requires a massive amount of calculating power in a short time, which causes problems.

    What would be a good For or While alternative to this code?
     
  6. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    "Editor" code is not to be used in a compiled app. My code is only to be used at design time. Affecting the Cscape buildings at run time is not a good idea.

    So, let's start with what EXACTLY are you trying to do?
     
  7. Malintis

    Malintis

    Joined:
    Jan 25, 2019
    Posts:
    6
    Hey, thanks for your reply! I made a button with which the player can live switch between a city with low, medium, or high buildings (int size). All buildings have the "Building" tag. This is the function that pulls it off in editor runtime:

    Code (CSharp):
    1. public void ChangeBuildings(int size)
    2.     {
    3.         var buildings = GameObject.FindGameObjectsWithTag("Building").ToList();
    4.  
    5.         foreach (var building in buildings)
    6.         {
    7.             var bldgModifier = building.GetComponent<BuildingModifier>();
    8.             bldgModifier.floorNumber = bldgModifier.initialFloorNumber + size;
    9.             bldgModifier.AwakeCity();
    10.             bldgModifier.UpdateCity();
    11.         }
    12.     }
    It's a lot to process at once so it takes a short moment to load (which is ok), but gets the job done in editor runtime. As a standalone app however, it often does either nothing or some (but always the same) buildings are affected. Each time I build the app, the effects seem different but never all buildings are affected.

    I figured it's just too much to drag through a foreach and needs to rely on a counting while or for function.
     
  8. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    The code looks fine. Thought I am not sure that you need both AwakeCity and UpdateCity. Try with just one of those.

    But since I didn't make the asset I can't say specifically why it doesn't work at runtime. That said, it is my understanding that Cscape is not really designed to be updated at runtime (I ABSOLUTELY could be wrong about this!) Olix should be the one to really say one way or another.

    Sorry.
     
  9. Malintis

    Malintis

    Joined:
    Jan 25, 2019
    Posts:
    6
    Thanks, you're right. UpdateCity seemed unnecessary and it takes a little less time to calculate. Unfortunately however the problem in the built app persists.

    In the best case I could use a slider to raise or lower the number of stories like you can easily raise and lower all buildings in editor with hardly any loading times, but as you said, Cscape isn't really designed for such purposes (and I think what I'm trying to do in most cases is hardly ever necessary anyway).
     
  10. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Drats. Consider asking for help in Discord.
     
  11. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Ok gang, I am having a issue and I am sure I'm am doing something stupid (feel free to point and laugh) I cannot make the city turn to nighttime. In this image: https://imgur.com/a/7t2vNh7 You can see the CScape Inspector on the left, the ONE light in the scene (inspector details on the right) is attached as CScape's sun. Yet when I affect the sun; it's position (above or below terrain), rotation, intensity, etc the city lights do not come on. Any clue?
     
  12. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    I had the same problem once, when I've experimented with a cloud solution. I've added it for testing and also disabled for further tests, but I've forgotten to replace the references. So I've changed the sun direction, but it was not the sun referenced in the CScape script. So this is at least one possibility and this simple thing can make you think there is a ghost in the machine :)
     
  13. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I just changed the name of the "sun" in the hierarchy, cause JUST IN CASE, but yes the sun named on the CSLightsControl script did change to the same name as the sun in the scene. Thanks kindly for the thought.

    I created this project from a default HDRP project, so there is only CScape and Easy Roads 3D. I have never added any weather system.

    Again, thanks for the thoughts. Have a great evening
     
  14. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Some good news; I resolved the 'night' issue.

    This may only be an issue with the current beta/HDRP. There is a scene included with the latest beta build; Assets/Cscape/CscapeHDRP Within that scene is the "Sky and Fog Volume" I dragged that object into the project and made it a prefab. I then went back into MY scene, created a new Directional Light (just in case) turned off all other lighting and lighting effects that are included with the default HDRP project, and then dragged the "Sky and Fog Volume" object into my scene. TADA! Nighttime. (I had also set the 'sun's transform properties in my scene to effectively the same values. My city is larger, so a little change in position was necessary)

    So, atm I do not know SPECIFICALLY which setting within "Sky and Fog Volume" resolved the issue, but I wanted to post back in case others have this problem. When/If I figure it out (as opposed to just moving on and not caring what the issue was now that it works.... so bad, I know) Anyway, when/if I figure it out I'll post specifics.
     
    buc likes this.
  15. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Okay gang,

    I would like to place neon bars in various places on the buildings. ie: https://imgur.com/a/WzXCazO
    I have literally thousands of building (over 20K) and placing them manually would be awful. There are a number of different building meshes, so I can't just use a generic function to find the building's left, right and height.

    I spent the majority of the week working on a script, and it allows me to place neon bars at specific locations, but that is not working quite right. So before I dig farther in I thought I would ask if anyone has any thoughts?

    If you look at the attached image you can see that the building is an odd shape, and I would like the neon bars to be at specific locations, even if the building size changes. So any ideas are appreciated

    Have a good weekend
     
  16. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    You could access the vertices of the mesh via standard unity API.
    Then you need to create some base methods which are of your interest, like
    - give me the vertices with the highest value on the specified axis (so y would be used for the building height, for example)
    x and z in order to get the building's outer parts
    - and then you can combine different methods to filter, so the topmost points that have Y higher than a 2/3 of the building height and most outer on the x-axis
     
    JamesWjRose likes this.
  17. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Good thoughts. Thank you very much.
     
  18. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    You're welcome. I remember when I have used the vertices for my buildings I had to include some tollerance, because some vertices have not been completly at the same position, although I've used snapping tools in blender. So when I've checked which point is over my point with x = 3 (in order to detect a line) I've missed at the beginning the points with x = 3.00000001. For what reason ever.
     
    JamesWjRose likes this.
  19. unity_nD7ijHGn9aGW7Q

    unity_nD7ijHGn9aGW7Q

    Joined:
    Jun 18, 2022
    Posts:
    1
    Hey I've just purchased this pack, it looks indeed awesome.

    I was wondering if it's possible to export a city mesh with textures on it ? I couldn't find any solution for this...
     
  20. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    What you see as the "texture" is completly assembled by the shader. The used technique allows to take something simple like just a 1m x 1m cube and render it as a skyscraper. This is where the beauty and the performance comes from, but also the reason why you can't export it (the exported mesh would be just this simplified empty mesh).
     
    olix4242 likes this.
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This is true. Also, even if it was able to export everything as a mesh for usage in other software, it would be against EULA. By buying Cscape, you have a licence to use it inside unity engine, not other engines/renderes. You have right to use Cscape only in Unity Engine.
    If you still need a way to use exported meshes in Unity, there are coming some fixes in latest veraions that will enable exporting meshes in FBX format for ater reimporting in Unity.
     
  22. kukuhbasuki

    kukuhbasuki

    Joined:
    Apr 13, 2016
    Posts:
    29
    Hi, I can't join your discord channel.
     
  23. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    123
    There are multiple links, but I think the one below is the invitation link.
    https://discord.gg/mfBQQDGTAg
     
  24. jasonbtompkins

    jasonbtompkins

    Joined:
    Mar 4, 2019
    Posts:
    8
    I am looking to have multiple sections in a city in a night time scene. My first thought was to create two 10 x10 cities but I quickly discovered an issue. When I move one city, it affects the lighting of the other one. I tried having both cities using the same Re Lighting camera and Re Lighting Control Texture and increasing the boundaries of the camera and the reflection probe, but this resulted in reducing the intensity of the light on both cities. Is there something that I am missing where I can have more than one city in one scene that have there own independent lighting?
     

    Attached Files:

  25. jasonbtompkins

    jasonbtompkins

    Joined:
    Mar 4, 2019
    Posts:
    8
    Also, each block has streets rendered on only two sides resulting in two sides of the city having no streets. It would be nice if the city could have streets on all sides. Is there a solution for adding / extending the streets?
     

    Attached Files:

  26. Malintis

    Malintis

    Joined:
    Jan 25, 2019
    Posts:
    6
    I was wondering if there are any plans of implementing this in the future, but maybe it would require too much of an overhaul of the system since Street objects at the moment don't separate sidewalks from roads.

    It would make it a lot easier to bring the city to life with traffic though!
     
  27. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Not the answer you are looking for... I use the asset Easy Roads 3D as the roads for my game. It allows for curves and has data for lanes that can be used for traffic.
     
  28. OccularMalice

    OccularMalice

    Joined:
    Sep 8, 2014
    Posts:
    169
    Whatever happened to "Soon to come: Building Styles Packs, like Sci-Fi city, ’20’s New York, Italian city, Cartoon City, Apocalyptic City, Soviet City."

    I checked the release history and threads here but were any of these built?
     
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    No, but there is an ability to customize your building art.
     
  30. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    It's most impressive how very performing this asset is :)

     
  31. wjsehwls

    wjsehwls

    Joined:
    Dec 18, 2020
    Posts:
    11
    20230301_195414.png

    How do you use the cscape tool set?

    I watched the developer's YouTube video .But my screen...
    It just comes out like that.

    And how do I select an object that needs to be modified with Cscape tool set ?

    20230301_200313.png

    ↑↑↑↑↑↑↑↑↑↑ How do i select this object and how do you apply toolset?

    You're too short of explanation for a beginner like me.
    There is not even a manual. I regret buying this.
     

    Attached Files:

  32. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It is extremely simple. Open a ScapeToolset scene. (don't open a prefab like you did).
    On Cscape baker there is script called Cscape Toolset Manager. It has only 3 buttons. Two for selectiong tiles, and obe for baking them at the end.
    Also, be sure to download CDK (you can find a link in CDK folder).
     
  33. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Also, you can find a two hour video on workflows in Cscape.
     
    Lars-Steenhoff and hopeful like this.
  34. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    92
    HDRP Beta looks AMAZING. I'm looking forward to figuring out templates using other city models.
     
  35. MistaWicket

    MistaWicket

    Joined:
    Nov 20, 2013
    Posts:
    4
    Hi! Great asset - I can see this being very helpful for prototyping my game as I don't have level, art, or design skills/experience. With that said - I have two things I'd like to ask:

    1) The ground is all black with no textures to them when I press play. I used the update files (which fixed the pink buildings in my scene, but not the pink river) however, there are no ground textures or details (Like grass, crosswalk, road lines, etc.

    2) I'm using the Invector third-person lite asset to navigate, but they are constantly in a falling animation as I move around the generated map. I'm not falling through the map, but just moving as if I am in free fall while maneuvering around the generated city.

    initially, I thought it was because I selected "Create Megacity Complex" when starting, but the same happened when using the normal "Create Megacity", like in the YT tutorial.

    I'm not experienced with using Unity, so I'm not too sure where to go to fix this but would love any help pointing me in the right direction to fix these. CScape2.png CScape.png

    Thanks in advance for your time and help!
     
  36. orvedal

    orvedal

    Joined:
    Nov 10, 2015
    Posts:
    47
    On the invector character script you have to set the ground layer that the player can stand on or he will fall animation like that constantly. not a cscape problem.
     
  37. MistaWicket

    MistaWicket

    Joined:
    Nov 20, 2013
    Posts:
    4
    That's appreciated. I was able to find that, so now I just need to know how to address/fix the missing floor texture & items.
     
    orvedal likes this.
  38. heeminlee

    heeminlee

    Joined:
    Oct 6, 2021
    Posts:
    1
    I bought your solutions.
    but when I clicked download button about urp patch.
    Error message is shown "not found pages"
    Could I get a urp patch ?
     
  39. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Not the dev, however URP and HDRP are only available via beta, which you can find on the discord and requesting access to the beta by sending him your invoice

    https://discord.com/channels/835312145704943654/880148518562562048

    The good news is that I am running that beta, using HDRP on PCVR!! with a large city (8900 x 6700 meters) and getting 90 fps. So it works well.
     
    OmnifariousStudios and hopeful like this.
  40. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    48
    I'm also trying to work with Cscape and VR, but I'm getting build errors sometimes. Mostly:

    fatal error 1060 : ran out of heap space.

    I believe it's happening whenever I use the "Optimize" button and the meshes are combined.

    Any ideas?
     
  41. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I have not pressed Optimize in my build. So I can't say. I did have to limit my city because of limitations of Unity. My city size is 8900 x 6700 with approx 15,000 Cscape buildings.

    I'm also building for PC VR , not native mobile. If you are trying that... Give up. This won't do well there... Nothing will
     
    hopeful likes this.
  42. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Optimise option is mostly for Unity Editor optimization (as it can have hard time managing big amount of objects). or for aerial usage (when a whole city should be seen from above). Otherwise, use Cscape with occlusion culling.You are probably runnning out of memory. I have never seen this mesasge, so I'm not sure what it means. But it's not strictly related to CScape.
     
    hopeful likes this.
  43. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    48
    Hey, thanks for letting me know!

    Any updates planned for this asset?
    It's probably the best city generator for Unity that I've seen, and I'd love to see it updated.
    Especially because I know it probably won't work for Quest 2 at the moment and would need to be optimized for mobile.
     
    hopeful and JamesWjRose like this.
  44. abbasjafari

    abbasjafari

    Joined:
    Mar 7, 2020
    Posts:
    14
    Hi, why the shaders on iOS device with build in render pipeline is like this:

    IMG_0033.PNG
     
  45. orvedal

    orvedal

    Joined:
    Nov 10, 2015
    Posts:
    47
    i'm sorry i dont' check the forums as often as I should. Have you tried generating the lighting for that scene? it looks like the lighting hasn't been set up.
     
  46. caden3ds

    caden3ds

    Joined:
    May 17, 2017
    Posts:
    33
    Can I get the URP version I dmmed u on discord