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.
- Read through this guide to understand the basic idea of creating interesting maps with Perlin noise.
Making maps with noise functions - Watch this video where a dev on the No Man's Sky team talks about their approach to making maps
https://www.gdcvault.com/play/1024514/Building-Worlds-Using - The video describes this domain warping technique for getting better results with perlin
Inigo Quilez :: computer graphics, mathematics, shaders, fractals, demoscene and more
Here's a brief summary:
- 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.
- Build a perlin grid to represent moisture. For this one I want it to be more blobular
- 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!