The script is now released here.
The city is built based on a population map, which is a texture representing how populated (or rich) each area of the city is. On white pixels will stand higher buildings, and on black pixels, lower buildings. Below a gray level of 30%, no buildings will be created.
You can use any picture you like for the population map:
- draw it yourself: you can control where high buildings will be
- or use a procedural one: random placement of high and short buildings
Therefore you can greatly change the aspect of a city by modifying the parameters of the script, and also by changing the texture used for the population map.
The algorithm is simple: it iterates over the population map. For each pixel, it decides how many buildings are to be built for that pixel, their size and height, and their position. L-Systems are not used.
I designed the cities and buildings simply by observing pictures of real cities and buildings, and also by observing the results of another city engine by Mueller which I admire.
For now, buildings are simple cubes. Having detailed buildings such as those in the screenshot is possible, but not through the GUI yet. I am working on it for version 0.3.
The parameters are the following, from the bottom:
![http://lh3.ggpht.com/_NgXGR9y5w6o/SSbEYQSbjYI/AAAAAAAAAGk/oFkCR0P9H4A/s400/suicidator_city_engine_0.2_GUI.PNG](http://lh3.ggpht.com/_NgXGR9y5w6o/SSbEYQSbjYI/AAAAAAAAAGk/oFkCR0P9H4A/s400/suicidator_city_engine_0.2_GUI.PNG)
Pop map size
This is the size of the population map, and it directly affects the area covered by the city. It is the main way to increase visual complexity: simply generate a larger city.
![http://lh3.ggpht.com/_NgXGR9y5w6o/SSbLIPgwNnI/AAAAAAAAAGs/Uwd3Nt52gRk/s288/popMap20.png](http://lh3.ggpht.com/_NgXGR9y5w6o/SSbLIPgwNnI/AAAAAAAAAGs/Uwd3Nt52gRk/s288/popMap20.png)
![http://lh6.ggpht.com/_NgXGR9y5w6o/SSbLICnzsgI/AAAAAAAAAG0/xFZdqkSfjXc/s288/popMap30.png](http://lh6.ggpht.com/_NgXGR9y5w6o/SSbLICnzsgI/AAAAAAAAAG0/xFZdqkSfjXc/s288/popMap30.png)
Randomize pop map
Disable it if you use a custom population map.
If you are using a procedural texture, such as âstucciâ, you may want to keep the same type (eg stucci VS clouds) but change the layout. This is what this button is doing, by randomizing the texture offset.
Building height
If you want higher buildings, this is where you set it
Height difference
With this parameter, you can set whether short and tall buildings will have a great difference in height or not. This parameter may not always produce what you expect because it makes short buildings very short, and tall buildings very tall. So it may shorten most or all buildings to the minimum size if they do not reach a certain height before this parameter is applied.
You can increase the value of the âbuilding heightâ parameter (above) to reduce this negative effect.
![http://lh4.ggpht.com/_NgXGR9y5w6o/SSbP_FUxEII/AAAAAAAAAG8/cTNmToJ9aE4/s288/heightDiff3.png](http://lh4.ggpht.com/_NgXGR9y5w6o/SSbP_FUxEII/AAAAAAAAAG8/cTNmToJ9aE4/s288/heightDiff3.png)
![http://lh3.ggpht.com/_NgXGR9y5w6o/SSbP_GnQtFI/AAAAAAAAAHE/zfHq9MdkYhM/s288/heightDiff5.png](http://lh3.ggpht.com/_NgXGR9y5w6o/SSbP_GnQtFI/AAAAAAAAAHE/zfHq9MdkYhM/s288/heightDiff5.png)
Buildings per pixel
For each pixel of the population map, there may be more than one single building. The shorter a building, the more subdivisions. Here you control the probability of a building to be subdivided into many smaller ones.
![http://lh6.ggpht.com/_NgXGR9y5w6o/SSbR3CJvAhI/AAAAAAAAAHM/hlaeUAnz8bw/s288/buildPerPix0.png](http://lh6.ggpht.com/_NgXGR9y5w6o/SSbR3CJvAhI/AAAAAAAAAHM/hlaeUAnz8bw/s288/buildPerPix0.png)
![http://lh4.ggpht.com/_NgXGR9y5w6o/SSbR3NsFeCI/AAAAAAAAAHU/DJCrgj4rMkw/s288/buildPerPix10.png](http://lh4.ggpht.com/_NgXGR9y5w6o/SSbR3NsFeCI/AAAAAAAAAHU/DJCrgj4rMkw/s288/buildPerPix10.png)
Building loc variation
When a building is positioned, its horizontal locationn is varied randomly inside the area of its respective population map pixel, to make the city look less âgrid-likeâ. However, if you want the buildings to be more aligned, then decrease the value of this parameter. 0 means all buildings are aligned exactly on the population map.
![http://lh6.ggpht.com/_NgXGR9y5w6o/SSbVALBr6DI/AAAAAAAAAHc/Y1oOKhISfaM/s288/locVar0.png](http://lh6.ggpht.com/_NgXGR9y5w6o/SSbVALBr6DI/AAAAAAAAAHc/Y1oOKhISfaM/s288/locVar0.png)
![http://lh6.ggpht.com/_NgXGR9y5w6o/SSbVADSv8XI/AAAAAAAAAHk/26KklhV50mg/s288/locVar1.png](http://lh6.ggpht.com/_NgXGR9y5w6o/SSbVADSv8XI/AAAAAAAAAHk/26KklhV50mg/s288/locVar1.png)
Min/max hori size factor
You can control how thick or thin buildings are with this parameter. The minimum horizontal size factor is in Blender units. The maximum horizontal size factor is how many times a building can be larger than the minimum size.
![http://lh3.ggpht.com/_NgXGR9y5w6o/SSbWpgzS0DI/AAAAAAAAAHs/WEiHV5O6rM8/s288/size0.5-4.png](http://lh3.ggpht.com/_NgXGR9y5w6o/SSbWpgzS0DI/AAAAAAAAAHs/WEiHV5O6rM8/s288/size0.5-4.png)
![http://lh4.ggpht.com/_NgXGR9y5w6o/SSbWp0OiEFI/AAAAAAAAAH0/DHdbaVqmsBQ/s288/size1-4.png](http://lh4.ggpht.com/_NgXGR9y5w6o/SSbWp0OiEFI/AAAAAAAAAH0/DHdbaVqmsBQ/s288/size1-4.png)
Concerning all your comments
- I plan to have non-square buildings
- I plan to have networks of streets
- I plan to separate buildings faces into different materials (wall, roof)
- I plan to include illuminations for night scenes
But these are only ideas. They may or may not be implemented in the future.
May you encounter any bug, please report them on this thread. Version 0.3 with more parameters and complete buildings should come soon. And most importantly, thank you all for your encouragements!
A demo video here