[Help] Perlin Noise for 2d tile game

Hello all,
I am at the moment building a top-down 2d tile rpg like game. I am currently rendering from a set map defined in a seperate file. I would like to be able to generate a world so it looks realistic but generates fast and is easy to add to later (e.g. add more tiles later to generate in subsequent updates). I have heard of perlin noise generation, but would to know your advice and how i can use it

Max

Anyone?

Maybe you should change the title to:
[Help] Perlin Noise for 2d tile game

Anyhow, I hope this link helps you :slight_smile:

Thanks, I have done this but could not find how to actually apply it to generating tiles

On the http://mrl.nyu.edu/~perlin/noise/ source, when you run the method noise what do you do with the double it returns?

Done that :smiley:

:slight_smile:

Well, this link led me to this:

But I’m sure someone here knows a lot about this, let’s hope that with the new title experts come in :slight_smile: I’m also interested in this.

Thanks so much :slight_smile:

You’re welcome :slight_smile:

By the way, please share your progress, I’d like to know how you implement it :slight_smile:

Will do. Trying it out now :slight_smile:

I can generate noise now well , but I still can’t work out how to interpret it to generate biomes and terrain? Any ideas?

once you generate noise, you did 99% of the work, just loop the pixels and test for case

if(pixelValue > 0x888888)
place mountain
if(pixelValue < 0x888888)
place grass

Thats just a very basic way, there are many ways, just be creative

edit: for biomes if going from mountains to plains change your values
if(pixelValue > 0xEEEEEE)
place hill
if(pixelValue < 0xEEEEEE)
place grass

depending on your perlin noise generation, you may have to create multiple noises depending on the feature (trees)

height and trees would have to be seperate 2d noises, or you could do a 3d noise and make trees be the alpha, there is lots of ways

Thanks :smiley: