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. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962


    http://u3d.as/MSg

    CScape
    is a next-gen advanced procedural building generator. Main strenght of this plugin is that it uses serious drawcall optimizations. This is done by possibility to use only one one-pass shader/material for a whole city landscape. This resultts in a extremely optimized performance while using Static/Dynamic Batching or Occlusion Culling.
    it consists of a:
    -advanced customized PBR shader with parallax mapping
    -system for using simple building lo-poly template meshes, that can be customized in unity editor.
    -support for day-night cycling (animated lights)
    -simple city generator (at this stage it places buildings in a volume, but in a future it will have also some possibilities for laying out street maps).
    -Al buildings use a sort of fake parallax interiours, so that it gives an impression of complex meshes even in VR.
    -In a future, I also plan to release Building Styles Packs, like Sci-Fi city, '20's New York, Italian city, Cartoon City, Apocalyptic City, Soviet City. First version will include a pack called Megacity.
    -If everything goes as intended I also plan to release a CDK (content developement Kit) for artists that want to make their own CScape Styles (and eventually sell them on assetstore).

    Due to much request, I plan to release this as an Alpha version with a heavy discount for early adopters.








     
    Last edited: Dec 15, 2018
    newguy123, Rowlan, Alverik and 18 others like this.
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    looks great
     
    CrymX and olix4242 like this.
  3. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    New footage made with CScape.
     
    Lars-Steenhoff and Slaghton like this.
  4. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Do you have a timeframe for the first release?
     
    PeterProgrammer likes this.
  5. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I'm working on this, and hoping that i can release it really soon (I plan to submit it to assetstore in week or so).
     
    fathahnoor likes this.
  6. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
  7. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Great, decided on a price?
     
    PeterProgrammer likes this.
  8. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It will be in 40-50$ range for early adopters.
     
    v_James_v, fathahnoor and toto2003 like this.
  9. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    wow! really like this, would it be able to use our own prefab? i have a stock of building i would like to mix with.
    nice asset .
     
    olix4242 likes this.
  10. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes; you can use single buildings from my system and put them to your scenes, or integrate your own buildings into a city constructor. When you make your city with scripts, you can delete any buildings that you don't need, move others, and insert your own buildings and assets. Also, there are some scripts that can help you modify your own premade buildings (can't say that it works with all meshes, but it's quite simple-yet powerfull. With a time, I plan to include many other features. Right now I'm working on a street layout system and shaders for street surfaces.
     
  11. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Small test movie of a FPS view of a city.
     
    newguy123 and toto2003 like this.
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Working on a random street generation shaders, Street level test nr. 1.
     
  13. D3ck3R

    D3ck3R

    Joined:
    Jun 14, 2015
    Posts:
    6
    Hey olix,
    this is really looking awesome!

    As I am developing a VR Project, an important question for me is, if it will be possible to scale the whole thing to match things for VR and my project?

    In one vid I saw that the tiling of the skyscraper textures will be controllable, but will scaling be possible seamlessly also for the meshes and the roads (+props)?
     
    fathahnoor likes this.
  14. danzeeeman

    danzeeeman

    Joined:
    Mar 22, 2017
    Posts:
    1
    can I buy this now?
     
    PeterProgrammer likes this.
  15. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Evertything here is VR campatible (my main concern is always VR) and that means that a city is real world scaled (1 meter = 1 unity unit) so that it looks natural in VR. I'm using a unit of 3 meters as a standard CScape unit (CScape unit = 3m), as I've found that that unit is a best measure for distances (3mt for floor heights, 3mt for street lanes).
    As for street lanes, yes, they use a same system for scaling as buildings, so that you can decide how many lanes do you want, and how large is a sidewalk. Of course, for now, this system uses only parallel street configurations. This is one of the limits, but they are there for a good reason - optimization. Actually, any non parallel configuration would have a huge impact on performance, as it wouldn't allow for many optimizations that are there.
     
    fathahnoor likes this.
  16. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Some tests of street level night time visuals:
     
    LennartJohansen likes this.
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    looks great
     
    olix4242 likes this.
  18. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Thanks :) In a future, it will look even greater ;)
     
    Mark_01 likes this.
  19. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Even though I would have no use for this asset, it looks awesome! Good luck with the further development of it!!
     
    olix4242 likes this.
  20. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Such a great comment :)
     
  21. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This video is entitled: Creating a 16 square kilometers city in 2 minutes - with my Cscape for Unity. Yes, It can be done :)
     
  22. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    Very Nice, keep me posted, and I'll buy a copy as soon as it's purchase-able....
     
    olix4242 likes this.
  23. Tinux

    Tinux

    Joined:
    Dec 10, 2015
    Posts:
    1
    Great Job!
     
  24. ConAim

    ConAim

    Joined:
    Jan 17, 2017
    Posts:
    16
    Good stuffs, can't wait..
     
  25. ScrollWork

    ScrollWork

    Joined:
    Nov 27, 2014
    Posts:
    2
    As a developer who team is only 2 i can say this will help use out so so so much Please. ASAP. I need this in my life.
    A few questions

    -Fps
    -Daytime or only night time.
    - System requirements
    - Thoughts on the cost?
    - Release date?
     
    fathahnoor likes this.
  26. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    FPS depends, as usually, from many things. First of all from a number of buildings. But as this city uses only one material for buildings, and another for streets, unity will dynamically batch everything, and use a minimum number of passes, and this assures extremely high performance (in comparsion to similar cityies that aren't procedurally generated). I'm mostly benchmarking this in VR, and I get a smooth 90 fps. Also, a VRAM usage and build sizes are quite light , whole pack for a moment is large only 50 mega.

    Min unity version is 5.5.
    It requires shader model 4.0. and works on platforms as: Direct3D 11/12 (Windows, Xbox One), OpenGL Core (Mac OS X, Linux), Metal (iOS, Mac OS X), OpenGL ES 3.0 (Android, iOS, WebGL 2.0).
    For best quality rendering, it's suggested to use Linear lighting and HDR rendering.

    As you can see from previous videos, it supports both. It also uses dynamic transitions (like lights turning on or of) that can be controlled with curves and sun position (or manually with animator).

    A first beta version will be with a strong discount of 60% for early adopters. When finished and standardized (and many options added/or made better), it will be 100$, but until that stage, it will be 40$.I think that this is a fair price for what you can get with this. For now, it features some simple street layouting, that will grow in the future. I also plan to add many new features (as advertising billboards, detailing, other structures like bridges, parks, fillage support and so on - i don't know ETA for this features, and it might take some time as I'm only a one man developer, but they will be available for all users).

    I plan to submit it to the assetstore somewhere next week.
     
  27. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Hello,
    Looking great so far!
    May I ask how the streets are generated.
    Do you plan to add curved and multi-intersection roads?
    Any way to manipulate roads? splines perhaps?

    Is it possible to form different kinds of areas in a city?

    Is it easy to add custom materials into the system?

    Is it possible to generate a city on other meshes or Unity terrain?

    Thanks and hope you have a fantastic start at the store.
     
  28. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    For now, citu generation script is pretty basic (speaking of street layouts). It works only with a parallel street type of city. This approach isn't perfect, and I won't stop it here.
    But it also has some strong sides - parallel based grid solution is optimal for many reasons, Mainly because of how other systems work in Unity:
    -Lighter Precomputed Lighting GI with Enlighten (you can use low resolution solutions and get o good result, as enlighten works better on a grid based system so that texels are automaticaly aligned to grid.
    -Better Reflection probes support - you can use Box Projection probes for nice reflections. As you probably already know, reflection zones can't be rotated, and this results in incorrect reflections and blendings. Having all objects aligned to X and Z axes grid, makes it perfect. And also easy to implement (in a future) scripted positioning of reflection probes (dynamic or static).
    -With angled buildings and streets you can't use box colliders.
    -Angled buildings or streets would have to require more polys, make a system less performant, and would be hard to make to be resizable.

    This project was initially ment to be a easy building maker. Then I've addad street generation system, city layout system. I will be expanding this over time, to make it more flexible.
    But, anyhow, you can always use any buildings from it, and place it inside your environment (they can work as separate models too, there is no need to generate city).

    Depends how good you are with texturing ;) There are some standards that has to be followed - but other than that, it should be quite easy, once I release a CDK (cojntent developement kit) part for it - with all manuals.

    This is something that I'm also trying to understand :oops:
    It presents some difficulties, and for now, I can see only those, without any univarsal solution. this presents a grat probloem on optimization side. This would mean that a terrain should be tesselated (adding much polygons) creating facet fighting issues and so on.. then, you would have to render terrain, and streets on top of this, and overall, i think that this would lead to a real drop in performace. Also, this would require some sort of different building styles that can be placed on a relief terrain /I see that this could be problem for layout of first floors. Viable solutions are probably one of these, or a combination:
    -Create a system that can place buildings based on heighmap, without using unity terrain, but making my own city terrain system.
    -script an ability to add small terrains into some city zones, like parks.
     
    hopeful and DCrosby like this.
  29. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    This looks awesome!

    I'll pick up a beta version as soon as it hits the shelves. Keen to have a play around with it. :)
     
  30. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    Performance is less of a consideration for me than creating a realistic city. Your results so far look great, and creating a grid-based city is perfect as a starting point, but a little bit of variation would be very welcome.

    I'd love to be able to create curved buildings, like BuildR can for example.

    Any variation in height would be desirable, and would greatly enhance the realism. Maybe some kind of random noise function? Perhaps the resulting city could then be dropped onto a terrain, maybe even flattening it. I'd definitely want to remove some buildings to create little parks, that sort of thing...

    Any idea when it will be released? This could be a perfect fit for one of the levels in my car game, and I can't wait to start driving around my new city!
     
  31. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
  32. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    olix4242 and hopeful like this.
  33. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    Congrats on the launch! I'll grab a copy now :)
     
    olix4242 likes this.
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I really love the imagery you've created with the very tall buildings, and I'm encouraged by your desire to maintain performance while adding in features like the parallax interiors. It looks great! :)

    I agree that it is best to avoid using terrain under the city, and to use a logical or mesh base instead. That way you can easily build and edit structures beneath ground level, like basements, sewers, technical tunnels, city spillways, and subway stations. Terrain sections can of course be added later if a game dev wants, like for parks or natural areas within or near the city. You'd also want to make sure basic issues like city height and rotation were settled before adding terrain (because, IIRC, terrain won't rotate, and terrain won't go below Y zero).

    My plan for a city is to begin by placing urban ground level at about Y 300, and that way not only would I have plenty of room for building underground, but I could also do shorelines with underwater terrain having an explorable depth of up to 300m. I would also have an explorable area vertically up to about 4,500m.

    If you're open to suggestions on how to approach building a city, I suggest re-inventing the wheel as little as possible and focusing instead on the sorts of things nobody else is doing. For example, a new approach would be to build the city a block at a time, where each block is treated as a single structure all on the same Y-level (though with different objects within it, so there can be occlusion and LOD). Blocks could be defined by the user such as "industrial," or "downtown," or "art deco downtown," and the block builder could take the materials and whatever other definitions are provided and make the block.

    The reason why I think building a block at a time is ideal is that when buildings are placed, you need to have vehicle access that preferably is functional, like where a player (or NPC using waypoints) can drive a car off the street, over a ramp in the sidewalk, and into either a parking lot or parking garage. The layout of the buildings on a block need to take into account alley ways too, so that loading / unloading can occur, dumpsters and garbage bags can be spawned, and of course you have all of the other game activities that tend to occur in alleys. ;)

    Buildings will also typically have some sort of landscaping in front, maybe some seating, bike racks, vending machine, architectural lighting, and maybe a free-standing sign, and / or signs on the building itself. This is helpful to have, and the typical building generator won't handle it. The dev has to instead make all of this manually, when there could be set pieces that get pulled in and placed with offsets based on where doors are located.

    I have plenty of buildings, materials, and building generator type stuff. I have a road generator and a fence generator, and I have a terrain generator, but what would really serve my needs is a city block generator.

    Of course, you should do whatever it is you are drawn to do, like what you need for your own game, or whatever is motivating you. But for me, a city block generator would help bring it all together.

    Best wishes for you and your new plugin, and congrats on its debut in the store! :)
     
    Last edited: May 2, 2017
    Mark_01, olix4242 and v_James_v like this.
  35. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    This is a direction that I'm currently taking :) My subddivision will take blocks and subblocks. This was all ment to be a building generator in first place, but it hapened to grow to something much more complicated. For now I'm taking also an approach of modifiers that can be applied to entities (blocks, buildings) like instantiator modifier that instantiates lighting poles, trees, and other elements that occure frequenttly and with pattern. Other than that, I have building modifiers like greeble for rooftops, advertising panels for placing advertising panels to buildings.. next step will be to add some stackable behaviours to buildings, so that you can combine multiple buildingss into one. This way assures that you can create different typee of buildings, but with personalized level of detail.
     
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    This sounds great! I'll be keeping an eye on this. :)

    Naturally, I'd construct those areas that are unique or of high player focus by hand, but in an urban area there are so many buildings ... buildings that can be seen when looking down a busy street or from a high window, and you'd really want automatic generation to help out with building out that sort of thing ... to place dumpsters and fire hydrants and especially all the parking blocks and lines needed for a parking lot.

    And, as I said before, a key part would be not just to make it look good, but to make it functional, so that cars could actually drive along driveways into parking lots and garages. This means the curb, sidewalk - and all parts inward - would have to be part of the same design scenario.

    BTW, it's really interesting to see how much realism the parallax effect you're using gives to the city scene. I was always thinking of using it in places, but I never applied it to building windows en masse like you've done, and I have to say it looks awesome!
     
  37. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    I bought it today. Is it possible to release the night demo scene of your YouTube video?
     
    olix4242 likes this.
  38. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Yes, I will include it in a next version.
     
    Mark_01 likes this.
  39. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Amazing work!

    I've just started making a simple city generator of my own, as city environments are very integral to my current project, but it pales in comparison to what you have here. I do have one problem, which is the (understandable) inability to enter buildings; this is why I've made my own building generator that creates a shell, in which another generator builds the interior.

    Would it be possible for me to modify the generated buildings, to accomplish the above? That is:
    -Changing the collider (assuming colliders are generated) so that it is a hollow shell rather than a solid box.
    -Adding an entryway (hole in the collider + model) to the buildings.

    If not, I might still use your asset, since it's really exactly what I'm striving for, and I could put together a solution such as using pooled 'portals' that lead to generated building interiors as entrances to the building.

    Is this something you've explored?

    Thanks,
    Matt
     
    hopeful likes this.
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    For me, most of the time if a player can just open the door on a city building, I can manage the rest by a hand wave and a scene change.

    Unfortunately, hardly any product in the asset store has city doors that open. :(
     
  41. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Ah, ya, I understand it's a rather unpopular/unconventional feature. I'm just (perhaps unreasonably) obsessed with making seamless environments, since I'm making an open world VR game. I'll see if my portal idea will work out then. :)

    GL with the asset! Can't wait to see it progress. :)
     
  42. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Colliders are generated as mesh colliders.
    I' think that this could be done by hacking my system a little bit. I could probably add a cutout mask shader (a shader that masks building shader) to that it can become transparent where you wan't to put your doors. This shouldn't be hard to do, but I have to see if it still works well with some image effects (I remember that at one point this approach didn't work well in some of new unity versions). If this can be done without problem, than it should be quite straight forward.
    As for colliders, i think that I could apply some collider zones that would deactivate main building collider when a user is in front of a building (as there is no any need to use it in that zone).
    I'm not intending to make any scripts for building insides (as this isn't a scope of this plugin) - and this should be manualy created. But, I can give a user a way to do it if they need it.
    I promise that I will explore this feature ASAP. Right now I'm adding some extensions and doing modifications that will let you to use different maps for floor parts of a buiulding (so that it looks more like shops on a street level). Also, I've already added scripts for rooftop details, and working on advertising panels scripts.
     
    tapawafo and hopeful like this.
  43. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Today I have tested CScape on a new samsung gear with Galaxy S8. I can say that it works perfectly without any glitches at 60 fps. This also shocked me.
     
    hopeful and tapawafo like this.
  44. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Thanks for the in-depth reply! :) Glad to hear you're open to exploring the idea.

    I'll be keeping a close eye on your progress, sounds like there's great things in store. Considering how good it already looks, it will be truly amazing once you get those details in. :)
     
  45. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Thanks for your appreciating words.
    This project is in it's alpha stage because it requires inputs from users!
     
    tapawafo likes this.
  46. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Last edited: May 17, 2017
    hopeful likes this.
  47. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    While I like this idea in general, when you get to the specifics what I would prefer is the ability to take a city random key and generate a region of city blocks (based on an array of options) that create themselves within the constraints of the street map. I'm more interested about copying streets from a map in order to have a realistic city structure that functions, where you can drive a car along the roads and across ramped sidewalks into parking spaces. I'm less interested in simulating specific buildings, though that is fine as an option.

    It looks like this mapzen project is aiming for compatibility with BuildR, which can generate buildings based upon floor plan shapes.
     
  48. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Hello,

    Sorry, if I've missed something, but it seems you don't mention runtime capability anywhere? I assume the tool can work in runtime - is this a priority to you?

    Also, is it possible to retrieve the dimensions of the generated building?

    Thanks.
     
  49. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    While this would be a nice feature (that I'm exploring too), I'm not sure that it could lead to an optimized structures. CScape is all about optimizing rendering for Unity engine, from shaders to it's internal structure, while keeping a good looks.
    To understand what I mean, you can try to download a free (for developement) Mapbox SDK for Unity. It is powerfull as it takes real world data from and creates simple mesh for use in unity (without textures). Then take CScape, and try to make similar sized city, and you will see that a Cscape will have much better performance.
    So, yes, CScape isn't a solution for everything, but it doesn't have to be. It is a solution that is visually nice, but that on the other side doesn't impact performance. It's all about ballance and not about one solution that does everything, but then in real life: you need a monster coputer to run it.
    this doesn't mean that i won't give a try in implementing this kind of things, but my problem is: reallife maps mostly have some sort of errors. while they can be used for some sort of aerial meshing, they aren't as good for street level rendering.
     
  50. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    It should be possible to use it at runtime. But there are some things that you won't be able to do (as they are only editor functions - mostly related to baking and lightting, that are only editor). For now, It doesn't support runtime functions, but it will support them in a final version (with scripting function calls like RandomizeCity();).

    Well, all buildings have their size that can be retrieved with parameters like:

    Code (CSharp):
    1.  
    2. public bool width;
    3.         public bool height;
    4.         public bool depth;
    They are related to CScape units (one CScape unit is 3meters - a value that I've found as best for buildings. Most building floors or street widths are somewhat near to 3 meters, so this is perfect measure that can be used to size everything, by keeping thing on a virtual grid.
     
    Mark_01 and tapawafo like this.