Let's talk about this again.
The problem with perlin noise is that it has a scale. You can create a quite nice terrain with it. But it has some limits.
Here you see a perlin noise terrain. Now imagine increasing the maximum hight/the amplitude. You would have steep cliffs all over, but no plain parts. When you scale it up in the other directions you would have a very smooth terrain with no detail, only big structures.
One alternative is fractal noise, but this has it's own problems.
On the first sight it looks much more like real terrain. And scaling up is no problem, you always have enough detail. But there are two issues:
- There is
to much detail. In reality there are not only high and rough mountains but flat and smooth plains too.
- It is generated by using several noised on different scales that are added together. Which means that you need more calculation.
Now I came up with two ideas. First one solves the first issue, second one is not producing a real fractal noise, but is better than plain perlin.
I tried to illustrate the fist one here. On the left there is perlin noise, middle is fractal noise, right is my idea.
The middle fractal noise is done by making the first perlin at one scale, the second at half the scale, third at 1/4 scale and so on. Then they are added together with a+b/2+c/4+d/8 and so on. This looks good, but in the game you only have up and downs, no plains.
So the right noise is done like the one above, but the noises are not added completely. Instead they are multiplied with another noise to define where they are added. Imagine a big sheet of paper. You can add rocks, gravel and sand on top of it, mix it all and you have normal fractal noise. Now take the paper and add the rocks according to some perlin noise, so somewhere there are more, on other places there are less, the same for gravel and sand. You then will have some areas with plain white paper, some with rocks and sand and some with only rocks and so on. So you have much more variety. And that is what we want. And this is what is done at the right picture.
It still needs a lot if fine-tuning. But it might be a function like this:
a +(c*(d/2-1))/2 +(e*(f/2-1))/3 +(g*(h/2-1))/4 +(i*(j/2-1))/5
Keep in mind that with every iteration the scale gets smaller. (The x/2-1 thing is only to reduce the influence and make the result look better, it is not necessary)
You can try it using gimp, some layers, masks and the noise-render.
As you can see in the function the number of noises needed is now double the times than the original fractal noise.
Here comes the second idea.
This shows a sinus curve (blue). When you take the y-values and do y^2-2 you will get a second curve that is one scale smaller but stays within the same values (-2 to +2 is what we get from the perlin noise), but is one scale smaller (red). Doing it again gives another scale smaller (yellow) and so on (green). When you now add them together you will get a resulting curve that has fractal properties. When using the same method on perlin noise you will have very cheep fractal noise by only generating one perlin noise. But there is a problem with this, it is no more as random as before, it has a certain look you will recognise.
Here we can combine the first and the second idea. We use two perlin noises, create some "sub-noises" with the describes methode and add them together with the formula above.
It could look like this:
a1 +(a2*(b1/2-1))/2 +(a3*(b2/2-1))/3 +(a4*(b3/2-1))/4 +(a5*(b4/2-1))/5
While a1 is the first perlin noise, a2 is a1^2-2, a3 is a2^2-2, the same for b.
I know that fractal noise like this is totally changing the mapgen of minetest. And the worlds will be awesome and mindblowing. I tried it using paramats
Land Up with only two iterations on a big scale. And the world it generates is absolute fantastic.
edit: picture fixed