Building details…
Posted in Procedural world, Zombox on August 30th, 2013 by Tyson IbeleSo I’m getting closer to having the entire city generation engine re-written. It’s been a huge project (since it makes up a huge chunk of the game’s code and had to be completely re-written from scratch)….but the benefits have been awesome (as explained in previous posts).
In the process of re-writing the way that cities are generated, I’ve also changed the way that buildings are generated. Currently there are 15 different types of buildings (hospitals, houses, banks, stores, etc). Each building type had a specific custom interior (so stores have checkout counters, houses have kitchens and TVs, hospitals have beds, etc)…but in the old system the exteriors of the buildings were completely randomized. This means that a hospital might end up with the same roof and brick color as a house, etc.
The problem with that approach is that it becomes very difficult to tell buildings apart, without going inside to see the interior decorations. That also results in a very boring-looking city…where all buildings are essentially ‘the same’, in the sense that their colors and exterior decorations all come from the same set of options.
Since I’m overhauling the whole system, I figured it would be a good time to change how buildings are generated. Now, each building type has a unique set of possible walls and roofs that are specific to that kind of building. So, as you’re walking around the city, you can identify buildings by their exterior color and decor. When you see a steeple, you know you’re near a church. When you see an envelope sign, you know you’re near a post office. When you see a bunch of movie posters, you know you’re near a video store, etc.
Here’s a screencap showing a viewport preview of all the possible walls for each of the 15 building types.
Here’s a screencap showing a viewport preview of the possible roofs for the 15 building types.
As buildings are generated, first the ‘type’ of building is chosen, then its walls are taken from the corresponding group of possible walls, and then a roof is chosen from the corresponding group of roofs.
Here’s a screencap illustrating what a couple of buildings end up looking like, once their geometry is generated from the prefab objects shown above.
Also for those who haven’t yet noticed…comments now require registration/login. It’s super easy to do, and avoids some of the problems that were happening earlier (with people posting under other peoples’ names, pretending to be them). If you have any issues with the registration/login system, or someone else has taken a username you previously posted under….feel free to contact me and let me know and we’ll try to resolve the issue.