Procedurally Generated City

I have always been interested in procedurally generating a city randomly. This has, and will continue to be one of my biggest interest as a developer. I have taken inspiration from the many beautiful cities around the world and the many cityscape, city landmarks and imaginary cities images flowing over the internet where if replicated in a game would form an amazing atmosphere and thus lead to an exception gaming experience. This motivation has added motion to the following examples and however complex the nature of cities are, I believed that approaching this task in a certain way, is key for me to procedurally generate a realistic imaginary city. I am therefore looking forward to the many other occasions where I attempt to achieve this goal.


Simple City

My first attempt to create a city was to randomly generate cube blocks within a space and making them look like buildings by added windows textures on them. I made this simple city example to help me reflect on how a city would look like, and when comparing it with different cityscape images. It allowed me to form a new approach to how I would generate a natural city as this looked very unnatural and random. However, this gave me a great insight on the city atmosphere looks likes and set the foundation for me to take this task further, thus helped me consider the missing elements (urban environment, unrealistic buildings, different roads and more) which allowed me to prepare a better strategy for my next attempt.


Generated City With Binary Space Partitioning

Moving on, after learning a bit of Binary Space Partitioning. I gave it a try, generating city buildings within the binary spaces created. As a result, The feel of a city looked much better as oppose to the first attempt where the buildings generated were positioned randomly. The buildings in this, are bit more compact and structured. This also shows that there’s a good possibility of having roads within the spaces around the buildings. This was the closest I have ever been to actually generate a city that looked a bit natural. However, the cube blocks (buildings) used had to be changed.


Procedurally Generated Buildings

This final illustration has much more realism as oppose to the earlier examples. The buildings used in this example came from the buildings generator script in the Procedurally Generated Buildings Example. This proved to be a great addition to the city, creating an atmosphere where one would undoubtedly guest this as being a city. The buildings are very significant in this example as they make the city look much more vibrant and realistic, though there are many other elements missing (roads, traffic lights, different types of buildings, urban and city environment….) for this to actually resemble a proper city.

Source files.