Post your mapgen questions here (modding or engine)

User avatar
Sergey
Member
 
Posts: 362
Joined: Wed Jan 11, 2017 13:28

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

by Sergey » Fri Jan 13, 2017 07:49

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
 

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 Jan 13, 2017 19:22

That's part of a dungeon, you'll find lots of those underground.
 

User avatar
Sergey
Member
 
Posts: 362
Joined: Wed Jan 11, 2017 13:28

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

by Sergey » Fri Jan 13, 2017 19:36

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?
 

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 Jan 13, 2017 19:52

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.
 

Griiimon
Member
 
Posts: 11
Joined: Sun Jan 08, 2017 13:20
IRC: TelepathicVampire
In-game: Griiimon

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

by Griiimon » Sat Jan 14, 2017 16:04

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?
 

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

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

by burli » Sat Jan 14, 2017 16:29

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
 

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

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

by paramat » Sat Jan 14, 2017 21:12

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
 

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

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

by burli » Sun Jan 15, 2017 10:41

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
 

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 Jan 16, 2017 00:49

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)
 

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 Jan 16, 2017 17:49

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
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

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

by Byakuren » Tue Jan 17, 2017 04:33

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, ・).
Every time a mod API is left undocumented, a koala dies.
 

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 Jan 17, 2017 11:13

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.
 

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 Jan 17, 2017 12:07

Biome at point would be awesome. Also please add heat and humidity at point. They can also be interesting for survival, farming ...
 

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 Jan 19, 2017 04:56

Good idea.
 

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

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

by burli » Sun Jan 22, 2017 09:36

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
 

Robsoie
Member
 
Posts: 48
Joined: Fri Apr 29, 2016 16:22

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

by Robsoie » Sun Jan 22, 2017 23:31

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 ?
 

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 Jan 23, 2017 03:18

> 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
Last edited by paramat on Mon Jan 23, 2017 03:34, 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 Jan 23, 2017 03:30

> 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.
 

Robsoie
Member
 
Posts: 48
Joined: Fri Apr 29, 2016 16:22

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

by Robsoie » Mon Jan 23, 2017 03:32

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.
 

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 Jan 23, 2017 03:35

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.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Mon Jan 23, 2017 09:49

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....?
 

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 Jan 23, 2017 09:59

Heat and humidity are generated by perlin noise. You have no control over size or rarity
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

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

by hajo » Mon Jan 23, 2017 11:11

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).
Last edited by hajo on Mon Jan 23, 2017 11:37, edited 1 time in total.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

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 Jan 23, 2017 11:17

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
 

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 Jan 23, 2017 18:32

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
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Mon Jan 23, 2017 22:44

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?
 

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 Jan 24, 2017 05:08

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.
Last edited by paramat on Tue Jan 24, 2017 05:29, 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 » Tue Jan 24, 2017 05:25

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
 

User avatar
Sergey
Member
 
Posts: 362
Joined: Wed Jan 11, 2017 13:28

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

by Sergey » Tue Jan 24, 2017 22:07

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!
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

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

by duane » Wed Jan 25, 2017 02:31

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.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 8 guests

cron