Search code examples
pythonpygletterrainperlin-noise

How to make a 2d map with perlin noise python


I have been experimenting on making a random map for a top down RPG I am making in Python. (and Pyglet) So far I have been making island by starting at 0,0 and going in a random direction 500 times (x+=32 or y -=32 sort of thing) However this doesn't look like a real image very much so I had a look at the Perlin Noise approach. How would I get a randomly generated map out of this :/ (preferably an island) and is it better than the random direction method?


Solution

  • a perlin map can be generated easily.... it is simply a 2d array of values (typically 0 - 255) you just need to pick a threshold (say 126) anthing higher than that and render your land square. otherwise render water

    something like this may help http://simblob.blogspot.com/2010/01/simple-map-generation.html