Page 1 of 1

Perlin Noise

Posted: Fri May 03, 2013 11:31 pm
by spynaz
How would I use the perlin noise to generate the tiles for my platformer?

Re: Perlin Noise

Posted: Sat May 04, 2013 5:26 am
by stampede247
Do you understand what perlin noise is? If not here is the wiki: http://en.wikipedia.org/wiki/Perlin_noise

If you do then let me say this. Perlin noise is often used for terrain generation and usually works best for something that is 3d so you can calculate the height and stuff. However there are some applications you could use it for a platformer I've seen. If you want to use perlin noise to generate sloping hills or something like it you could. It would be an example of 1 dimensional perlin noise. Also if you wanted the platformer to have like large bodies of blocks clustered together you could do that too with a 2-dimensional perlin noise.

If you want an actual example then I might be able to make one sometime tomorrow. However i think you might benefit a little more in seeing how perlin noise works and is generated which you can find many places on the web. Just look around would be my suggestion.

Hopefully this might help a bit to clear up some stuff. Maybe someone else will be able to explain more in depth the actual process of it.

Re: Perlin Noise

Posted: Sat May 04, 2013 9:55 am
by micha
spynaz wrote:How would I use the perlin noise to generate the tiles for my platformer?
Do you want to generate tiles (the graphics) or the map (information where to put which tile)?

Re: Perlin Noise

Posted: Sun May 05, 2013 2:40 am
by spynaz
stampede247 wrote:Do you understand what perlin noise is? If not here is the wiki: http://en.wikipedia.org/wiki/Perlin_noise

If you do then let me say this. Perlin noise is often used for terrain generation and usually works best for something that is 3d so you can calculate the height and stuff. However there are some applications you could use it for a platformer I've seen. If you want to use perlin noise to generate sloping hills or something like it you could. It would be an example of 1 dimensional perlin noise. Also if you wanted the platformer to have like large bodies of blocks clustered together you could do that too with a 2-dimensional perlin noise.

If you want an actual example then I might be able to make one sometime tomorrow. However i think you might benefit a little more in seeing how perlin noise works and is generated which you can find many places on the web. Just look around would be my suggestion.

Hopefully this might help a bit to clear up some stuff. Maybe someone else will be able to explain more in depth the actual process of it.
I would like a simple example. I have already searched around online quite a bit already. Also, what method would you recommend?
micha wrote:
spynaz wrote:How would I use the perlin noise to generate the tiles for my platformer?
Do you want to generate tiles (the graphics) or the map (information where to put which tile)?
I want to generate the map.

Re: Perlin Noise

Posted: Sun May 05, 2013 8:30 am
by Ragzouken
This is a very open question. You really need to work out what kind of maps you want to generate and work from there. There are lots of techniques and ways to combine them all, and each will give maps with different characteristics. Perlin noise is one technique but it may not be appropriate for what you are trying to do.

That said; if Perlin noise is really what you want then you could look at my community blogs post on using noise for pixel effects. It's not the application you want (you'll need to find a lua implementation of Perlin) but you can use the little demo programs to play around with the noise quickly, and get a feel for what it looks like.

Re: Perlin Noise

Posted: Sun May 05, 2013 11:37 am
by micha
Generating a level automatically is called "procedural generation".

If you are just starting to learn this, I suggest a really simple approach: Prepare some level parts (by hand) and combine them randomly. Each level part might be 20 tiles wide (or whatever). Let you game select some level parts randomly and just put them next to each other.
This is the simplest approach I know. It has the advantage, that each individual part is adapted to your game mechanics (since you prepared it yourself) and you can guarantee that each part is doable.

This, of course, has nothing to do with perlin noise.

Re: Perlin Noise

Posted: Sun May 05, 2013 2:35 pm
by spynaz
Ragzouken wrote:This is a very open question. You really need to work out what kind of maps you want to generate and work from there. There are lots of techniques and ways to combine them all, and each will give maps with different characteristics. Perlin noise is one technique but it may not be appropriate for what you are trying to do.

That said; if Perlin noise is really what you want then you could look at my community blogs post on using noise for pixel effects. It's not the application you want (you'll need to find a lua implementation of Perlin) but you can use the little demo programs to play around with the noise quickly, and get a feel for what it looks like.
Ok, thanks.

Re: Perlin Noise

Posted: Sun May 05, 2013 4:40 pm
by spynaz
micha wrote:Generating a level automatically is called "procedural generation".

If you are just starting to learn this, I suggest a really simple approach: Prepare some level parts (by hand) and combine them randomly. Each level part might be 20 tiles wide (or whatever). Let you game select some level parts randomly and just put them next to each other.
This is the simplest approach I know. It has the advantage, that each individual part is adapted to your game mechanics (since you prepared it yourself) and you can guarantee that each part is doable.

This, of course, has nothing to do with perlin noise.
I need to generate terrain though.