top of page

Procedural neon city generator

ezgif.com-gif-maker (5).gif

Road generator

​

To generate this city, I needed to get a foundation first, thus the road system. The road system randomly chooses to spawn either 1, 2, or 3 roads (in their appropriate directions). They can have a randomizer on the angle. Before the road spawns it checks in a given radius if there is already an end/start point of a road, if so, it snaps to that point. This makes sure that the roads don't overlap each other too much and create a cobweb. The further away the roads are from the start point, the less chance they have on spawning another road segment.
 

Building generator

​

With the road foundation done, the next step is to spawn buildings. The buildings exist out of 3 parts, foundation, middle, and roof. The foundation is placed along the road with an offset, as long as it does not collide with another road or building foundation. Once the foundation is placed it will build all the middle segments, and finally, put the roof on top.

Someone can easily add more buildings to the generator since the buildings are scriptable objects. They can add multiple foundations, middle parts, and roofs to the scriptable object, this makes sure it just picks 1 randomly from the list for each component.
 

ezgif.com-gif-maker (4).gif
Houses1.0.png

City generator

​

Originally all houses would spawn to the same height, this was not realistic, but a random value wouldn't make it real either. So I created a formula that influences the building height dynamically. Normally in cities, you will see higher buildings in the center, and the further away you get the lower the buildings get, and the formula replicates this.

To add a bit of flair to the city, I added the commonly used neon advertisement boards to the city. These spawn randomly alongside buildings and do not clip through buildings.

 

Houses1.4.png
Houses1.6.png
Houses1.2.png
bottom of page