Page 6 of 10

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

PostPosted: Fri Jan 13, 2017 07:49
by Sergey
I generated many worlds to choose what I like most (among suggested and what is not so realistic).

And оbserving nature I found BRICKWORK at the bottom of the sea! It is artificial thing!
World is freshly generated. Is that possible?

Screenshot: http://imageup.ru/s2653187

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

PostPosted: Fri Jan 13, 2017 19:22
by paramat
That's part of a dungeon, you'll find lots of those underground.

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

PostPosted: Fri Jan 13, 2017 19:36
by Sergey
By the way, there are different terrain generators like v5, v6, v7, valleys, so on. And what about dungeon/catacomb/cave generators? If there are caves then there must be algorithms for that. Do you develop them?

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

PostPosted: Fri Jan 13, 2017 19:52
by paramat
I designed and coded mgfractal and mgflat.
I coded mgv5 as a new version of the original mgv5 from 5 years ago that was designed by celeron55.
I have worked on mgv6 but that was designed by celeron55.
I worked on and improved mgv7 but 'hmmmm / kwolekr' originally designed that.
Mgvalleys was designed by Gael de Sailly and coded into C++ by Duane.
I did not design the cave and dungeon generation but have worked on that code.
I added the (non-mgv6) tunnels using algorithms from the original mgv5.

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

PostPosted: Sat Jan 14, 2017 16:04
by Griiimon
I'd like to include temperature/warmth in my mod. Is there a way to get the temperature at the player position or at least the biome id at his position?

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

PostPosted: Sat Jan 14, 2017 16:29
by burli
Griiimon wrote:I'd like to include temperature/warmth in my mod. Is there a way to get the temperature at the player position or at least the biome id at his position?

No

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

PostPosted: Sat Jan 14, 2017 21:12
by paramat
Yes but you need to calculate it from the heat and humidity noise parameters found here https://github.com/minetest/minetest/blob/master/src/mg_biome.h#L138

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

PostPosted: Sun Jan 15, 2017 10:41
by burli
paramat wrote:Yes but you need to calculate it from the heat and humidity noise parameters found here https://github.com/minetest/minetest/blob/master/src/mg_biome.h#L138

Can I get the current values from map_meta.txt? If no it is pretty useless because I have to hard code the parameters and if somebody changed them it doesn't work

And it means more noise calculatios

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

PostPosted: Mon Jan 16, 2017 00:49
by paramat
You could 'get' currently in-effect noiseparams in Lua using https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L2236
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
minetest.get_mapgen_setting_noiseparams(name)

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

PostPosted: Mon Jan 16, 2017 17:49
by burli
But how can I get the biome? I need the heat and humidity and than I have to calculate the voronoi diagram, right? A little bit to much for globalstep I think

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

PostPosted: Tue Jan 17, 2017 04:33
by Byakuren
burli wrote:But how can I get the biome? I need the heat and humidity and than I have to calculate the voronoi diagram, right? A little bit to much for globalstep I think

Calculate the voronoi diagram outside of a globalstep. Since mods might register their own biomes, you will want to do this in a minetest.after(0, ・).

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

PostPosted: Tue Jan 17, 2017 11:13
by paramat
The code that gets the biome from the biome points is actually quite simple and fast, it just finds the closest biome point to the heat / humidity point, for all biomes active at that particular y.
A voronoi diagram is just a set of 'cells' that each contain points closer to the point than other points.
The engine code is https://github.com/minetest/minetest/blob/master/src/mg_biome.cpp#L207
However i intend to add a 'biome at point' API.

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

PostPosted: Tue Jan 17, 2017 12:07
by burli
Biome at point would be awesome. Also please add heat and humidity at point. They can also be interesting for survival, farming ...

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

PostPosted: Thu Jan 19, 2017 04:56
by paramat
Good idea.

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

PostPosted: Sun Jan 22, 2017 09:36
by burli
How can I make biomes more even? Sometimes biomes are huge, sometimes I can see a snow biome from a jungle

I reduced octaves and persistence, but now I have huge biomes

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

PostPosted: Sun Jan 22, 2017 23:31
by Robsoie
A question about the mapgen world size.

As i don't have that much ram (as i guess that's the problem), Minetest can crash on me when i explore for a long time, so i thought about limiting the world size in a way we (as i play with my nephew) still have a lot to explore before settling somewhere

I then found
https://github.com/minetest/minetest/bl ... nf.example
# Where the map generator stops.
# Please note:
# - Limited to 31000 (setting above has no effect)
# - The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks).
# - Those groups have an offset of -32, -32 nodes from the origin.
# - Only groups which are within the map_generation_limit are generated
# type: int min: 0 max: 31000
# map_generation_limit = 31000


After testing a much lower setting in my minetest.conf (map_generation_limit = 800) i noticed it was still plenty gigantic.
And reaching a world edge didn't allowed me to fall in the void, so it was all good

I found out that having smaller biomes (thanks to orwel helps) provide for visual interest in smaller worlds so i don't have a boring world sized single biome problem.

But then i remembered , there are mods that try to add other worlds/dimensions to a minetest world by generating them in specific altitude or depth as engine apparently currently does not support multiple worlds in parralel if i understood well.

Now with by example a map_generation_limit = 800 it means that the Z level up and down would is limited to +400 or -400 each, meaning then that for those kind of mods with alternate dimensions it should be a problem.

So is there a way to limit a world mapgen only on X / Y and not the Z level ? Or at least customised the world Z level differently than the X/Y one ?

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

PostPosted: Mon Jan 23, 2017 03:18
by paramat
> How can I make biomes more even? Sometimes biomes are huge, sometimes I can see a snow biome from a jungle

I'm sure i answered this elsewhere in the forum.
Reducing persistence helps, but since it's all noise biome size will always be fairly uneven.
Remember the overall general size of biomes is controlled by the 'spread' of biome heat / humidity noises https://github.com/minetest/minetest/blob/master/minetest.conf.example#L1136

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

PostPosted: Mon Jan 23, 2017 03:30
by paramat
> As i don't have that much ram (as i guess that's the problem), Minetest can crash on me when i explore for a long time, so i thought about limiting the world size

RAM use is mostly due to the client storing the visual meshes for the mapblocks (16^3 nodes), the max memory use is controlled by this setting:
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
#    Maximum number of mapblocks for client to be kept in memory.
#    Set to -1 for unlimited amount.
#    type: int
# client_mapblock_limit = 5000

5000 mapblocks tends to use around 1-2GB so you can reduce this number to limit RAM use.
World size has no effect on RAM use, only on total world database size on your harddisc.

> So is there a way to limit a world mapgen only on X / Y and not the Z level ? Or at least customised the world Z level differently than the X/Y one ?

No but it has been suggested, i'm not keen though i don't feel there is enough need. It's nice to keep the MT world cubic as it has always been.

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

PostPosted: Mon Jan 23, 2017 03:32
by Robsoie
Thanks, i'll try to play with the client_mapblock_limit , as i imagine some other mods consume memory too, and all in all things will go overboard at some point, so if i can already get mapgen to eat less it's already good.

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

PostPosted: Mon Jan 23, 2017 03:35
by paramat
OOM (out of memory) error? Some mods can use a lot of Lua memory and LuaJIT has a low Lua memory use limit, try using non-LuaJIT, there's a build available.

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

PostPosted: Mon Jan 23, 2017 09:49
by taikedz
Hello

--- Question ---

How to create a biome that is consistently rare?

I am wondering, is the humidity and heat in the map generated pseudo-randomly - similar across maps, but with variations? Or is it consistent, but (depending on an additional variable), potentially wildly different even on a same seed and mapgen?

I confess to being mighty confused as to how to create a biome with a reliable/predictable frequency of appearance...

--- Context ---

We are trying to add a new biome such that it be rare, but we're having problems defining a good heuristic...

I did a run on a test server with the new biome at heat 55 humidity 10 and altitudes 110-180 - this test server uses the same seed and mapgen and mods as the live server, and it was indeed rare as had been intended. I found a small one and noted its coordinates.

So we added this to the live server and did a flyaround...... and found a super-massive one that extended for a good few dozen mapblocks in all directions...!

Returning to the test server, and going to those coordinates, we didn't find any such massive biome...

I studied the ethereal biomes a little and noted that rarer biomes are bunched together whereas common ones are not too ex-centered and don't have too many close neighbours... so far so good.

http://picbin.org/src/1305

So I was wondering, if I create a general "CustomBiome-neutral" with heat/humidity/altitudes = { 55 , 10, [110,180] }

and then create a second CustomBiome-special with heat/humidity/altitudes = { 55 , 10, [170,170] } (note the equal altitude in this one)

would this mean that my "neutral" biome would be more likely to appear, and the "special" biome would only have one chance in N of being embedded in the neutral biome....?

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

PostPosted: Mon Jan 23, 2017 09:59
by burli
Heat and humidity are generated by perlin noise. You have no control over size or rarity

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

PostPosted: Mon Jan 23, 2017 11:11
by hajo
burli wrote:Heat and humidity are generated by perlin noise.

How about alternate formulae for these ?
E.g. humidity based on the amount of water-squares in the area,
and heat based on z-coordinate (i.e. location on north/south-axis) ?
Maybe also include y-value, for altitude (cooler and dryer when higher).

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

PostPosted: Mon Jan 23, 2017 11:17
by burli
hajo wrote:How about alternate formulae for these ?


If you write your own mapgen this would be possible. I don't think this is possible with the default mapgens

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

PostPosted: Mon Jan 23, 2017 18:32
by burli
I want to fork MG v7 and replace the cave generation with the v6 mapgen. How can I do that? I need a little bit help to start

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

PostPosted: Mon Jan 23, 2017 22:44
by taikedz
So if they are from the perlin noise, are they consistently distributed the same for any given mapgen + seed?

And given two worlds using the same mapgen + seed, will they have the exact same distribution of biomes and boundaries between biome changes, or is this determined by some chance factor?

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

PostPosted: Tue Jan 24, 2017 05:08
by paramat
burli,
The large caves in mgv6 and mgv7 are the same, but the smaller tunnels are different.
Mgv6 cavegen is found here https://github.com/minetest/minetest/blob/master/src/cavegen.cpp#L448
You need to call that from code like this https://github.com/minetest/minetest/blob/master/src/mapgen_v6.cpp#L1052 but without the biome check at line 1066.
You may also want to remove the 'cave amount' noise, or if you use it you'll need to add noise code to mgv7.

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

PostPosted: Tue Jan 24, 2017 05:25
by paramat
Taikedz,
Biome distribution is determined by heat and humidity perlin noises, so is identical for identical seeds.

> So if they are from the perlin noise, are they consistently distributed the same for any given mapgen + seed
And given two worlds using the same mapgen + seed, will they have the exact same distribution of biomes and boundaries between biome changes

Correct.
The difference you experienced with the same seed must have happened for some other reason.

Biome rarity is determined by the size of it's voronoi cell on the heat-humidity voronoi diagram ,see diagram in https://forum.minetest.net/viewtopic.php?f=18&t=15939
You can use a real-time voronoi generator like GeoGebra to design a biome system, how to use is here https://forum.minetest.net/viewtopic.php?p=230857#p230857 the cells auto-update as you drag the biome points around.
So you can make your biome rare by surrounding it's point closely on all sides with other biome points, as long as all these biomes are active for the same range of altitude.
Or it will be rare if it's point has extreme heat and / or humidity values, > 100 or < 0.

See https://forum.minetest.net/viewtopic.php?f=47&t=11603 for more useful information on how biomes are determined.

This is Ethereal biomes in GeoGebra https://www.geogebra.org/m/u2ngcd5F

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

PostPosted: Tue Jan 24, 2017 22:07
by Sergey
I have obvious question about mapgen and engine itself.

Why are there objects hanging in the air? Sand or gravel falls down if there is nothing (air) under it. But block of dirt or stone can hang in the air without being connected to something on the ground. Even tree can "stand" in the air. You have to fly to fell it. Why is that? This is against basic physical laws!

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

PostPosted: Wed Jan 25, 2017 02:31
by duane
Sergey wrote:I have obvious question about mapgen and engine itself.

Why are there objects hanging in the air? Sand or gravel falls down if there is nothing (air) under it. But block of dirt or stone can hang in the air without being connected to something on the ground. Even tree can "stand" in the air. You have to fly to fell it. Why is that? This is against basic physical laws!


It takes a lot more computation to make things fall than to just leave them in place. When I made the mistake of producing unstable sand structures underground, the resulting sandslides crashed servers. Plus, some people like making floating islands.