Search Unity

World Building [RELEASED] CScape - advanced building generator

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

  1. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    And is Cscape moving towards the unity job system and burst compiler anytime soon?
     
  2. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Thank you for the info and I am looking forward to the release version so I can impliment these features. Good luck
     
  3. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    You documentation is basically none existent, can you please let me know how you can do this.
     
    d1favero likes this.
  4. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    82
    Hi @olix4242 ! I'm using CScape for a VR project and I thought I'd share my experiences and issues so you can improve it. Before I go into detail I want you to know that I followed all of the correct setup steps you outlined in this video.

    1. The building shader included with CScape is broken. I am getting lime green buildings and the same error others in this thread posted about (line 149: unable to unroll loop, loop does not appear to terminate in a timely manner). I am running Windows 10 with the most recent version of unity. Your patch in this post did not fix the issue, however your OSX Mac patch in this post did fix the issue. But I am on Windows, not Mac. I highly suggest you take the time to fix the shader to work with the latest version of Unity. CScape is great but if it's broken on first use, that's an awful user experience and some users will just not use CScape.

    2. Post processing - Screen Space Reflection in the CScapeCalibrated post processing looks really really bad in VR. It flickers and the reflections show up different in each eye. I had to turn it off. It's a shame because it would make reflections look so much nicer if it worked properly.

    3. This one is minor, but a bus station was generated inside the road at the end of a bridge. It spawned on the inclined part of the road and is partially buried in the road. You may want to update your generation algorithm to not place bus stops on bridges or on the inclined part of a bridge.

    Besides those problems, I've had a great time using CScape! I hope this was helpful and thank you for all of the hard work you've put into this! Looking forward to an updated version with these fixes and the buildings with more details!
     
  5. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    I cant even remotely get this to work. What unity settings do you have? I had to start with a 2x2 size and my buildings came out green and yellow. It would be nice to have this working out of the box rather than having to bash my head against the wall in order to get this to work.
     
  6. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    82
    The buildings shader is broken out of the box. :( Download the patch in this post and it should fix your green and yellow buildings issue (at least it did for me). It's a patch that was originally intended for Mac OSX but it fixed my issues on Windows.

    @olix4242 this further confirms the shader issue needing to be fixed. Seems like this wouldn't be too difficult to fix? CScape is amazing - I'd just hate for less people to use it because of this issue.
     
    hopeful and nobluff67 like this.
  7. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Thanks so much. Yes it works now, and yes I am on windows so that Mac patch works.
     
    hopeful likes this.
  8. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    The Good
    • Absolutely outstanding once you get it to work.

    The Bad

    • Full of bugs, doesn't work out of the box.
    • Documentation is basically non-existent.
    • No idea if run-time generation works (run-time generation was mentioned by developer as a feature in thread).
    • Been in beta for well over a year.
    Advice to Developer
    • Stop adding features until you have the current product working and documented, or else you are going to be one of those game developers that keeps on making changes before they release.
    I can't currently rate this product. It would be unfair for me to rate it a 2 out of 5 in its current state, even though justifiably I could. This product should be a 5 star product with over 500 reviews, and could definitely achieve that if you finish fixing what you have at this current time.

    This is currently the best city generating product out there.
     
    d1favero, ArkadiuszR and Foreman_Dev like this.
  9. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    22


    True :mad:
     
    Foreman_Dev likes this.
  10. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Facts!!
     
    Foreman_Dev likes this.
  11. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Hello,

    I was curious if there was a way to add "additions" to the buildings CScape creates during the generation process?

    I am trying to add specific objects to the corners of my buildings and I don't want to manually add these objects to every single corner on every single building after my city has generated.

    I've tried creating my own prefab building template using an existing building template and slotting it in the CScape generator>building templates section but my additions get completely ignored?

    Thanks!
     
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Unfortunately, this is something where I'm feeling completely frustrated. Unity is doing some underlying changes to it's shader compiling system - and mostly every new release of Unity 2018 breaks something for a main building shader. add to this that some platforms behave differently, and you end up on having to test shaders for every new version of Unity on at least two build platforms - then re'testing it on all other old versions of Unity. Unity 2018 simply isn't yet production ready and Assetstore is full of broken assets for 2018.
    You should check Post Processing documentation for issues with post processing. You are probably using single pass - while you have to use two pass rendering for PostProcessing.
     
  13. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    You can make a script that will iterate all buildings and add those objects to them. It should be pretty straight forward if you are able to do some simple scripting, just iterate all hierarchy ob Buildings object, and place new objects on building coordinates.
     
  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Not for now. I can't see any advantage in using Job system at this moment and I don't see that it would give any performance improvement. Job System is good for objects that are moving on runtime and you need to save some FPS - but it doesn't have any advantages in editor generation and on scripts that work with hierarchical logics.
     
  15. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    Are you sure? One of the main advantages of Vegetation Studio pro compared to the regular version is using the Job System to allow for faster placement of vegetation if you change the vegetation rules, and that is in the editor. Spawning a city often takes quite a while, and if the process could be jobified for faster feedback that would be quite useful.
     
    Last edited: Aug 15, 2018
  16. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Ah, you were speaking about Substance painter and not substance materials made with Substance Designer (substances).
    Sorry, but I don't get what would you like to do and what it could do for Cscape.

    At this moment no. I'm looking into it, but at this stage it isn't on top of priorities.
     
  17. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    What is at the top of tje priorities then if not making the tool more useable for artist.
     
  18. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Ok??? Sp can export materials..can i use those textures in the material Cscape?
     
  19. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    How to do this.
     
  20. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    Is this the answer you were looking for, perhaps?
     
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    MNot sure if you have checket this doc:
    https://olivr.info/customizing-cscape-materials-with-cdk/
    As for simple textures (surface textures like bricks and so on) you can export them from substance into CScape.
    Steps for this workflow:
    -Unpack CScape_CDK_Texture_Sources.unitypackage
    -Go to Assets\CScapeCDK\Editor\Resources\MegaCity\Surfaces and replace existing files with textures made in substance (by using Metal PBR). You will need Metalness map, Albedo Map, Roughness map and Normal Map. Those maps are already compatible with Substance (and were made in substance designer) and even follow naming rules of a Substance. .
    -then recompile textures with your own textures.
     
    Aaron2348 likes this.
  22. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    it really depends on how do you want to do this and what are your particular needs. Can you explain a little bit more.
     
  23. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    Hi Olix

    Probably a beginner issue I just bought your asset.
    It looks like a shader setting : Unknown platform 3 in GetTargetPlatformGraphicsAPIAvailability
    this I have on PC and Mac

    Screen Shot 2018-08-16 at 14.35.21.png

    Norby
     
  24. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Click a button to start a game, then generate the city.
     
  25. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
  26. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    Thanks Nobluff67

    Worked for me on a Mac

    Norby
     
    nobluff67 likes this.
  27. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    Asset seems promissing.
    Yet I dint find/read anything on instantiating.
    Is it going to be implemented or allready is ?
    Adding on a big map full of elements players / enemies / effects doesnt load the game to a level where it will crash on mobiles ?
     
  28. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
  29. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    Thanks Olix

    Works perfect

    Norby
     
    hopeful likes this.
  30. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    CScape doesn't use instancing as every building is different from another and use unique meshes. It heavily relies on mesh batching (by using static mesh batching) - this helps to reduce drawcalls as a whole city uses one singl material.
    It might seem un-intuitive but this actually works better in terms of performance than instancing.
     
  31. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    @olix4242
    It would be much more easier for me to construct with your asset than complex instantianting and not fully controll.
    I do not have yet experience in meshes and textures and LOD and how they can be optimized. I only have a basic understanding of them and how they should be, but still I am unfamiliar with some terminology you used (wich I will look in few moments).
    Bottom line is this:
    Can I make my map with your asset and add some players/enemies with basic animations (we suppose they are optimised as well and not clunky) and not fear that my game will crash due to the map elements ?
    For mobiles I must do a separate version or how is all managed processor performance wise ?

    Thank you!
     
  32. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    I read some more and the most precise explanation is this "Static batching generally dramatically improves render time but may increase memory footprint.".
    What I do not understand very well is this:
    - because of using 1 material for whole city, the memory footprint is not very big becasue of only one material collection to be rendered
    - the textures do not affect render time / memory footprint ?

    I also found this: "Unity will exclude the vertices that belong to a renderer that is not visible when rendering the mesh, to avoid rendering things outside your frustum. This process has some overhead of course since Unity has to rebuild indices every time a renderers leaves or enters the frustum. If you are using profilers you may see that it's using some time for batching. This is typically what happens for static batching."
    >> building with CScape and walking around an area, Unity will build indices for the area around me (seen by camera for example ?) If it is only 1 material, is it fully loaded on begining of the game ? Doesnt this affect a lot the memory ? Or I should be very interested becasue 1 material does not have a lot of MB ?
    Can you try detail this a bit ? Maybe a clearer example ?

    thanks
     
  33. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    @olix4242 please respond to the above. This is with regards to running the city generation at runtime on a compiled build.
     
  34. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Hi, you should look into a Editor script and see what commands are sent by each button.
    Code (CSharp):
    1.     if (GUILayout.Button("Generate City"))
    2.             {
    3.               ce.Generate();
    4.                 ce.GenerateStreets();
    5.                 ce.UpdateCity();
    6.             }
    This means that you have to call those functions on CityRandomizer component.

    Code (CSharp):
    1. ce.Generate();
    2. ce.GenerateStreets();
    3. ce.UpdateCity();
    But, be aware, CScape isn't made for this kind of task, and wasn't tested for generating whole city - and you probably won't get a good performance out of it.
     
    nobluff67 likes this.
  35. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, it get's fully loaded on start. Depending on a resolution of maps (that can be choosen from Cscape you might get different build sizes. Best quality maps in a city material that comes with with Cscape has a size of 280 mb. If you reduce texture resolution by half, you get 70mb size. This size impacts build size, but stays still in memory, and actually isn't that big. New Cscape introduces also compressed textures, so this reduces build size even more.
    It might be a problem for older mobile devices - but all modern devices get a gain from this. If you are using Cscape, you should target modern mobile devices (on a level of Samsung s7, iphone 8). It wasn't tested on older devices.
    What also affects memory is a mesh size as with large city you might have many polygons. But this happens more or less with any mesh. Cscape uses pretty low mesh configurations, and is really optimized. so if you wan't this kind of complexity, there is no any other way to get it than using CScape.
     
    Last edited: Aug 18, 2018
  36. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Thanks.

    I was thinking this is the best way to reduce build size significantly. Do you have another suggestion?

    The above post also has a good suggestion on how to reduce build size. Any other suggestions would be appreciated, especially for developers that want to use your product for mobile games.
     
  37. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Than this isn't for you. If you want to reduce size, save your scene by using File/Save Cscape Scene. This will save only information about your buildings in a scene without saving CScape meshes. all buildings will be regenerated on load.
    But this isn't really best thing for a mobile, as it will lead to long loading times.
    Best way is to reduce texture sizes, and to just use Strip Cscape Scripts before building your app. Strip Cscape scripts reduces mesh sizes by 1/3 (and probably more). Resizing textures by half reduce final build even more.
     
    hopeful likes this.
  38. FABIO3

    FABIO3

    Joined:
    Aug 20, 2018
    Posts:
    1
    This is incredible, I tried to create something smaller by configuring the properties in the script in the editor, but I did not succeed. Could I say if it was possible, I wanted to create a smaller city or maybe 2 or 3 block of it? without touching the script? thank you.
     
  39. MYancey

    MYancey

    Joined:
    Aug 8, 2018
    Posts:
    1
    Hi @olix4242

    My team recently upgraded to 2018.2 and we ran into this problem with the plugin

    Any thoughts?
    2018-08-20 (1).jpg 2018-08-20 (2).jpg
     

    Attached Files:

  40. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    82
    I understand where you're coming from. But inevitably most people will use the latest version of Unity for any new project whether it's considered production ready or not. If it's frustrating to keep up, I think that you should hire some help keeping the shader up to date with Unity. The profit you'd make from having a fully functional product would far outweigh the cost of having someone help you. CScape is amazing if you do some work to get it working, but it has so much more potential for success if the bugs are fixed!
     
    Aaron2348 likes this.
  41. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    olix4242 likes this.
  42. Curb

    Curb

    Joined:
    Mar 27, 2014
    Posts:
    3
    Running into an issue where the ambient occlusion of the unity postprocessing stack (V2) doesn't work on the generated meshes. It works on a mesh with the standard shader. Am using unity 2017.4. Anyone know why this could be happening?

    Edit: Apologies. It was an ordering issue that has had nothing to do with the asset. The asset works great on our end by the way!
     
    Last edited: Aug 29, 2018
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Never had this issue. I can confirm that AO works correctly on my side (in Unity 2017.4 and PPS v2)
     
  44. MdotE

    MdotE

    Joined:
    Aug 9, 2018
    Posts:
    10
    I use Unity 2018.2.5f1. I have imported the shader fixes referenced on this discussion board to get rid of the green buildings but once I do I have black spots that look a bit like water puddles all over cities that I generate. Any suggestions?
     
  45. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Can you please provide a screenshot?
     
  46. MdotE

    MdotE

    Joined:
    Aug 9, 2018
    Posts:
    10
    Uploaded. There is a similar post in the product review on the asset store. Looks almost like puddles. All I have done is import Cscape and then the windows and mac shaders as recommended above in this discussion.

    No modifications.
     

    Attached Files:

  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Well, those are puddles. You can control them in road material settings - turn them off or add them less or more.
     
    hopeful likes this.
  48. MdotE

    MdotE

    Joined:
    Aug 9, 2018
    Posts:
    10
    Really? Good to hear. Sorry to waste your time. They just started showing up recently.
     
  49. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    84
    Wondering if turning off parallax for the windows would help with performance? And if so how do I turn it off, I can't seem to find it myself
     
  50. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Nope, not much. Parallax for windows is pretty simple in instruction count, so it doesn't help much on saving FPS. Do you have any FPS drops that you want to optimize?