How Computers Draw Maps

Fantasy kingdoms, sprawling cities, whole coastlines. A computer can invent them all from a handful of dots.

1

Every Map Starts as Dots

A map generator does not begin with mountains or cities. It begins with random dots scattered across an empty space. Press scatter a few times. Each dot is a seed the whole world will grow from.

Just random points. Hard to believe a world hides in here.
Why dots

Random dots give the map its irregular, natural feel. If the seeds were on a perfect grid, every kingdom would be a boring square. Randomness is what makes it look hand-drawn.

2

Give Every Spot Its Nearest Dot

Here is the magic. Color every point on the map by whichever dot is closest to it. Suddenly the blank space breaks into organic regions, like provinces or biomes. Click the map to drop a new dot and watch the regions rearrange.

Each color is one dot's territory. This is a Voronoi diagram.
Name to know

These nearest-point regions are named after mathematician Georgy Voronoy. The Fantasy Map Generator builds its entire world on them: every province, forest, and county is a Voronoi cell.

3

Flood It to Make Coastlines

Give every region a height, then raise the sea. Regions below the waterline turn to ocean; the rest stay land. A ragged, believable coastline appears, and nobody drew a single line of it. Slide the sea up and down.

Sea Lowland Hills Peaks
Low regions flood, high regions stay dry. That edge is a coastline.
The trick

Because regions are irregular Voronoi cells, the coastline is jagged and natural, full of bays and peninsulas. A simple grid would give you ugly staircase coasts.

4

Add Cities, Then Roads

Last, bring it to life with rules. Cities like to sit on land near the water, so drop towns there. Then link each city to its nearest neighbor with a road. Build it up step by step.

Start with the land, then place cities, then connect them.
Fun fact

The City Map Generator uses a related idea for streets: it grows roads along invisible flow lines, then fills the blocks with buildings, the same way real cities sprawl outward from a center.

Cartographer!

You watched a map build itself: dots became regions, regions split into land and sea, and cities linked up by roads. This is procedural map generation, the trick behind endless fantasy worlds and city maps. Now go generate your own.

0
Maps Drawn
0
Regions Made
0
Time Exploring

Maps Start as Dots

Scatter random points across a blank space. Those seeds are the skeleton of the whole map.

Nearest-Point Regions

Give every spot to its closest dot and organic regions appear. This is a Voronoi diagram, the backbone of fantasy maps.

Height Makes Coastlines

Give each region a height and flood the low ones. A coastline emerges without anyone drawing it.

Cities and Roads by Rules

Place towns where the rules say (on land, near water), then connect the nearest ones with roads. A living map.

Ready to Create?

Put your new knowledge into practice!

Suggest a Correction