Procedural Building Creation

procedrual Houses

Over summer, I’ve been working on some procedural content generation code, part of which is a city generator, the other part of which is building generation. The above houses and apartment blocks were generated using the same algorithm, which takes a basic input shape (such as a cuboid or T-shape) and recursively adds details in. So firstly, it would divide the front face of the building into stories, depending on how high the building is. During the next step, the bottom level would have a door added, and higher up levels would have some windows and other details added in.

The purpose of this approach is to allow a huge number of different sorts of buildings to be created quickly, without user interaction. When finished, it could be a very useful tool to development studios wanting to create a large world at a low cost.

The program is being developed in Direct3D, and it interfaces with Python to allow the script rules to be changed, which means that new building types and styles can be added just by modifying the Python file. All of the geometry manipulation is done within Python, which meant I had to write Slice, Extrude and Felkel straight skeleton functions exclusively in Python.