Main scene view

Tool in Unity

General information
GitHub
Click here to go to the GitHub page of the project.
If the link doesn't work, try the full one: https://github.com/MauritsDijkman/ProceduralArt.
​​​​​​​
Development time
Spread over 6 weeks
Project information
Assignment
For the course 'Procedural Art', I had to make an Unity scene where I would try to recreate an area of a certain game. I chose GTA V with the Emissary area. The module was mainly focused on the customizability and control and the ability to change values in the editor and to be able to (re)generate certain parts of the area. During this course you could focus on the coding part of the artistic part of the city. I chose to maily focus on the coding part and do a little bit of artistic work.

Usability
I created four different house structures and methods. All four houses are used in the city. The 3D models from the city and houses use LOD's.
When the code is executed,  it will first create a city grid with roads. You can indicate how big the city needs to be and what the size of the roads are. When the city grid is created, the foundations for the buildings is created. If the foundation is big enough, trees or city lights will be spawned. After that, the buildings are placed on the foundations. The type of building is random selected with the spawn chance given by the user.
If you want, you can just drag the prefab of a building into a scene and generate that building type on the position of the prefab.

Flat

Flat
The flat can have different 'profiles'. These profiles contain the building info, such as info/values about the height, roof, wall textures, row textures and airco units.
You can indicate the width and height of the building and can give different profiles. The code will random choose a profile when there is more than 1.
The walls are created and UV'd by meshes and vertices through code.

Gab building /  The Emissary

Gab building / The Emissary
This building is inspired by the 'Emissary' building from Grand Theft Auto.
The building has several 'rows' which can be indicated with a certain amount and percentage value.
This building also can have different profiles. These profiles contain info/variables about the height, rows, row depth, ground level, roof, wall textures, roof textures, building direction and airco units.
The code chooses a random profile if there is more than 1.
The rows can be even or odd. You can also indicate if the ground level should always say squared or if it should have the same rows as the layers on top.
The walls are created and UV'd by meshes and vertices through code.

Skyscraper

Skyscraper
The building of the skyscraper is done a whole different way in comparison with the previous two buildings. Where the previous two building where created with meshed created from code, this building actually places 3D models in the scene. Each wall and roof is created and placed by the code. Each building is different, because the continue change of the walls and roof are random.
You can give the code the continue change of the walls and the roof. The code will take these values and will use them in the placement calculation.
You can give this building little info, only the width, depth, continue changes and the different models for the walls and roof. If you select multiple walls or roofs, the code will pick random between those.

Square building

Square building
This building was an experimental one, it is the first version of the skyscraper. The structure of the building is different then the skyscraper, because it has a certain structure in the design. The outer walls are clean and the wall between them have windows.
You can indicate the width, depth, height, wall style and roof style.
The code takes the first wall model and uses that one for the outer walls. The other models are used for the wall in between the outer walls. The roof models are randomly selected.
What did I learn?
- How to use editor scripting in Unity
- How to generate meshes from vertexes and triangles
- How to automatically UV the generated meshed
- Creating a coding structure that generates a whole city
- How to efficiently reuse with different variable values
- How to create materials in Substance Designer
- How to customize and change values from the materials made in Substance Designer

How can I use it?
The Unity project is available on GitHub. Feel free to use the code, but only under the precondition that Maurits Dijkman is credited.

Other projects