Search Unity

Procedural City

Discussion in 'Works In Progress - Archive' started by bigmisterb, Apr 17, 2014.

  1. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    As the title says. One of my projects over the past few weeks has been to work on a procedural city. Initially it is a port of Pixel City http://code.google.com/p/pixelcity/ by Shamus Young (I believe)

    Pixel city was basically a simple 3d city generation for learning. He provided all of the code that made it work, so others could learn as well.

    My goal is to not just recreate Pixel city, but to learn and adapt it into a full procedural generator. I will attempt to keep this thread up to date and add photos and such to it so that people can see progress. The overall goal is to produce something for the Asset Store, both for people to use in their games and for profit.

    Things done:
    Initial texture Generator (to match PixelCity)
    4 core building models presented in PixelCity
    Rooftop grid Generation

    Things to do (this list of course will grow):
    Put things on the rooftop according to the grid
    Square Street Generator (similar to PixelCity)
    Angular Street Generator with intersections
    Align Street to a generic height map.
    Non rectangular building Generator
    Initial High res Generator


    So my first goals were simple, learn how he did it,learn how to make it in Unity. So far I am working pretty well on that. There are a few things I need to work on this area though. Work with mip maps so they don't fade out so bad when farther away. Things of this nature.

    As I move forward though, I am doing things that are of course not in the original code. The buildings where I create a roof specifically on, I have adapted a grid for placement of objects. So now I can put objects by placement on top of the grid. Pent houses, air conditioners and the like. I still have as yet to make more complex roofs. I also would like to implement the building names as was done in the original.

    Currently, it creates 10 textures and colors them. Later, I will simply add vertex lighting. Also, things to come are the daytime versions of this.

    I may release this in waves on the Asset store to simplify things. If you don't requre a massive high res building creator, you shouldn't have to pay for one. ;)



    $BuildingGrid.jpg $Buildings1.jpg
     
  2. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Looking forward for more updates!
     
  3. gooncorp

    gooncorp

    Joined:
    Dec 30, 2011
    Posts:
    131
    looks cool :)
     
  4. Chemaxmax

    Chemaxmax

    Joined:
    Jan 27, 2014
    Posts:
    204
    That sounds great! Waiting for new updates :)
     
  5. Deleted User

    Deleted User

    Guest

    Since it's procedural City, I want to ask :
    Did you consider having different City areas?Slums, sightseeing zones, offices etc?
    I think it'd be a cool addition to the whole "pack", as it would make way more realistic.
    Of course I don't mean to have areas with only offices but for example if the area was filled with "slums", it would also have cheap restaurants etc.
     
  6. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    At the moment, I am just working on the "down town" part. It will basically be a generator that will export models in some format. (probably OBJ) It's secondary function is to provide a quick level generation that allows people to test other things, like vehicles or shoot em up games without having to make a thousand boxes and it all look funky.

    In the high rez part of this, I am aiming towards businesses at the bottom level of these buildings. Some buildings are company specific, while others are residential. Those residential are divided into 2 basic types: old school, like the ones built from about 1960 to 1980 and new school, which are more glass style with shops at the base.

    I have a lot more research just in the building part before making anything final. I would love to do city density like Suicidator City Generator for Blender. I also want alot of stuff, like Ghost Town for 3ds Max. Both are fairly powerful. A good blend of both is probably my best bet.
     
  7. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    OK, finally got a little time to work on this today. I made a simple grid so that I can test the way some things look. I also built a generic road so that it is all tied together. Currently it runs on a 4 units per level measurement system. this means each floor is about 12 feet high. The road is just blocks, however, I did calculate where each main vertex is supposed to be in the road.

    The green lines are just it selected. You can see points all through it that tell me where one side of the road is. I currently am just measuring the city and pushing the road that way, but in the end, I will let the roads do the measuring. The goal is to provide the builder with a set of vertices that denote what space we have to build in. This way, we build more than just square buildings. ;)

    I think tommorrow I will attempt to put the roads in with sidewalks and stuff.

    $City3.jpg
     
  8. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    looking nice
     
  9. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Just a little more work done. Attached is a pic of a procedural... well a little less than procedural road. It is the base road as well as the sidewalk. I think I am going to add a bit to round the sidewalk off. dunno how much this will affect things, but we can always try it. ;)

    Oh, this does include road widths. this is an intersection with 2, 2 lane roads, a 4 lane road and a 5 lane road.

    $Roads1.jpg
     
  10. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Looks great!