2D map generation with domain-warped perlin noise

I've recently been working on a new game idea that would need procedurally-generated 2D outdoor maps. Here's some of what I've learned so far.

  1. Read through this guide to understand the basic idea of creating interesting maps with Perlin noise.
    Making maps with noise functions
  2. Watch this video where a dev on the No Man's Sky team talks about their approach to making maps
    GDC Vault - Building Worlds Using Math(s)
  3. The video describes this domain warping technique for getting better results with perlin
    Inigo Quilez :: fractals, computer graphics, mathematics, shaders, demoscene and more

Here's a brief summary:

  1. Build a perlin noise grid to act as your elevation model. I use perlin parameters that will have some "detail" and is kind of zoomed out.

  1. Build a perlin grid to represent moisture. For this one I want it to be more blobular

  1. Use a simple function to assign biomes based on elevation and moisture and then dump the map to the console using emojis

It's not too bad! We have a nice lake and some forests but it's very "perlin" in its interestingness. Let's introduce domain warping to the elevation map.



Definitely more interesting! The river-like features are what I especially like with this technique.

Here's the code to generate your own. Use it like this

import "mapgeneration"

compute_maps()
draw_maps()

mapgeneration.lua.zip (2.4 KB)

Have fun and please post your experiments!

7 Likes

Very cool!

Using the console and emojis like that is a great idea.

I wonder about different ways of dithering this. Ground patterns/textures have been one of the most ductility things to get right in my game.