Search Unity

City Generator

Discussion in 'Assets and Asset Store' started by wireddev, Nov 10, 2014.

  1. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138


    WEBSITE: http://wireddevelopments.com/citygenerator/
    ASSET STORE: https://www.assetstore.unity3d.com/en/#!/content/24993
    WEBPLAYER: http://wireddevelopments.com/citygenerator/demo.php
    MOBILE (Android) DEMO: http://wireddevelopments.com/citygenerator/demo.php
    SCREENSHOTS: See post below.

    This super simple city block generator allows you to spawn any size city you wish, using your own assets .... IN SECONDS!



    Think how long it would take you to create 50 city blocks in Unity. You’d have to place every single individual unique building, tree, rock,bin, fence, light post, bus stop, fire hydrant… the list goes on and on!

    Well as long as you have the art, City Generator simplifies all the hard work for you. Just put all your prefabs in a folder, set the city size options then press the Generate City button... INSTANT CITY!

    City Generator and Road & Traffic System now working together with the click of the "Generate City" button!




    This video shows City Generator + Road & Traffic System working together... the City Generator detailed video is below.


    Works great with our other package “ROAD & TRAFFIC SYSTEM”, check this package out here: http://wireddevelopments.com/trafficsystem/

    The hardcore details are below but watch the video if you don't like to read
    :)



    Below explains this super simple city block generator in full detail.
    Be sure to watch the video to see City Generator in action!

    How to use the City Generator system
    • Drop the “CityGenerator” prefab into your scene.
    • Set your city “Width” and “Height” to determine how big your generated city needs to be. Then set the “Ground Position” (default is zero).
    • Set your city “Block Width” min and max. This determines how many buildings (objects) are placed before a street space is added.
    • Set your “Street Width” to determine the width of your streets.
    • Drop all your prefab objects into the “City Generator/Prefabs/Active” folder so the system knows what objects to use when generating your city.
    • Add the “CityGeneratorAsset.cs” script to all your prefabs you want to use in the City Generator system. This can be down in one step by selecting all your prefabs and adding the component in the Inspector.
    • Use Clear Zones to stop certain areas having objects spawn in them.

    Additional Options
    • Adjust the frequency of how often each object should be generated by assign each object a LOW, MEDIUM or HIGH status in their “CityGeneratorAsset.cs”.
    • Easily determine the ground position for each object as the pivot point might not be at the base of the object.
    • Set the spawn rotation (fixed or randomised) for any object.
    • Determine if an object needs to be flipped for opposite sides of the road when spawned.
    • All object sizes are calculated automatically using their renderer bounding box but you can manually add a collider to the object to determine its size if you need to determine exactly how the system should determine that objects size.
    … best of all, this system can be used to generate anything. For us it suited City Generation but this system takes unlimited objects and spawns them in a grid with custom spacing so if you think your game could easily benefit from automatically creating a layout in seconds, you need to get City Generator for Unity3D!




    PLEASE NOTE: The models in the screenshots and video ARE NOT included in the City Generator package. They are only examples to show how the system can use anything your throw at it quickly and easily. For reference if anyone wants them they are from an awesome creator called K4!
     
    Last edited: Nov 21, 2014
  2. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Few screenshots to wet the appetite :)









     
    Gozdek likes this.
  3. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Thanks about the mobile performance tips.

    So as long as my buildings are lo-poly and small textures, small cities should theoretically be able to be generated at runtime (if you do implement this feature in the future) on a relatively recent mobile device within a short loading period (I would say the player would start getting annoyed if generation took over 10 seconds).

    That's what I meant by performance benchmarks -- "can generate a small city of 100 lo-poly buildings in 10 seconds on an iPhone 5," something like that. I've used Daedalus dungeon generator in the past (a fairly comparable asset I think) and it is able to generate a fairly large lo-poly dungeon at runtime on a Galaxy Note 2 and iPhone 5/s in just a few seconds.

    Thanks for any insight! A demo apk would be the best, but performance benchmarks would work too. I understand you have not implemented runtime features at this time, so I can wait for this in case you do!
     
  4. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Also, can you determine the facing direction of individual buildings by using rules during generation? Such as "have all main doors of buildings always face the closest street, with east-west facing preferred over north-south," etc.

    Also, can it generate streets and traffic signals in the blank spaces to use with your traffic asset.

    Thank you!
     
  5. mitchtheriault

    mitchtheriault

    Joined:
    Aug 4, 2013
    Posts:
    27
    Could come in handy
     
  6. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    No problem we will try and run this test for you and let you know the results.
     
  7. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Yes this is a feature already. You can determine the rotation to spawn for each individual object and also enable the flipping of the object to face the street always. It is all in the video - this particular item is explained at the start during the explanation of the CityGeneratorAsset.cs. You can also find an example of this in the video at around 4:30 minutes.

    As for street and traffic signals, this system was built to work together with the Road & Traffic System making both simple to implement quickly now. City Generator creates the road spacing for the Road & Traffic System to come through and place the road and spawn the traffic.
     
  8. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
  9. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi eridani, test for mobile is ready and it is very fast! You can grab it here: http://wireddevelopments.com/citygenerator/demo.php
     
  10. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Whoa you guys work fast! And the city generation works fast too =) I'm very impressed!

    You know what would make my life complete now?? I don't know how much work this would take you guys. But if you could have pedestrians (simple mecanim or legacy characters that we substitute) walking on sidewalks of the Traffic System, and stopping at red lights before crossing the street, and walking around each other when they get in each others' way, and maybe even entering and exiting buildings... that would be the holy grail of city generators!

    In fact, you could package the City Generator with Traffic System and a Pedestrian System as a procedural GTA (Grand Theft Auto) type sandbox game generator...I think tons of people are looking for such an asset.

    Anyway, I am definitely interested in both your City Generator and Traffic System right now. Will you offer any kind of bundle deal when getting both together? Thank you for your hard work.
     
  11. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Thanks Eridani, we are working hard to get a solid product in this space that is for sure. We will look into the Pedestrian System as it shouldn't be a massive job to add that to the Traffic System or even create a standalone system. As for a bundle deal, we might look at submitting a bundle product but currently it isn't in the pipeline.
     
  12. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hamesh81 likes this.
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    This is looking like it could be very helpful!

    I'm interested in a pedestrian system as well. Other AI could be adapted to this purpose, of course, but it would be best to have something keyed directly to these assets that could allow pedestrians to take proper advantage of the roadways (jaywalking when there is no traffic) and street lights (crossing on WALK).

    And, preferably, something that can be used along with EasyRoads 3.0, though I have to say that if the City Generator can lay down roads and sidewalks, EasyRoads becomes less needed.
     
  14. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    We are looking into a pedestrian system and it will take full advantage of the City Generator plugin and Road & Traffic System plugin when complete.

    Our Road & Traffic System which works hand in hand with City Generator can generate all the roads you need. As for sidewalks, since you can easily create custom models and textures to replace or add to the default list of road pieces you can put in sidewalks yourself. We will look to add sidewalk pieces and textures in as an option soon since we have had a few requests for it. Definitely check out our Road & Traffic System though: http://wireddevelopments.com/trafficsystem
     
  15. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
  16. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    City Generator just released! Purchase on the Asset Store here.
     
  17. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    Road around the city it's must wanted :)
    it's always good to see new
     
  18. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
    does this take advantage of static batching? ie. is it possible to combine a cluster of buildings into 1 gameobject to improve perfomance?
     
  19. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    1. Is it possible to see a demo of the Traffic System + City Generator working together? Is it a one-click process with random streets, or do streets have to be laid out manually first.

    2. Can the buildings fill in every blank space of the Traffic System streets... in other words a very dense city? (in your example picture, some spaces are filled with trees, and some spaces are completely blank).

    3. Will you actually be working on a sidewalk and pedestrian system or is that still pending a decision?

    Thank you!
     
  20. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Yes you can static batch your objects and yes, there shouldn't be any reason why you couldn't cluster buildings into one gameobject. You can create any kind of prefab you like to be spawned from one small object to putting a group of objects together, placing them under one gameobject, setting its collider to be the outer size of the combined group of objects (so the system knows how big the gameobject should be) and saving that as a prefab to be used in the system.

    The City Generator is very versatile. It was called "City Generator" because that was originally why we made it, to generate Cities around our road networks that Road & Traffic System creates but really City Generator is a way of place objects in a set are in very dynamic ways (rows, columns, random grids, different terrain highs, dynamic spacing, dynamic random objects...and lots more. See more on the website and the unity asset store page for details)
     
  21. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    1. We are putting together a video to show off City Generator and Road & Traffic System working together to show how easy, quick and painless it is to spawn a dynamic random city around your road network. As soon as it is ready we will post it on the forums and on the websites. It is not a one-click process to generate your road network with Road & Traffic System (please see the videos on the website to find out how this system works)... once you have constructed your road network it is however a one-click process to dynamically generate a random city around your road network.

    2. This all depends on the assets you provide and the road network you have created. The City Generator system will look at all the prefabs you have put in the "\Assets\City Generator\Prefabs\Resources\Active" and analyze the sizes of each when trying to fit them in the gaps of your road network you have created. Therefore, if you create roads side by side with no spacing (or next to no spacing) and you only have large building prefabs in the "Active" folder, the City Generator won't spawn anything because it will determine that no objects can fit. You need to make sure you use the correct size objects for your road network you have created. This can be done by making sure you leave big enough gaps in your road network when creating it (i.e plan it out) and/or scaling your objects and choosing a variety of objects for your city on generation. It is not hard to do but it might require a few minutes to make sure you are going to be happy with the outcome before you start placing down road or create / purchasing assets for your city. There is an additional option that ships with City Generator called "Enable Advanced Packing". If this is set to true when you go to generate your city around your road network then the City Generator will randomly try every single object in the "Active" folder (regardless of whether you have determined that prefabs spawn frequency to be HIGH, MEDIUM or LOW) before it determines the space empty. Processing time is hardly effected by this so it isn't a bad idea to keep this enabled but it is not always required, especially if you are not using City Generator and Road & Traffic System together.

    3. We are actually working on such a system. As to when it will drop is TBA at the moment.
     
  22. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Wow looks like you guys think of everything. Thanks for your detailed answers.

    So it looks like the only thing missing from the generated cities right now is sidewalks... and of course it will make one lifelike city when you do add pedestrians to the mix. You mentioned before that the Pedestrian/Sidewalk system will be a part of Traffic System right? So in other words, no separate asset purchase necessary?

    A couple of suggested features for the sidewalks, if I may: perhaps have the ability to add lampposts at spaced intervals (the kind that arch halfway over the street), and maybe some sundry items such as trash cans, postal mailboxes, newspaper dispensers. Just a thought to add even more texture to the city.

    Thanks again!

    EDIT: I just read again that you might make the Pedestrian System a standalone system. Hopefully you'll have some kind of bundle in that case for people who want everything.
     
  23. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Here you go. Hope this gives you a quick look into City Generator and Road & Traffic System working together.

     
  24. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    We've just submitted update v1.0.6 which now comes with the option to deform the terrain to flatten out the base of the objects you're spawning onto the terrains height. Comes in handy particularly for buildings to fit flush into the terrain.

     
    hopeful likes this.
  25. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Just some feedback... For this feature to truly make sense, there should be an option to have the door to a building always face "uphill" ... otherwise the door might end up facing out into open air. Otherwise very cool new feature. Thanks guys
     
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Or extend the terrain base a little bit, I guess. A more gradual slope would work ...?
     
  27. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    There is an option to always have the building door face the street or any other angle you wish. You can also make the object always be at a certain angle (X, Y and Z) and ignore the flip to street view option. Couple of other options also which are illustrated in the video in the original post.
     
  28. warren-miller-maltd

    warren-miller-maltd

    Joined:
    Jul 26, 2012
    Posts:
    53
    hi - I have both City Generator and Road & Traffic System and was wondering if theres a way to generate both the city and the roads with one click?
    ie: make a random city with random roads without having to create the roads first?

    thanks,
    warren
     
    eridani likes this.
  29. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    No you must you the Road & Traffic System to create your road network first. We are looking at doing a one click random road network and will keep you updated with the progress on this. For now you can use the TrafficSystem custom unity editor tools to create your road network then do the one click to generate the city around it with whatever city assets you wish.
     
  30. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Great looking asset and there is a lot of potential here.

    But it's missing one key feature. It doesn't consider zones for cities. Most cities have urban centers (where you find skyscrapers, etc), commercial zones (where there are shops, etc), industrial areas (w/ manufacturing centers), and lastly residential centers.

    This asset just treats the entire city as one zone so you can get odd scenarios of a factory, next to a skyscraper, next to a home.

    Would love to see an update that took this into consideration.
     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Can't you just make an urban section with tall buildings and then make a suburban section with residential buildings?
     
  32. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Yeah, you could do something like that, but it wouldn't look very organic. Things would look pretty blocky.
    Ideally you should pick a city center and then you travel from the center to the edge you'd pass through each of these different zones at some specified distance.
     
  33. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    So basically circular zones radiating out from a central urban zone?
     
  34. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Yeah, exactly.
     
  35. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Also, you might want to have unique block and street size parameters per zone.
     
  36. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Can the exact same random city be generated each time, by using the same seed key or some such? Thank you
     
  37. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Regarding "Zones", if enough people want a zone feature added we will add it to the development list.
     
    MarcusWatson and wetcircuit like this.
  38. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    We have not tried this eridani but it sounds like it should yes.
     
    hopeful likes this.
  39. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    I vote for Zones. Nice feature
     
  40. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    That's not very reassuring... would it be asking too much to have you guys actually try it and give a definitive yes or no? :)

    As a practical use case, it would be nice to be able to travel to various cities and only have to remember the seed value for each city instead of having to save the whole cities.
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    And you can pass seeds fairly easily for multiplayer games, if that's needed.
     
    eridani likes this.
  42. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Just tested and the answer is no it currently doesn't generate the same layout if you use Random.seed = [number]. We will add this feature to the list.
     
    eridani likes this.
  43. john-essy

    john-essy

    Joined:
    Apr 17, 2011
    Posts:
    464
    Why do you include the project settings? I have nearlly just lost all of my projects settings, is it essential for these to be included for the system to work?
     
  44. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I'm sure wireddev will have a more complete answer, but the basic answer is that when Unity packages up an asset that is in the "complete project" category, the project settings are automatically included. This has caused some degree of consternation and grief over the years. The bottom line is that those who buy from the complete project category in the asset store just need to be on their toes and ever-watchful when importing assets.
     
    john-essy likes this.
  45. john-essy

    john-essy

    Joined:
    Apr 17, 2011
    Posts:
    464
    Thanks for that mate i get it now.
     
  46. john-essy

    john-essy

    Joined:
    Apr 17, 2011
    Posts:
    464
    I have followed the tutorials, i also have the road pack and the city pack. When in play mode all works great, When in edit mode it just creates a bunch of buildings totally ignoring my roads placing them on the roads? What have i done wrong ?

    Also for some reason i see in the video you can click Generate and it overwrites the previous city, in Editor mine does not do anything like this.
     
    Last edited: Jan 11, 2015
  47. MarcusWatson

    MarcusWatson

    Joined:
    Dec 9, 2014
    Posts:
    53
    +1 for zones. In an ideal world I'd be able to define my own zone areas and specify the buildings that'd go in each one.
    There are often too many variables for a system to automatically generate zone placement unless it's a totally flat landscape and you're emulating a pre-planned city. Depending on the age/location of the city you may need to place luxury residential near a coastline, industrial following a river, etc.
     
  48. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    would be nice if integrated with map-ity
     
  49. truefx001

    truefx001

    Joined:
    Jan 30, 2013
    Posts:
    132
    Hi,
    I bought City Generator quite awhile ago and now since yesterday also your traffic system.
    I'm having issues where the city generator is ignoring the clear zones totally and also the
    buildings go half way through my terrain. I have Unity5 and followed all the instructions on how to make both assets work
    together.
    Hope you can help me I wrote a email to support as well.
    Thanks
    Zvonko
     
  50. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi Zvonko, we have submitted version 1.0.8 that fixes a collider deprecation issue. Please update to this version when it comes available in the next day or so.and inform us if this fixes the issue you are seeing.