Search This Blog

Tuesday, April 12, 2016

Perlin Noise and world generation

In the video game world, there is one formula which is used a lot while trying to generate procedural worlds: Perlin Noise.

Perlin Noise is basically function which returns a value between -1 and 1 for a given X,Y coordinate. Whatever coordinate you will give it will always return a value and if you call it back later on it should return the same value again for a given set of coordinate.

This function allows to generate terrains, where from -1 to 0 for example it would be the sea and whatever is above 0 will have an terrain height.

It works for 3D worlds but for 2D worlds it works just as fine, as you could change the tile based on the value the perlin noise returns.

I'm surprised how few developers I know actually know what this function is, it doesn't mean it is not know, actually it's one of the most used one in the game dev and you can find loads of tutorials and articles like this nice one here:

http://devmag.org.za/2009/04/25/perlin-noise/

Guess what? I will use perlin noise as well for my hobby project Stay tuned to see the results ;)

No comments:

Post a Comment