Resource placement on a map

 from Red Blob Games
9 Sep 2017

In my map generator tutorials I generally don’t include resources like wood, stone, iron, and so on. These are specific to each game so I leave them out. This page has some experiments. It’s a quick & dirty experiment so it’s not polished; I wanted to see if I could get some interesting shapes.

Let’s start with basic simplex/perlin noise. The wavelength tells us how often values change, and persistence[1] tells us how much detail gets added:

Let’s highlight some values of the noise function, where bandvalue - bandwidth/2 ≤ noisevalue ≤ bandvalue + bandwidth/2. Think “contour lines” but these are bands instead of lines:

Here’s an example of iron ore patches, built by taking a blobby band and intersecting it with the elevation. The persistence parameter controls whether there’s one large patch or if it’s many small patches in the same area. Move the mouse around the image to get different shapes:

Here’s an example of gold veins, built by taking the union of two veiny bands and intersecting it with a blobby band and also intersecting it with the elevation. Move the mouse around the image to get different shapes:

There’s a lot more to explore here but this quick experiment seemed promising for getting the “veiny” shapes I was looking for.

Quick & dirty code: resource-placement.js

Email me , or tweet @redblobgames, or comment: