Skip to main content

Noise generator

Noise generator is another layout generator that you can use with Frigga. The main idea is that you define a noise function like Simplex or Perlin noise which generates a number between 0 and 1 for each cell in the level. To transform it into a level, you define mapping conditions which are used to compute how noise values are transformed into tiles. After all of that, the Theme engine is applied to the whole level.

The animation below shows how a specific greyscale noise with values from 0 to 1 can be transformed to and island level. The lighter the value, the higher we consider the cell to be and give it a sand or grass tile. For dark values, we consider them to have lower elevations and assign water tiles.

Animation of the noise generator - going from noise to tiles and back
Animation of the noise generator - going from noise to tiles and back

tip

The Noise generator is only responsible for generating the layout, while the Theme engine is here to make it look good by applying rules with actual tiles and game objects. The advantage of this approach is that we reuse the Theme engine for any number of layout generators.