My AssetStore Link

I've moved - GO TO THE NEW WEBSITE

Unity Store Link - Click to see all the Song's work that has been put on Unity AssetStore




Friday 18 November 2011

Procedural City Block Filler

Just another showcase of the work I have done. Something I've build for a client which I think it's rather cool. Big thanks to him for allow me to disclose this. Like the title of the post suggested it's a procedural city block filler. The idea is a algorithm that placed the building prefab for you on a cityscape defined by lot.
The algorithm can place the a fixed list of building prefab automatically based on three method.
  • Fill - Try to occupied as much space as possible in the lot.
  • Edge - Just line the building on the edge of the lot.
  • Random- Randomly place building on the lot until a certain amount of place is occupied.
Different building type can be placed on different type of lot, which can be specified manually. The idea is the user can easily lay down as many lot as they want and specify the lot type via tag. The lot for simplicity sake will just be a rectangular plane object. The user can then assigned the building to be placed on each type of the lot. The building can be an any size and height, but they are assume to be cubical. The algorithm can be run in editor mode as well as in run time.

There are other parameter which can be adjusted such as the building spacing, filled rate for "Random" placement, spacing from edges, etc

Here's a link to a demo webplayer for those who are interested in seeing the algorithm in action. The adjustable parameter in this demo is limited as I'm too lazy to build a full run time interface for it. The screenshot below is taken from the demo webplayer. For simplicity sake, I just used primitive cube of different size and height and color to represent the buildings.

Taken from demo webplayer


No comments:

Post a Comment