Page 1 of 1

fractal/multi-scale mapgernator

PostPosted: Thu Sep 13, 2012 19:28
by Casimir
Look at those Multi Scale Turing Patterns.
The interesting thing on this is that it produces large patterns and a great variety in those patterns, you have order and chaos.
When you look at a minetest map it seems very random. You have small patches that have nothing much to do with those next by. There are lakes but no oceans, mountains but no alps, some flat areas but no great plains. I think, with a multi scale mapgenerator you will have all of those and really mindblowing maps that look much more realistic that have more structure. Just try to imagine it.

PostPosted: Thu Sep 13, 2012 21:49
by Phitherek_
+1

PostPosted: Fri Sep 14, 2012 12:47
by PilzAdam
+1

PostPosted: Fri Sep 14, 2012 15:35
by sfan5
+1

PostPosted: Fri Sep 14, 2012 15:50
by Jordach
-3 - I dislike that crossing design. Something more realistic is needed, and controllability VIA, LUA.

PostPosted: Sat Sep 15, 2012 06:26
by NakedFury
Ingame map generation control.

Much like how other games let the player move sliders and bars to control map generations, the future of maps also needs to allow the players this ability.

Sliders:
Smooth------------Rough
Low Mountains--------------------Ridiculous Mountains (Altitude)
Something here--------------------Something there

Checks:
Terrain Types(Snow, Desert, Oceans, Rivers, etc)
Etc

PostPosted: Sat Sep 15, 2012 08:28
by PilzAdam
NakedFury wrote:Ingame map generation control.

Much like how other games let the player move sliders and bars to control map generations, the future of maps also needs to allow the players this ability.

Sliders:
Smooth------------Rough
Low Mountains--------------------Ridiculous Mountains (Altitude)
Something here--------------------Something there

Checks:
Terrain Types(Snow, Desert, Oceans, Rivers, etc)
Etc

That would be the "nec plus ultra"!

PostPosted: Sat Sep 15, 2012 10:53
by wokste
As far as I remember, in minecraft there are 2 perlinnoises (wetness and temperature). From this, the biomes are chosen. If we have this, we can have multiple biomes in a natural way. (no deserd near a polar region for example)

PostPosted: Wed Sep 19, 2012 19:25
by Iqualfragile
i dont think that those patterns would be the right choice, especaly as im not shure if a continous generation of landscape would be possible.
i do think the perlin-noise needs some fine-tuning (or, as mentioned some cool system like biomes but it would not be as easy as that as we have a f*ng gigantic map and it would be great to have some sky- or cave biomes.

that task actualy sounds quite interesting, im thinking about trying it myself…

PostPosted: Thu Sep 20, 2012 11:21
by Casimir
I admit, the video was a bad example, so it lead to some misunderstanding. What I wanted to show was the fractal-like behaviour. A Turing machine and perlin noise are two different things.
What I wanted to say is that with fractal (perlin) noise, the terrain would look more natural.
On wikipedia there are two pictures. One of perlin noise,
https://upload.wikimedia.org/wikipedia/commons/d/da/Perlin_noise.jpg
and one of fractal noise.
https://upload.wikimedia.org/wikipedia/en/e/e5/Perlin.png

Now take a look at a minetest map, it looks just like the first one (because it is generated this way). Now imagine that the picture represents the hight of the map, with white the highest points, black the deepest. You can't get high mountains this way, because there would be a lot of high mountains and no "normal" terrain left. You could scale it up, but then the terrain would be smooth and boring.
The second picture looks more like nature. In this one there are high mountains, but the terrain is still textured and interesting, no matter how deep you zoom in.

PostPosted: Thu Oct 04, 2012 00:01
by lord_james
NakedFury wrote:Ingame map generation control.

Much like how other games let the player move sliders and bars to control map generations, the future of maps also needs to allow the players this ability.

Sliders:
Smooth------------Rough
Low Mountains--------------------Ridiculous Mountains (Altitude)
Something here--------------------Something there

Checks:
Terrain Types(Snow, Desert, Oceans, Rivers, etc)
Etc

And flat land check!

PostPosted: Tue Dec 18, 2012 21:22
by Casimir
Found something in C++:
https://github.com/memo/msalibs/tree/master/MSAPerlin/src

The person who made it says this includes perlin and fractal noise.

I don't know much about programming, and I don't have the time, but if anyone things it would be a good idea to include it, then try it. I'm very curious what the worlds would look like.

(I can't stop thinking of it, every time I reach the top of a mountain just 42 blocks high.)

PostPosted: Wed Dec 19, 2012 06:30
by madarexxx
NakedFury wrote:Ingame map generation control.

Much like how other games let the player move sliders and bars to control map generations, the future of maps also needs to allow the players this ability.

Sliders:
Smooth------------Rough
Low Mountains--------------------Ridiculous Mountains (Altitude)
Something here--------------------Something there

Checks:
Terrain Types(Snow, Desert, Oceans, Rivers, etc)
Etc



+100500 it will be awesome - flat world with big hills for creative!

PostPosted: Wed Dec 19, 2012 10:50
by jojoa1997
I would have room to build my metropolis.

PostPosted: Sun Jan 27, 2013 19:05
by Casimir
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.
Image
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.
Image
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.
Image
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.
Image
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

PostPosted: Mon Jan 28, 2013 01:23
by madarexxx
wow so serious work! very long',hard to read , can't see last picture, but sounds just amazing - we will have different landshafts! high mountains and flat places for houses! thanks for hard work

PostPosted: Mon Jan 28, 2013 01:51
by paramat
Thanks for the post Casimir.
EDIT Okay now understand this, interesting method.

PostPosted: Mon Jan 28, 2013 20:23
by jin_xi
http://dev.minetest.net/Mapgen

looks like minetest now can support multiple mapgens

PostPosted: Mon Jan 28, 2013 22:56
by proller
idea: scale and amplitude depends on distancse from center -
on spawn point terrain like current, but walk 10-20km and enjoy Great mountains, oceans and big caves
..and very strong mobs too 8-)

PostPosted: Fri Feb 08, 2013 10:57
by madarexxx
paramat, OMFG! Upper picture is just AWESOME!!!

PostPosted: Fri Feb 08, 2013 12:04
by Traxie21
Needs more variation in height and size for the mountains, but otherwise, EPIC

PostPosted: Fri Feb 22, 2013 01:15
by prestidigitator
Most CGI "fractal noise" is just the combination of multiple noise functions (e.g. Perlin or simplex noise) with different amplitudes and frequencies/wavelengths. Note that you could certainly also use a secondary long-wavelength noise function to control the blending, reducing the amplitude of high-frequency terms over large stretches in order to create smoother regions.