# Perlin Noise for generating terrain in a 2D side-scrolling game. Is there a way to make variations in noise's amplitude?

For example if my generated levels look roughly like this:

But once in a while I would like to have the "amplitude" rise say 10 times than the rest of the level, so that it would look something like:

That is, once in a while there are deep "trenches" in the level. Now I know that my terrain's Y values are always between for example 200 and 1000 pixels. I there a way for them to mostly be in that range, but once in a while there is a drop to for example 10000 pixels?

Add another layer of noise to control the amplitude. Scale the noise up (on the X axis) to make the changes in amplitude gradual. Further, you can apply the amplitude changes in a exponential fashion. By applying them in this way, the difference in the noise values of .3 to .4 are not nearly as significant as the difference in the values .9 to 1. This strategy ensures that you do get some deep trenches, but you don't get them frequently.

Note that this method can easily be applied to also cause high mountains if desired.

• That sounds like a good solution. Just to clarify, what exactly do you mean when you say "add another layer of noise"? Another noise function that controls the amplitude of the original one? Sep 2 '13 at 20:55
• Correct. The new layer sits above the current noise and its output feeds into the input of your existing noise algorithm, supplying the amplitude. Sep 2 '13 at 21:00
• Agreed! A single Noise field is almost never used alone because it's nothing more than a mildly grumpy sampling over space. You get the most interesting results by using one noise source to modify another, just like @Byte56 is talking about. Sep 2 '13 at 22:22
• Nearly there. Scale the amplitude noise along the X axis to make the transitions more gradual. I should have been a little more specific in my original description that I was talking about the X axis. You do this by scaling the inputs to this noise function down. Sep 2 '13 at 23:57
• Ramping up the power should increase the amplitude, making the trenches lower. At this point I think you have the functions you need, and it's just a tweaking the numbers game. I've found in situations like this, it's interesting to put sliders in your game and change these values on-the-fly. See part of this answer about mixing noise for some other options. Sep 3 '13 at 2:12