Procedurally Generated Content: Week 3

This week I drastically improved my algorithm.  The island is now circular, hilly, and contains trees.

First, I identified issues in the algorithm that caused the landmass to form in a long, thin line.  I then added smoothing agents, which randomly smooth terrain in lines.  This gave the continent outline a more natural eroded appearance.

I then applied the Perlin noise algorithm to my terrain, adding hills and mountains in a seemingly random pattern.  This step was placed before the smoothing agents were created, allowing the agents to both smooth these hills and create cliff-like structures along the coast.

Perlin noise, described in my detail in my first PGC blog post, is often criticized for creating bland, uniform terrain.  Combining it with agents, however, ensured that the terrain was dynamic.

Perlin noise and smoothing agents added rolling hills
Perlin noise and smoothing agents added rolling hills
Refinements to the coastline agent algorithms and the addition of smoothing agents created much more interesting coastlines
Refinements to the coastline agent algorithms and the addition of smoothing agents created much more interesting coastlines

 

Lastly, I added trees, which were restricted to terrain with a y value greater than 1 (ensuring trees would not spawn on the sea floor) and terrain that was not too mountainous.

This island is generated in less than 5 seconds on a laptop running a 2012  Intel i5 quad-core processor.

Next week I will finish this generator by adding additional landscape features and more terrain textures.

The source code for this project is available on GitHub.

Unique landscape features made possible by Perlin noise and smoothing agents
Unique landscape features made possible by Perlin noise and smoothing agents
trees004
A bay created by coastline agents
Trees, restricted by altitude and terrain gradients
Trees, restricted by altitude and terrain gradients
Overview of the generated continent
Overview of the generated continent

Leave a Reply