Postmortem


Underlying all of the city generation is a perlin noise algorithm that lets me tune the weights in the Unity inspector tab. Through organizing all of the different building heights into different height bands (low, medium, tall, super-tall) I can weigh how much of each height band appears in the city while also controlling how grouped up or spread out they are. When I first made the city generation algorithm, the city felt too dense and small given the high poly count of around 10,000 polys for each prefab. To make the most out of the city's scale, I added a noise control variable to shape how much the city sprawls out versus how much the city congregates within itself. 


The most basic rules of my generative aspects of the city are:

1. Buildings should be next to buildings in similar height or adjacent height band (tall buildings should be next to the tallest medium buildings etc..)

2. Road edges should all connect to the roots of other road segments

3. Grow in height as the player moves

4. Decay in height as the player stagnates

All the generated objects have box colliders,  height variable, height band variable, and final form height stored within it. The height variables are needed to properly iterate through all of the models. While the height band variable is used for the macro-generation of the city. The final form height is basically the initial output of the Perlin noise algorithm stored to handle player movement growth.

The constraints of my generator are the unique city limits and height weights created every generation. Another constraint for the city's growth is the player's engagement, as in, if the player doesn't play and sits still the city will decay. When the player is moving and creating activity within the game, the city will simultaneously grow as well. 

The results of my generator are consistent in the way that it always works about the same every generation. Its inconsistent in the way that it generates a unique experience and city every time.

If I were to continue working on this project, I would try to change the user's movement system to the web-slinging seen in the Spiderman video games. The addition of NPCs and traffic would also help to make the city feel more alive. I would also like to simplify the polygon count of the prefabs into having less than 1000 polygons per model so I can support cities 10x larger than the ones I've been able to generate.

My experience has mixed autonomy, since there are 4 periphery cities that are automatically generated however, the main city is generated dependent on the user's actions and movements. 

Files

FlyCityWeb.zip Play in browser
56 days ago

Leave a comment

Log in with itch.io to leave a comment.