Making maps with noise functions (2022)
Published on: 2025-06-08 03:32:42
written Jul 2015, then updated in 2016, 2017, 2018, 2019, 2020, and 2022
One of the more popular pages on my site is about polygonal map generation[1]. Making those maps was a lot of work. I didn’t start there. I started with something much simpler, which I’ll describe here. The simpler technique can make maps like this in under 50 lines of code: I’m not going to explain how to draw these maps; that’s going to depend on your language, graphics library, platform, etc. I’m only going to explain how to fill an array with height and biome map data.
Noise # A common way to generate 2D maps is to use a bandwidth-limited noise function, such as Simplex or Perlin noise, as a building block. This is what the noise function looks like: We assign each location on the map a number from 0.0 to 1.0. In this image, 0.0 is black and 1.0 is white. Here’s how to set the color at each grid location in C-like syntax: for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { double nx = x/widt
... Read full article.