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?
Answer
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.
No comments:
Post a Comment