Post your mapgen questions here (modding or engine)

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Thu Aug 04, 2016 17:24

I found my mountains. This screenshot isn't half of that. It is gigantic.

And the magic parameter is lunarity. If I set it to 3 I get this beautiful surface

Image

If you want to visit this place, here is the map_meta.txt

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
chunksize = 5
mg_biome_np_heat = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 50
   persistence = 0.5
   scale = 50
   seed = 5349
   spread = (750,750,750)
}
mg_biome_np_heat_blend = {
   flags = defaults
   lacunarity = 2
   octaves = 2
   offset = 0
   persistence = 1
   scale = 1.5
   seed = 13
   spread = (8,8,8)
}
mg_biome_np_humidity = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 50
   persistence = 0.5
   scale = 50
   seed = 842
   spread = (750,750,750)
}
mg_biome_np_humidity_blend = {
   flags = defaults
   lacunarity = 2
   octaves = 2
   offset = 0
   persistence = 1
   scale = 1.5
   seed = 90003
   spread = (8,8,8)
}
mg_flags = trees, nocaves, nodungeons, noflat, light, decorations
mg_name = v7
mgv7_cave_width = 0.2
mgv7_np_cave1 = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 0
   persistence = 0.5
   scale = 12
   seed = 52534
   spread = (61,61,61)
}
mgv7_np_cave2 = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 0
   persistence = 0.5
   scale = 12
   seed = 10325
   spread = (67,67,67)
}
mgv7_np_filler_depth = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 0
   persistence = 0.7
   scale = 1.2
   seed = 261
   spread = (150,150,150)
}
mgv7_np_height_select = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 1
   persistence = 0.6
   scale = 4
   seed = 7244
   spread = (600,600,600)
}
mgv7_np_mount_height = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 256
   persistence = 0.6
   scale = 112
   seed = 72449
   spread = (1000,1000,1000)
}
mgv7_np_mountain = {
   flags = eased
   lacunarity = 3
   octaves = 5
   offset = -0.6
   persistence = 0.3
   scale = 1.4
   seed = 5333
   spread = (250,350,250)
}
mgv7_np_ridge = {
   flags = defaults
   lacunarity = 2
   octaves = 4
   offset = 0
   persistence = 0.75
   scale = 1
   seed = 6467
   spread = (100,100,100)
}
mgv7_np_ridge_uwater = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 0
   persistence = 0.6
   scale = 1
   seed = 85039
   spread = (1000,1000,1000)
}
mgv7_np_terrain_alt = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 0
   persistence = 0.6
   scale = 10
   seed = 5934
   spread = (600,600,600)
}
mgv7_np_terrain_base = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 0
   persistence = 0.6
   scale = 10
   seed = 82341
   spread = (600,600,600)
}
mgv7_np_terrain_persist = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 0.6
   persistence = 0.6
   scale = 0.1
   seed = 539
   spread = (2000,2000,2000)
}
mgv7_spflags = mountains, ridges
seed = 10451164194390179830
water_level = 1
[end_of_params]
Attachments
Bildschirmfoto vom 2016-08-04 19-15-58.jpg
Bildschirmfoto vom 2016-08-04 19-15-58.jpg (410.85 KiB) Viewed 5228 times
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Fri Aug 05, 2016 08:28

Another question. I want to make realistic lakes/ponds. Any idea how to make them?

Image
Attachments
Bildschirmfoto vom 2016-08-05 08-25-04.jpg
Bildschirmfoto vom 2016-08-05 08-25-04.jpg (80.42 KiB) Viewed 5228 times
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Fri Aug 05, 2016 14:22

> Now most mountains have a gentle smoothed side an a totally insane side

The insane sections are caused by rivers, anything above the river is cut away with 3D noise.

It's lacunarity not lunarity :] this is the ratio of the scales of variation of adjacent octaves.
Standard lacunarity is 2.0, where each additional octave creates variation on a scale 1/2 that of the previous octave (which is why they're called octaves, it's analogous to musical octaves which is a doubling of frequency).

Lacunarity 3.0 means that if the 'spread' (the scale of variation of octave 1) is 900 nodes, then the 2nd octave creates variation on a scale of 300 nodes, the 3rd octave 100 nodes etc. It's a way to get a wider range of detail with the same number of octaves. it also has a different character.
 

ozkur
Member
 
Posts: 180
Joined: Wed Oct 07, 2015 20:59
In-game: ozkur or XoRoUZ

Re: Post your mapgen questions here (modding or engine)

by ozkur » Fri Aug 05, 2016 17:53

where could i get this?
Biplanes! 'Nuff said

I am a native English speaker, Ich spreche kein Deuscht, mais je parle un pue français.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your mapgen questions here (modding or engine)

by TumeniNodes » Sat Aug 06, 2016 03:10

Okay paramat, here are the results of my tinkering so far : )
I'm loving this. I need to tweak the river-bank setting yet.
I still think adding ridges to mgflat would be great... if the ridges used the same simplistic setting for sloping and width, could be ummmmm... mg V8? :P

Anyway, here are some results

Image

Image

Image
just a little fun with this one :D

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
mg_flags = notrees, nocaves, nodungeons, noflat, light, nodecorations

mgv7_np_height_select = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 1
   persistence = 0.6
   scale = 4
   seed = 7244
   spread = (600,600,600)
}
mgv7_np_mount_height = {
   flags = defaults
   lacunarity = 1
   octaves = 2
   offset = 120
   persistence = 0.3
   scale = 60
   seed = 72449
   spread = (1000,1000,1000)
}
mgv7_np_mountain = {
   flags = eased
   lacunarity = 2
   octaves = 4
   offset = -0.3
   persistence = 0.4
   scale = 1
   seed = 5333
   spread = (250,350,250)
}
mgv7_np_ridge = {
   flags = defaults
   lacunarity = 2
   octaves = 4
   offset = 0
   persistence = 0.75
   scale = 1
   seed = 6467
   spread = (100,100,100)
}
mgv7_np_ridge_uwater = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 0
   persistence = 0.6
   scale = 1
   seed = 85039
   spread = (1000,1000,1000)
}
mgv7_np_terrain_alt = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = -23
   persistence = 0.6
   scale = 11
   seed = 5934
   spread = (600,600,600)
}
mgv7_np_terrain_base = {
   flags = eased
   lacunarity = 1
   octaves = 2
   offset = 24
   persistence = 0.6
   scale = 0
   seed = 82341
   spread = (600,600,600)
}
mgv7_np_terrain_persist = {
   flags = defaults
   lacunarity = 2
   octaves = 3
   offset = 0.6
   persistence = 0.6
   scale = 0
   seed = 539
   spread = (2000,2000,2000)
}
mgv7_spflags = mountains, ridges
seed = 5623940581441649840
water_level = 1
[end_of_params]
Attachments
V7 flat03.png
V7 flat03.png (391.42 KiB) Viewed 5228 times
V7 flat02.png
V7 flat02.png (402.55 KiB) Viewed 5228 times
V7 flat01.png
V7 flat01.png (585.24 KiB) Viewed 5228 times
Flick?... Flick who?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Mon Aug 08, 2016 03:20

TumeniNodes,

My noise for seabed (terrain alt) may be a little too deep at a centre value (offset) of y = -23.

For less steep coast/beach divide the offset and scale of height_select by the same amount, for example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
mgv7_np_height_select = {
   flags = defaults
   lacunarity = 2
   octaves = 5
   offset = 0.5
   persistence = 0.6
   scale = 2
   seed = 7244
   spread = (600,600,600)
}

scale must remain 4 * offset though to keep your preferred ration of lakes to land.
Last edited by paramat on Mon Aug 08, 2016 03:23, edited 1 time in total.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Mon Aug 08, 2016 03:22

burli,

Realistic in what way? Size, shape or decorations? Remember it's impossible to decide in code if a body of water is part of a large ocean or part of a small pool.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Mon Aug 08, 2016 03:25

ozkur,

Get what?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Mon Aug 08, 2016 03:49

burli,

> Can you briefly explain the parameters so that i can tinker around?

For mgv7:

2D noises:

terrain_base/alt:
These 2D noises define terrain height for everything except mountains.
Each noise defines a smooth rolling surface, it is the 'height select' noise that then selects which terrain is used at a point.
Confusingly, 'base' is the high terrain at the top of cliffs and 'alt' is the typically lower terrain that creates the seabed, beaches and low hills.
If cliff terrain is below lower terrain then low terrain is used. Cliff terrain is the more rare terrain by default and you can see it rising up out of the lower terrain.

height_select:
This switches between terrains as the noise valuse crosses the range 0 to 1. Boosting the 'scale' boosts cliff steepness. 'offset' controls what proportion of terrain is cliff terrain.

terrain_persist:
Controls the persistence value (terrain roughness) of 'terrain_base' and 'terrain_alt'. 0.6 is a medium-rough value, 0.4 is smoother.

ridge_uwater:
This creates the large scale course of the river, 'spread' is the overall scale of the river pattern, 'persist' is the twistyness of the river, 'octaves' the number of levels of detail in the river course structure.

mount_height:
Controls and varies typical mountain height in nodes over large distances.

3D noises:

mountain:
The actual 3D noise creating mountain terrain, can be 'eased' in the flags for smoother noise.
The relation of 'offset' to 'scale' controls what proportion of world is covered by mountain, for example 'offset = 0' means half the world will be mountain.
Boosting 'scale' to high numbers creates insanely tall mountains and many floatlands up to y = 31000.

ridge:
The actual 3D noise creating the rough cliff surfaces either side of rivers, river channels will cut through any terrain above up to world top.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Mon Aug 08, 2016 05:22

Paramat, thanks for the explanation of the noises. That clarify some things

paramat wrote:burli,

Realistic in what way? Size, shape or decorations? Remember it's impossible to decide in code if a body of water is part of a large ocean or part of a small pool.


It is, if lakes are above sea level. But I know that this isn't easy. I found an article where they place randomly water sources to the map and use A* to search for rivers and lakes
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Tue Aug 09, 2016 04:43

Here's my attempt at pools filling natural depressions in core mapgens, can sometimes be slow.
https://forum.minetest.net/viewtopic.php?f=11&t=8400
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Tue Aug 09, 2016 05:14

"Remove the trees". Same thing with caves, because mods only run after everything is done.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Tue Aug 09, 2016 07:41

The VoxelManip is fast. The carve loop for caves, tunnels, the stone biomes and some ore generation only needs ~40ms, but ...

reading the data needs, ~25ms, writing the data takes around 40ms and, most worse, noise generation. I need currently 5 3d noises. They need together 150-160ms. Each chunk needs an average of ~250ms

So 16% is generation, 26% is data read/write and 58% is noise

How can this be improved?
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

The heightmap contains sometimes only -31000.

by burli » Tue Aug 09, 2016 15:15

The heightmap is only valid in mapchunks at water level. Mapchunks above may only contain -31000, but not
always.

I overwrite the chunks with heightmap -31000 with obsidian glass. This is the result

Image

Is this a bug or a feature?
Attachments
screenshot_20160809_171150.jpg
screenshot_20160809_171150.jpg (438.01 KiB) Viewed 5228 times
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Wed Aug 10, 2016 09:56

Yes the highlandpools mod needs work.

5 3D noises is heavy usage, heavier than any core mapgen. A 3D noise is roughy 80 times heavier than 2D noise and occupies a lot of Lua memory. An improvement is noise code optimisation wich hmmmm has mentioned might be possible for 3D noise. You can help by using less octaves in 3D noise.

In core mapgen the heightmap is created by searching down each column in a mapchunk for terrain, if no terrain is found in a column the value is -31000. The heightmap works in all mapchunks not just y = -32 to 47.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Wed Aug 10, 2016 12:15

paramat wrote:5 3D noises is heavy usage, heavier than any core mapgen

Well, 2 noises for tunnels, one noise for caves, one for "stone biomes" and one for ore generation. It is a huge 3d space. And of course it takes 80 times more because in a chunk there are 80 2d noises

paramat wrote:In core mapgen the heightmap is created by searching down each column in a mapchunk for terrain, if no terrain is found in a column the value is -31000. The heightmap works in all mapchunks not just y = -32 to 47.


I will check that again, but in this case on the screenshot there was terrain in a chunk with a heightmap value of -31000.

And mapchunks below -32 always return -33, -114 (I guess) and so on
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Wed Aug 10, 2016 15:55

5 3d noises is heavy usage? I count 6 ;-)

https://github.com/paramat/intersecting ... r/init.lua
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Thu Aug 11, 2016 12:25

What does the option flat/noflat in mg v5 mean?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Thu Aug 11, 2016 14:50

Some of my mods are insanely heavy users of 3D noise, 'riverdev' has 10 which is far too much for a lua mod.

'flat', 'noflat' only affects mgv6, it is now a 'mgv6_spflag' (mgv6 specific) but was left in 'mgflags' for a while for backwards compatibility. However the flat flag has just now been removed from 'mgflags' to clean up the mess.

> I will check that again, but in this case on the screenshot there was terrain in a chunk with a heightmap value of -31000.

Yes some columns in that mapchunk will have -31000 because terrain was not found in those columns. However the heightmap does work because that is where decorations are placed and they are placed correctly.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Post your mapgen questions here (modding or engine)

by burli » Mon Aug 15, 2016 18:26

I have lines of sand at chunk borders. Has this something to do with this mudflow? How can I remove this?


Image
Attachments
screenshot_20160815_202413.jpg
screenshot_20160815_202413.jpg (312.63 KiB) Viewed 5228 times
 

procedural_map
New member
 
Posts: 4
Joined: Wed Aug 17, 2016 11:48

procedural map

by procedural_map » Wed Aug 17, 2016 12:20

Using Lua, how do I procedurally generate a map? I copy-pasted some examples from wiki into init.lua but they don't work (don't create map or something like this)

For example (I might use not proper minetest's names)
1)
y = 1 => sand
y < 1 => rock
y > 1 => air
2) Then let's say every 3rd block in x- and z- coordinate will be dirt (y = 1; z, x = 3, 6, 9, 12, ...)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Thu Aug 18, 2016 17:08

burli,

This is a lua mapgen? Operating in singlenode mapgen or adding to another? Can you link to your code?
The sand is probably the seabed sand from the defined biomes, this does appear sometimes in core mapgens down to y = -112 and is caused by overgeneration of large caves.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Thu Aug 18, 2016 17:19

procedural_map,

You create a lua mapgen using the lua voxel manipulator, an example simple mapgen is here https://github.com/paramat/noise23
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your mapgen questions here (modding or engine)

by BrunoMine » Thu Aug 18, 2016 17:22

What is the best way to check if an area is generated a plain?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Thu Aug 18, 2016 17:47

You mean detect a grassland biome?
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your mapgen questions here (modding or engine)

by BrunoMine » Thu Aug 18, 2016 17:51

Yes, I do not want to create decorative items. I want to create structures such as villages.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Thu Aug 18, 2016 17:54

So you're looking for a fairly flat area too?
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your mapgen questions here (modding or engine)

by BrunoMine » Thu Aug 18, 2016 17:55

Yes, exacly.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your mapgen questions here (modding or engine)

by BrunoMine » Thu Aug 18, 2016 19:44

Here's an example. This looks like a smooth behavior of the perlin noise.
Image
Attachments
exemplo.jpg
exemplo.jpg (104.01 KiB) Viewed 5228 times
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your mapgen questions here (modding or engine)

by paramat » Fri Aug 19, 2016 18:08

Easiest way is to use the 'mapgen object heightmap' and scan it for a small height variation.
For biome hopefully soon we will have a 'get biome at point' API (hmmmm intends to write it), until then you'll have to use the mapgen's heat- and humidity- (and in mgv6 tree-) noises and check for values that result in grassland.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 49 guests

cron