Tuesday, May 2, 2023

How I Learned Procedural Generation [VIDEO SUMMARY]

In the video "How I Learned Procedural Generation" published by Lejynn, the creator shares their journey of learning procedural generation techniques for creating more polished and visually appealing games. The video covers topics such as mesh generation, terrain generation using Perlin noise, and various methods for adding textures, shading, and objects to the environment.


Lejynn begins by discussing their initial focus on mesh generation, which was achieved using Brackis' video tutorials. After three days, the creator was able to generate meshes of any size needed, using the code shown in the video. To make the terrain look more natural, they used Perlin noise, an algorithm created by Ken Perlin for generating natural-looking textures and terrain. The creator explains, "I can use Perlin noise multiplied by an amplitude to procedurally generate the height of my terrain."

To gain more control over the environment, Lejynn found a tutorial series by Sebastian Lague, which covered various advanced techniques for procedural generation. The creator incorporated two of the simpler concepts from this series: fine-tuning the noise and multiplying the Perlin noise with a falloff map to create islands. They also fixed an issue with the falloff map that occurred in the tutorial series.

Next, the creator tackled the challenge of coloring the terrain. They spent a week or two trying to recreate the style shown in Sebastian Lague's intro, which featured nicely rounded edges. Although they experimented with increasing the number of sample points in the texture, they still encountered the problem of visible individual pixels. Eventually, they turned to shaders to achieve the desired effect. After a few hours of experimentation, they created a satisfactory shader that produced the desired results.

To further enhance the environment, Lejynn found tutorials on creating a gradient skybox, a cloud shader, and stylized water. They then moved on to adding vegetation to the terrain. Using Blender, they created a simple tree model and implemented a prefab spawner script, inspired by a video from Jonas Tyroller, to randomly place trees and other objects on the terrain.

To bring the grass to life, Lejynn found a video tutorial for creating a grass texture and used Blender to create planes for displaying the grass in Unity. They reused the prefab spawner script to spawn grass around the island and added a sway effect to make the grass move realistically.

Finally, the creator imported their FPS controller from a previous project to explore the procedurally generated island. They expressed satisfaction with the polished look of the game, including the sky, water, and FPS movements, and noted that the island could serve as an interesting setting for multiplayer battles.

In conclusion, Lejynn's video demonstrates their learning process and the various techniques they applied to create a procedurally generated game environment. The creator plans to continue working on this tool in future videos and believes that the skills they've acquired will be valuable for any future games they develop.