Search Unity

World Building [RELEASED] CScape - advanced building generator

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

  1. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    84
    Lol well loads but I'm not sure they're really anything to do with cscape yet. I still have to further test everything but I'm just doing an early pass now and trying to pick off any low hanging fruit. Do you have a guide anywhere on optimising cscape? I'd like to be able to get as much performance out of it as possible
     
  2. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This really depends much on your needs - how do you wan't to balance visual quality vs. performance. CSCape gives you a plenty of tools to help you in this task. Here are some tips:
    [RELEASED] CScape - advanced building generator
     
  3. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm approaching to release a new version of CScape.
    It adds some incredible performance boost. This is a simple screenshot from editor, but a boost is much higher in a standalone players.
    StatisticsCScape.jpg
    What actually happens here? I've made a system for merging (batching) multiple buildings into single meshes instead of relying onto Unity batching system (that is now used mainly for LOD meshes). This system improves also in editor navigation. Now we can get 0.7 ms of rendering time on GTX 1070 with an almost insignificant usage of nearly 1ms of CPU power. All this without further optimization like static batchig or occlusion culling. Tests were made on a 10 X 10 (default) city with a new slated streets generation on approximately 3 000 buildings.
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    That sounds amazing! And with all the new features you've added, too! :D
     
  5. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Looks like Amplify shader now supports both HDRP and LWRP (and switching between rendering shaders).

    Any plans to support HDRP ?
     
  6. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, I'm planing. But unfortunately, I still havent managed to run HDSRP with Amplify. There are many versions of SRP, and I think that I'm using one that doesn't work.
     
  7. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Blatant plug: I have released a beta of my game made with CScape. I tried a number of different assets to give me the abilities I wanted, but NONE of them came close to the abilities of this asset, and without it I absolutely could not have built this game. The performance of this asset is EXCELLENT!

    The game is primarily designed for VR, however I have also compiled it for PC. Details here: http://www.blissgig.com/default.aspx?id=48

    There seems to be occasional issues with my site, so you can see the trailer here:


     
    olix4242, Neviah and hopeful like this.
  8. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    I like this one, How did u go about putting the water by the city and terrain. Did easy roads make this procese easier?
     
  9. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    The water is just the "Water Basic Daytime" from the Unity Sample Assets. I used the Daytime version as it shows better in my night scene... odd, I know.
     
  10. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Wow Well it actually looks really good, Nice job
     
    JamesWjRose likes this.
  11. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Big credit, HUGE credit to the asset developers. I am a business software developer and this is my first game, ever, in 20+ years writing software. For me software is Lego pieces, and "simply" putting them together correctly. Easy Roads 3D and Cscape both especially helped get what close to what I want this to be. To get better I need to hire graphics people and purchase better assets. But the idea is there, and now I know how much effort something like this takes. A LOT! Seriously, all developers should make a game.
     
    Aaron2348 and olix4242 like this.
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I would like to share with all of you a new screenshot. I have important updates on performance and I'm really excited on what can now be done with CScape. I've managed to make it run at 1300 fps in a 4K screen resolution. Testing gear is GTX 1070. No post processing effects are applied. With post processing effects at 4k a framerate drops to 600 fps. But this happens even without any object in a scene.
    ExtremePerformance.jpg
     
  13. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Wow okay this is amazing, what actually did u have to do to get those results exactly? And with this kind of performance is there room for integrations with an asset like Easyroads? might drop framrates a bit but will still be very worth it for Cscape
    Cause as of now there is no way to get a real lookin city with Cscape...Another option might be allowing the street mesh to be created with probuilder or other 3d modeling software just lile the buildings.
     
  14. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    35
    This asset looks amazing, but I had a couple questions:

    1) Can you use your own building assets instead of the skyscrapers?
    2) How much control do you have over the street layout?
    3) Can you generate the city programmaticly during play?
     
    Last edited: Sep 13, 2018
    d1favero likes this.
  15. orvedal

    orvedal

    Joined:
    Nov 10, 2015
    Posts:
    47
    Construction is also included in a very worthy pack of tools if you look into the author.

    I too was having the green building issue. I am using Unity 2018.2.2f1 and after including the 2018_support package and making sure No emulation was checked I still had the unable to unroll loop error in the building shader, so all of my buildings were an interesting green and yellow. I had to comment out the while found at line 148 to get functioning surfaces on my buildings. I am not on a mac, and I have a Ryzen 7 1800X with 32GB ram.
    However, since doing that I have noticed nothing that doesn't seem like it's WAI and am pleased to have spent the better part of a night trying different options to achieve some fun results.
    Do you plan on adding alleyways? I notice that everything seems pretty uniform without them, as they are a pretty standard feature in most city blocks.
    Keep up the fantastic work. I have several environment generating tools, including the expensive ones and in all honesty this has provided me with the most satisfactory results.
     
    Last edited: Sep 14, 2018
    olix4242 likes this.
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    As some trivia ... in the US, NYC is notable for lacking alleys. Sometimes courtyards and other structures exist within blocks, but the original design called for extra wide streets (to help prevent fires from spreading) and no alleys (which is why garbage is set out on the curb).
     
    olix4242 and orvedal like this.
  17. 22

    22

    Joined:
    May 22, 2009
    Posts:
    63
    I am going to love this asset even more :)
     
  18. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    You should download a latest version of Patch.. it should work right out of a box.
    https://www.dropbox.com/s/cim4di0xpi53pdn/ShaderPatch2018.0.2f.unitypackage?dl=0
     
    Hawk0077 likes this.
  19. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    CScape should be seen as solution that covers basic city making that is easy to use and is much more performant than any other tech in this field. And it gives you tools to implement other level features.
    But it isn't a tool that will give you a finished complete city with everything that can be found in a city.
    But a best way to use it is to generate city, and then customize it's look by hand. Mostly because you wouldn't want to add details to whole city but only in points of interest.
    CScape is somewhere in a middle between products that do everything for you and products that give you artistical control over what are you doing.
    For example: you need an alley in your level? Just resize one of the buildings and you got a space for it. You can add your models like cans and things that usually belong to alleys. But I would never suggest to add it to all alleys.
     
  20. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    So there wont be alley support? i would like to see this too.
     
    Neviah likes this.
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    For now I didn't find any usefull way to integrate them. Main problem is also that Easyroads is closed system (dll libraries), so I can't put my hands on it's code. It's side objects feature isn't enough for using it for building construction.
     
  22. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It's not neither yes or no. For now there are are some other things that are much more important than this feature. But if I go for this feature, it might be only as additional pack. It is easy to implement, but hard to fill with 3D models that have to be modeled before. Alley is just a space between buildings (resize building by one cscape unit and you have it). But then you have to add additional objects to it.
     
    Aaron2348 likes this.
  23. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    Have you asked the devs about adding hooks that would be useful for cscape? They seemed open to a deeper integration.

    Is this not enough though? +some additional building parameters +some overlap checks +maybe make it regenerate as soon as a road is changed, and you can easily create diverse cscape layouts with easy roads
     
    hopeful and Aaron2348 like this.
  24. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Different city layouts would be nice is what I'm saying, city layouts that involve Alleys. For Vr the current state might be okay, but i'm not making a Vr game and You would not have to model if anything simple placeholders.. just present the logic the lays the buildings out with alleys in mind, One can put all alley models in themselves. The asset is good it has good performance and quality, I do think the street props spawning could be fixed, could have some sort of adjustment options and a visualize mode, but city customization is the main issue really. I know your task in front of you seem very important but at somepoint do you plan to focus more on the importance of art in Cscape?
     
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This is already coming to CScape with a new layouting workflow.
     
    hopeful likes this.
  26. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Okay and whats the new layout workflow going to be like.
     
  27. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Layout1.jpg
    You generate street Layout..
    Layout2.jpg
    You delete street districts that you don't need.
    layout3.jpg
    You generate buildings for desired street layout. By hand or automatically.
    layout4.jpg
    You select districts (streets) that you want to personalize, and you set a distance for buidlings (or other options) and regenerate those districts - this will create alleys between buildings like here.
     
    shredingskin, d1favero and hopeful like this.
  28. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    This looks great, all it needs is curved streets in the layout to make it less box like, but great improvement...So anysquare can be deleted, and is there a way to snap two street layouts together that have been generated with Cscape?
     
    d1favero likes this.
  29. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Also the building interior
    /rooms are not sized real world like my third person character is. how do i got about fixing this issue?
     
    olix4242 likes this.
  30. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    In new workflow Also would be nice to be able to name districts in the inspector and click on the name to navigate to that part of the city.
     
  31. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    Also @olix4242 not sure if I have have offended you in any way, but I really don't appreciate you not responding to my posts about possible ER integration. I am trying to advocate cscape when I can and I am really looking forward to any possible cscape improvements. And an integration with Easy Roads would be nice to have since ER is a powerful asset on its own. Even if a bit hackish with the side objects. But its probably just more convenient for you to ignore my posts about this...
     
    Last edited: Sep 19, 2018
    Rewaken and Aaron2348 like this.
  32. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, you didn't offend me in any way and I'm sorry that I didn't responded. I was sure i put some like, but probably on another your post on that page. At a time I wanted to try to see how it could be integrated and how side objects work. Sorry for that. I started working on it, and wanted to get back to you, but unfortunately, couldn't get it to work in any managable and consistent way. It would require hacks on hacks. EasyRoads simply aren't made for this kind of task. And also, there are some things that should change in CScape to make it able to work flawlessly with terrains (and I'm working on this changes for future updates). But, I think that this integration should be pretty hard to make. I can't do it without accessing source code and changing a mode how EasyRoads organizes objects. On the other side, it would require too much work for EasyRoads developers to change their system and add things that are needed by CScape. It's not something that can't be done, but probably is too hard at this stage of developement where CScape introduces many changes. I will still do some modifications on CScape side just to assure that it can be used also with third party systems (like removing dependency on using CScape buildings in a CScape hierarchy).
     
  33. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    35
    Wanted to see if I could get answers to the following questions (1&3).

     
    d1favero likes this.
  34. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    I think it should be possible to get decent results just on top of ER without requiring modification. Ill play with it a little more and share later.

    1. you can use your own meshes but they need to use the cscape material. but nothing is stopping you from adding a few of your own buildings here and there.
    3. yes
     
    olix4242 likes this.
  35. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I've made some modifications to my system - now buildings doesn't have to be inside Buildings folder to work correctly and doesn't require a presence of CScape city object in a scene. This should simplify a little bit implementation. If you want to try it send me a PM.
     
    Last edited: Sep 21, 2018
    hopeful likes this.
  36. phlebotiss_unity

    phlebotiss_unity

    Joined:
    Aug 7, 2018
    Posts:
    3
    I was able to resolve the green building issue with PC/DirectX builds. However, for WebGL I'm still having the issue. I've tried 2 different patches ("Unity2018_Support" and "ShaderPatch.2018.0.2f") The first patch doesn't change anything - still get the green buildings. The second, removes all materials so everything is black. I've reverted to the first patch there, as I prefer green buildings to no material at all :)

    Is there another patch floating around? Might be easier to manage issues if you used a issue tracker... I feel like there's multiple patches for different versions and it's hard to get an idea of which one to use.

    My Unity version is:
    2018.2.6.f1
    Build Target: WebGL 2.0
     
  37. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Latest version is ShaderPatch.2018.0.2f (it has a larger number). You have to use this version.
    It should work (but I didn't test to build from Unity 2018.2.6.f1) if you say that it gives black buildings.
    -Be sure to set WebGL 2.0 in Api list, ant to remove WebGL 1.0 Api from a list.
    -Bee sure to turn off Graphics Emulation. (edit/Graphics Emulation/No Emulation). For some reason, Unity tries to emulate lowest API version, and this turns off textures.

    UPDATE: I've tried and I can confirm that it works.
     
    Last edited: Sep 21, 2018
  38. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    I've noticed when creating cities that the navmesh also gets added to the inside of buildings causing my procedural spawner to spawn inside the buildings.

    I have to take a big step to get around this
    1. export the entire city to FBX
    2.Import the FBX city into Blender
    3. Manually cap off all building bottoms (side-view, select all bottoms and create faces)
    4. Export from Blender to Unity via FBX(binary)
    5. Resize FBX city to match actual CScape city
    6. Bake navmesh etc...

    It would be nice and easy to use the city with procedural spawners if the buildings already had 'bottoms' on them instead of being open, is this function already available?

    Also what does 'slated' mean in CScape?
     
  39. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    ..So In new workflow anysquare on layout can be deleted??? and is there a way to snap two street layouts together that have been generated with Cscape?
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    That's a big change!
     
  41. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, you can delete any square before generating buildings. And you can also layout them to your needs. A perfect way to use it is to generate big layout, and then just delete unneeded objects. Doing so, you don't have to use multiple cities, but can use one single for a whole layout.
    As for snapping: a good thing to do before starting to work on layouts is to set Unity to work with snap at 3 units. Go to Edit/Snap settings and set snap to 3 units. THen, when moving objects hold CTRL and you are snapping everything to CScape grid.
     
    Aaron2348 likes this.
  42. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    is there an easy way to add cities on an hillside gradient?
     
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Hmm.. I understand a problem and actually, don't know how to solve this. Pretty strange that unity doesn't use actual colliders when generating NavMesh.
    Why buildings doesn't have bottoms?
    -Because it will add many triangles to a scene. It would require something like 30 triangles on bottom. This isn't a large amount of triangles, but if you multiply it by number of buildings it gets much larger for overall scene.
    I could probably add some bottoms to existing templates - but this would be a overkill for many users.
    In your case, it could be probably better to edit FBX templates and use them instead of original ones.
     
  44. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    328
    Ok great, and whats the eta on the new update and the Cscape building tool u have been working on?
     
    d1favero likes this.
  45. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    No, unfortunately, for now, CScape doesn't support inclined terrains. Atleeast, not wheen using automatic building/road placing.
     
  46. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Thanks, I can do this manually over time so log as I get the foundations right. Big job though.
     
  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Tonight I've added ability to extend foundations of a buildings so that they can easily fit sloped terrain.
     
  48. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    wow that sounds good... To upgrade Cscape do I just reimport it over the current installed version? and my current cities will be unaltered?
     
  49. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Good question. I'm trying to make it so that updating should work mostly without problems. But it probably won't cover all possible cases and making a backup should be a good idea. There has been a lot of changes under a hood and in a way how CScape works now, so this can break some things here and there.
    What should work:
    -Your existing city shouldn't break. It might change a look a little bit - because of new texture sets and shaders - this is done to improve overall look and shouldn't be a deal breaker. It won't change a layout of your city, position or size of buildings.
    What doesn't work:
    -Building generator (CScape City object) has to be updated with a new version of prefab. This is done by going to CScape City object and clicking on Revert button. This will update main prefab. This breaks compatibility with OLD City Randomizer - that won't work anymore if you still have to generate buildings and details.
     
    Hawk0077 and d1favero like this.
  50. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Thanks Oliver, much appreciated.