Procedural 3D City Generator

Project Overview
In this project, various techniques for procedural city generation and mesh generation have been studied and applied with the goal of creating a tool in Unity 3D that allows the user to create and modify a city. Additionally, the project includes secondary tools for the road and building generation using Splines.

___________________________________

___________________________________

Roads & Intersections
For the roads, a spline has been used to define the shape, and triangles are generated along the spline based on a given resolution and width. Additionally, a material can be added that tiles and adapts to the shape of the road. There are two ways to generate intersections:

1. By distance. If a start or end point is very close to another, an intersection will be generated.

2. By index. If two roads have the same intersection index, one will be created. Each start and end point of the road has an index that can be modified from the inspector.

___________________________________

City Layout
The city layout consists of two different types of roads: main roads and secondary roads.

For the main roads, the city's area is created with a spline, and once this is done, the user can define the number of main roads, which will automatically be distributed throughout the area.

For the secondary roads, the L-System algorithm has been used, which, together with a series of rules, is capable of generating a road network that is confined within the city's area.

___________________________________

Building
The generation of buildings consists of a spline that defines the area of the building. From there, an algorithm chooses the modular assets to place in each spot and the scale they should have so that they fit perfectly within the building's area. It already has a list of assets, and if desired, more can be added.

There are two ways to define the building's height:

    1. With a public int variable in the inspector. This option is ideal if         you only need to create one or a few buildings.

    2. By modeling terrain and taking the height of the terrain at the         x, z position where the building is located. This option is ideal if         you need to create many buildings.

___________________________________

Future Plans
For future plans, the following will be added:

- Improve the road network generation

- A system to adapt the city to the terrain so that they are not always flat.

- A highway system that runs above the city.

- A system for creating parks and rivers.