Recently I've been fascinated with procedurally generated worlds. I wanted to try creating something similar to Minecraft, in which the player is placed in an infinite, procedurally generated environment that they are able to sculpt how they wish.
.png)
World Generation
The program was made in Unity. When a new world is created, the initial terrain data is generated using perlin noise. From this data, it then generates the 3D mesh using a Marching Cubes algorithm. Additionally, materials are assigned to each voxel using various rules - e.g. the topmost voxels are usually assigned grass, then below that is dirt, and even further below is stone. The material data is used to set the colour of each vertex.
After generating the terrain, natural features such as trees, rocks, grass, etc. are then dispersed. Another perlin noise map is used to determine the "fertility" of the soil. More fertile areas are more likely to spawn plants.
The world is procedurally generated as the player explores. The program regularly checks the player's location, and decides which chunks need to be loaded in. This means that each world is effectively infinite.
.png)
Weather and Time
The game features a day-night cycle, and dynamically changing weather.
Perlin noise is once again used to determine the strength and direction of wind, cloudiness, and whether or not it is raining at any given time.
Dynamic Audio
Sound effects were programmed using FMOD. I wanted to use audio in this project to create the impression of a living, tangible world.
One way that I set out to achieve this, is through dynamic reverb. The game will automatically detect when the player is in a cave by checking how enclosed they are from the outside. When the player is determined to be in a cave, reverb is applied to most sound effects, and the volume of outdoor ambience (birds, rain, crickets, etc.) is lowered.
Weather and time also affects the ambient sound. As night comes around, the sound of birdsong is slowly replaced with crickets chirping. When the wind is blowing strongly enough, you can hear it.