Random Neighborhood Generator

January 20th, 2009
Random Neighborhood Generator

Random Neighborhood Generator

I was wondering how visually interesting a randomly generated neighborhood could be a made by using simple binary subdivision.  Basically the algorithm starts with a square, cuts it in half, cuts those halves in half, and so on to produce streets and plots of land.

It is in no way how a real neighborhood would be laid out, but for such simplicity I am rather satisfied with the results.  Such a system could randomly produce results that are visually interesting enough for possibly a small, simple flying or driving based game — such as having to rush a firetruck to burning homes, for example.

Here is the source code: neighborhood.py