Introduction

Instead of individual levels, you can generate entire worlds procedurally.

In this series, you’ll learn to create a shader-based world map with rivers and biomes. We will use GDScript to generate base data on the CPU and pass it to a shader to render the map using the graphics card.

A popular approach is to use Perlin noise or its newer and better alternative, simplex noise. Godot has built-in support for Open Simplex Noise. We’ll see how to use it in a complex procedural map generator.

Our algorithm works like so:

  1. We assign color codes to water and landmasses.
  2. For landmass, we compute color codes for biome types based on height, moisture, and heat maps.
  3. We include river paths that influence the moisture and height maps.

And here is the biomes legend we use to assign values to our landmasses:

It’s worth mentioning that this algorithm outputs more than images. You can use this approach to create playable worlds or levels, place cities and towns near rivers, add resources, and much more. You can build unlimited amounts of variations on top of this work to make it your own.

Tutorial objectives

You are going to learn:

Where to find the Godot project

You can find the final source code for this chapter in the WorldMap directory of the Godot project.

References

We took inspiration from the tutorial Procedurally Generating Wrapping World Maps in Unity C# to create this series.