Search Unity

World Building [RELEASED] CScape - advanced building generator

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

  1. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Ok .. so it seems as today there was an updated package .. thanks!!

    new project..
    update / import CScape
    import CScapeToolsetSources
    import Unity Standard Assets from store

    fixed an error:

    Code (CSharp):
    1. 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead'
    edited line in following file: SimpleActivatorMenu.cs

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3.  
    4. #pragma warning disable 618
    5. namespace UnityStandardAssets.Utility
    6. {
    7.     public class SimpleActivatorMenu : MonoBehaviour
    8.     {
    9.         // An incredibly simple menu which, when given references
    10.         // to gameobjects in the scene
    11. //        public GUIText camSwitchButton;
    12.         public UnityEngine.UI.Text camSwitchButton;
    13.         public GameObject[] objects;
    and it looks like things are working so far :)

    thanks!!

    upload_2020-4-22_2-25-2.png
    upload_2020-4-22_2-26-14.png

     
    Last edited: Apr 22, 2020
    Rowlan and JBR-games like this.
  2. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
  3. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    @olix4242

    So if I wanted to grab all the buildings (and delete the roads / extra non-building-related bits) that CScape generated and scatter them so they don't collide (i.e. across a plane-shaped mesh for example) -- what would the code look like to do that?

    I'm really interested in CScape, and I really love its building generation approach, but the extra bits are only good when you need a quick visualization for something like a screenshot. I need to place the buildings themselves (and get rid of everything else) once I've found a good volume/area I want to place them in.
     
  4. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    CScape was born as buyilding/shader thing, and then it grow as a city generation thing. You can easily add any CScape buildings manually to your existing scene by dragging prefabs with an option to rescale them to fit your needs. Also, a new CScape will feature a custolm floor plan building, that can be used to precizely meet a needs of your scene and placing (experimental varion is avaliable on request). As for automatic scattering, well this at the moment isn't an option.
     
    awesomedata likes this.
  5. JRD

    JRD

    Joined:
    Mar 24, 2014
    Posts:
    12
    Is there something we have to enable to hear footstep sounds. I am able to here my characters footsteps when he walks on a plane or on an object but not when my character walks on the cscape streets i here no footstep sounds. My character does not fall through the mesh it like it has colliders to walk on the streets. Also when i shoot bullets at the cscape building the particle effects collide with the walls but my character can walk right through the buildings. It has me alittle puzzled. Does anyone know what i might do to fix this. Thanks!
     
    Hawk0077 likes this.
  6. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    The Shooter Template by Invector has the option to add footsteps dependent on the material the character is walking on. There is also a Footstep System in the asset store that that does the same, based on terrain or material being walked on.
     
  7. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It really depends on what script are you using for this kind of collision detection. Your script probably doesn't check correct collision layers.
    https://docs.unity3d.com/Manual/LayerBasedCollision.html
    You should be sure that your script includes collision layers of Cscape buildings.
     
    JRD likes this.
  8. JRD

    JRD

    Joined:
    Mar 24, 2014
    Posts:
    12
    Thanks Olix4242 i changed the Layer from default to Terrain and i now have sound on my feet and i can not go through the cscape building walls. I even switch it back to default and that seems to work now also. Oh well its working and maybe just needed a jump start :) Thanks for pointing me in the right direction!
     
  9. arised

    arised

    Joined:
    Apr 26, 2020
    Posts:
    2
    If you had a full mesh of New York City that is textured all-in-one, would it take too much time to have Cscape buildings placed correspondingly to New York's layout, and swap the texture variations? Or would I just be doing things from scratch?
     
  10. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    Hi @olix4242! I'm familiar with Cscape having used it for a personal project around a year and a half ago. With the current state of Cscape, I am wondering how it would perform in VR on the Oculus Quest using the Universal Render Pipeline?

    If it is able to run under these conditions, I am also wondering what optimizations can be made with Cscape to ensure the least amount of draw calls as possible on the Quest?
     
  11. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It pretty depends. There are some mobile shaders that i have posted here, and they can be used to render on Quest. But quest is swtill a pretty mobile device, so it's hard to get extremely good performance. From my tests, you can get something if you are staying away from some advanced features.
     
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Well, a New York is a big city, so I don't think that you can fit all of thge city in one unity scene.
    I'm currently working a a new feature that can eventually take some floorplan data from open street maps and convert it into buildings. But:
    -it will create most of the buildings.
    -Some of the custom buildings won't be created and you will have to insert them manually
    -most of the buildings from OSM have some sort of problems, so you have to fix them manually with Cscape provided tools. It can be a long task if you have to deal with thousands of buildings.
    -You won't get a correct street layout and for this, you will have to do manual modelling or use other tools.
     
    arised likes this.
  13. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    Hi, I just got this and Im wondering if it has URP support?
     
  14. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    20
    is there a simple version of the building shader that I can use on my own mesh without the building generator?
     
  15. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    This could be really cool, but I'm more of a manual kind of guy, so I like to keep it simple.

    Instead of using OSM data all-around, I'd prefer the option to funnel the buildings into a class or list that I can override the placement of the buildings. The idea is that I can manually place all my buildings at once (at the click of a button) using my own script / algorithm (and possibly still use OSM building floorplans), which would let me edit the floorplans and road networks myself later.

    Would this be something you would consider?
     
  16. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    Have some problems how to add the" Post Prosessor Behavior (Script)" in 2019.3 It is not shown in the video becouse it seen that the drop down/pop up menyes is not recorded in the video. upload_2020-5-1_19-32-59.png
     
    Last edited: May 2, 2020
  17. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, it has. You should look into one of my previous posts (sorry, at he moment writing from a phone)
     
  18. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This can be done already. And it should be pretty simple.
     
    awesomedata likes this.
  19. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    I am experiencing an error similar to the one that occurred to Glitch12 on Feb 26, 2019.

    UnsignedReferenceException: The variable rooftopHolder of CSRooftops has not been assigned.
    You probably need to assign the rooftopHolder variable of the CSRooftops script in the inspector. CScape.CSRooftops.
    CScape.CSRooftops.OnDestroy () (at Assets/CScape/Scripts/CSRooftops.cs:342)

    What is the solution?

    Thank you.
     
  20. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    Why is there no any messages of how big city it can be build? After I have saved a city, and try to open it again, it is not there :

    upload_2020-5-3_20-34-12.png
     
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This console error shouldn't compromise anything. Is this correct?
     
  22. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This is a limit of Unity. When saving large cities, you have to use File/Save CScape Scene. This will save only references to objects, without saving actual objects. This will also reduce scene file.
     
    bthanse likes this.
  23. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    But when I load the saved scene, there is no buildings. Have I to generate buildings again ?
     
  24. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    You can try recreating buildings with a Refresh City button.
     
  25. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    That does not work. It look like they are invisible, and I have to mark them and unhide them:
     

    Attached Files:

  26. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Before doing this go to "Break Up Optimizations". And then click on Refresh Buildings (if there is neccesity).
     
  27. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    Yes, that work. They come back when I push "Break Up Optimizations".
     
  28. bthanse

    bthanse

    Joined:
    Jun 24, 2019
    Posts:
    114
    Have you any plans for a update that fixing that lightpoles does not end up in top of trees, or bus stops not places in middle of street crosses ?
     

    Attached Files:

  29. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33


    MAC UnityEditor
    Version 2019.3.12f1 Personal

    Thank You.
     
  30. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    Hello, I have been put on an old project of ours that was using CScape in Unity 2018.2.6, I am having an issue with the buildings flickering, it's only on a few buildings and it only started happening when I accidentally clicked them. The flickering looks like the windows are switching between textures; some are switching between windows and walls, others windows and blinds. Still happened when the blinds were all the way up and down.

    I tried searching through the thread for anything like this but nothing I found helped.

    Also, What a great product!
     
  31. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Try setting (in player settings) vertex compression to off.
     
  32. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    Wow, fast response. I did that earlier but I never restarted Unity. I should mention that this happening in the Editor, I haven't test build yet. I had just assumed it would happen in build if it is happening in the editor. I am 100% positive that this user error.

    EDIT:
    I restarted the editor with vertex compression set to none and it still is happening
     
  33. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm not sure.. but what updates have you done? From what version of unity to what version of Cscape? Can you post some screenshots?
     
  34. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    I am sorry, I am not sure how to check the CScape version, but from the read me there is a thank you for supporting the Alpha Version so I presume it is Alpha.

    I built a script that grabs relevant props and adds an arrow pointing down above them. The script was design to ignore all CScape buildings and only grab what we asked for based on the rules we set up. It only grabbed things that we set dressed in the scene a long time ago. During the process when trying to select one of the props I accidentally clicked the building and this occurred. (See below) I then clicked another building and it occured to it as well. I had a backup of the scene pre-arrows and clicked on one the same buildings and it did the same thing.

    If you think I should update I just need to ask if it will effect the cities that were already generated? These cities have already been approved by our client before we had the flicker problem so we need their look to remain the same.


    EDIT:
    I forgot to mention that it was Unity 2018.2.6, it was in the original post but I figured I put it in here too.


     
  35. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    33
    I think this type of building is related to the error.
     

    Attached Files:

  36. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I have that as well. It compromises performance because of flood-filling of the console log. Is there a solution to this? Happens when you download the asset from the store and open the demo version.

    Btw performance: Is there an impact when everything has colliders? I just noticed by (literal) accident that even the street lamps have colliders :D

    collider.jpg
     
    hopeful likes this.
  37. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I had the same issue. Can confirm it works with clicking "Break Up Optimizations" and then "Refresh Buildings".

    By the way, there are errors like this in the console:

    Code (CSharp):
    1. Can't destroy Transform component of 'Lamp(Clone)'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
    2. UnityEngine.Object:DestroyImmediate(Object)
    3. CScape.CSInstantiator:UpdateElements() (at Assets/CScape/Scripts/CSInstantiator.cs:116)
     
  38. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I bought CScape for car racing, but turned out helicopter flying is also fun :D

     
  39. jsrodriguez0241

    jsrodriguez0241

    Joined:
    May 10, 2020
    Posts:
    1
    Hi, this asset can export the generated mesh as a separate object without scripts?
     
  40. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    My screen shots did not work, here is a video

     
  41. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I really have no idea why this can be happening. Have you partially updated/mixed two different versions of Unity? What Unity are you running right now?
     
  42. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    That looks like you overlap the same city twice and have z-fighting.
     
  43. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    This is the same version of Unity, unmixed and no partial updates; version 2018.2.6; We cannot use any other version as the getReal3D plugin doesn't allow us to go beyond that version.

    I have been back on this project for a few months now, and I have not touched the buildings or the scene until last week. They were all looking fine until I accidentally clicked one of them. And then this started happening so I don't think that it is the same city overlapping each other. But I agree it definitely looks like this and I will try to investigate that idea.
     
    Last edited: May 11, 2020
  44. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    Update:
    I was trying to check for a copy of the building to see if that is the problem. I found no copies. I decided to show the steps I take to make a building do this and the video below happened. I click two different buildings... The first one, all of the blinds shut. The other shows the same flickering I mentioned before after it was clicked. It seems like the flickering patches are switching between two textures. In the video below the two texture samples seem to be a big window texture and small window in a wall texture. One of the original buildings was switching between the blinds and windows so I find it interesting that one of the buildings blinds shut when I clicked it. Do you think this is a shader issue?



    I originally thought this was a shader issue because we changed the CSBuilding shader very slightly to remove the advertisements, as the designer working on the scene was having trouble doing so, I think there was something that removed advertisements in CScape but it removed the signs that they were on as well but we just wanted any readable text to be gone. We saved the original CSBuilding shader in the project and when this issue first occurred, the very first thing I did was bring back the old shader. the advertisements came back but that flickering was still happening. So, I brought the changed shader back.

    I realize you made the script with Amplify Shader Editor but the changes I made are listed below. So the changes I made might not mean much to you because of the use of Amplify but I will post them anyway.

    The Changes:
    • commented out line 380, float4 texArray1569 and replaced the references to it with texArray1028.
    • commented out line 399, float4 lerpResult1576 and replaced any references to it with lerpResult412.

    I remember doing these changes but the two shaders scripts look very different now looking at them. I remember commenting things out and replacing references. However there are entire lines in my script that are missing in the original and vice versa. Do these shaders get generated? Does values on the inspector of the shader add and/or remove lines?
     
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Is it possible to have the street lines always visible? From top my scene looks like there are no street lines at all:

    1.jpg

    But coming closer I actually notice they are there:

    2.jpg
     
  46. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I would really love to see building inspector. And understand what is going on there. And also, to see what happens if you move sliders in inspector.
    I really have no clue what could be going on (if not some serious modifications on shaders or scripts). This looks like there is some issue with floating point precision at some stage. Can you just open new project with your version of unity, and import Cscape, and see if this happens also there?
     
  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It should be absolutely harmless. It will span in creation phase, but not later or in play mode.
     
  48. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Well this is normal for any real time graphics. If a line is smaller than one pixel on a screen it will dissapear. There is no way to get them back without big GPU consumption and loss of performance. You might wan't to switch your player (quality settings) to Anisotropic Textures to "Forced On". But you will loose some performance.
     
    Rowlan likes this.
  49. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    I am sorry if my image doesn't work again, I am new to posting images and videos here. But this is the inspector window of the Building Modifier of one of the buildings that flickers after being clicked. I am creating a new project in Unity 2018.2.6, like this project. Should I export CScape from the original project or should I get the original?

    Getting the original might be a problem as the product was purchased with the company account which I do not have access to at the moment. With Covid 19 going on I would have to wait til we are back at the office for me to get the original.


    Building Inspector.jpg
     
  50. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    I forgot to mention! there was a variable in the shader called _test. it was used in a step with a VNormalMask to create a variable lerpResult1740 that was used very frequently throughout the script in various lerps. One of which included shop sign density, trigger lights and advertising. Again I know that it might not mean much as the script was made through Amplify but when I removed the _test variable; instead of doing a step with it and VNormalMask I just used VNormalMask and the issue stopped occuring on the bottom part of the building but continued on the windows.