Mgv5/7 caverns added, you may need to set flags at update

Locked
User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Mgv5/7 caverns added, you may need to set flags at update

by paramat » Post

https://github.com/minetest/minetest/pull/5382

This feature has been added to mgv5 and mgv7, and sets caverns to be enabled by default in new worlds.

An existing world will have the 'caverns' flag added to it's 'mgv5_spflags' or 'mgv7_spflags' on MT engine update, and caverns will be enabled in that world.
You may not mind caverns in newly generated areas of your world, but be aware that if a cavern intersects the border between old world and new, a flat wall will appear along a mapchunk border.

To avoid caverns being added to an existing world, add 'nocaverns' to the mapgen specific flags and add the line to your 'minetest.conf' file before using the new MT engine version.
For example:

Code: Select all

mgv5_spflags = nocaverns

Code: Select all

mgv7_spflags = mountains,ridges,nofloatlands,nocaverns

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: Mgv5/7 caverns added, you may need to set flags at updat

by FaceDeer » Post

Neat!

Is there a way to access the giant cavern noise in a lua mapgen? I've been working on a mod that generates giant caverns like these and then decorates their floors and ceilings with biome-specific features, as well as plugging intersecting lava veins with obsidian, and if I could get ahold of the noise value and threshold I might be able to use these "native" giant caverns directly.

Also, does the noise source for these caverns use the Subterrain mod's trick of averaging in a second vertically-squashed noise to bias the cavern towards having horizontal ledges and floors? That was a very pleasing feature, IMO.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Mgv5/7 caverns added, you may need to set flags at updat

by paramat » Post

The caverns in mgvalleys and these new caverns are almost identical to the ones in subterrain mod.
A 'second squashed noise' is not used, only one 3D noise is used but it has been squashed vertically by a factor of 3, you can see that the 'spread' noise parameter (which controls the scale of the patterns) has x, y, z, components and the y component is 1/3 the horizontal ones.

Code: Select all

mgv7_np_cavern = 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Mgv5/7 caverns added, you may need to set flags at updat

by paramat » Post

FaceDeer wrote:Is there a way to access the giant cavern noise in a lua mapgen? I've been working on a mod that generates giant caverns like these and then decorates their floors and ceilings with biome-specific features, as well as plugging intersecting lava veins with obsidian, and if I could get ahold of the noise value and threshold I might be able to use these "native" giant caverns directly.
Maybe use these 2 https://github.com/minetest/minetest/bl ... .txt#L2316 or just manually copy the noiseparams and threshold into your mod.
I can't find your cavern-generation code in your mod with a quick look.

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: Mgv5/7 caverns added, you may need to set flags at updat

by FaceDeer » Post

paramat wrote: Maybe use these 2 https://github.com/minetest/minetest/bl ... .txt#L2316 or just manually copy the noiseparams and threshold into your mod.
Yeah, I was thinking I'd probably pull the parameters out of config that way. I'll also dig up the C++ math for "tapering" the noise when it reaches the upper limit and reproduce that in lua and in theory that'll let me figure out exactly where all the cavern edges are so that I can decorate them. I read in another thread that there's a plan to have decorations work underground in the next version, that will also be extremely handy, but given that I'm placing huge underground mushroom-trees and stalagmites the size of small buildings I think being able to localize those to just the giant caverns will be important. They'd clog up the smaller tunnels and not look very good crammed in there.
paramat wrote: I can't find your cavern-generation code in your mod with a quick look.
I pulled all the core cavern-generating stuff out into a separate mod, subterrane, to allow for other mods to do their own thing with it (and reimplemented Caverealms with it while I did the work of splitting it out of there in the first place).

I'm not sure exactly what I'll do with it when this native giant cavern support goes in. The subterrane mod allows for multiple cavern "layers" with different noise parameters, and there's the bias-toward-horizontal-ledges thing I mentioned earlier that I like, so there may still be value in non-native giant cave gen. But I definitely need to have it support native caves gracefully either way.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: Mgv5/7 caverns added, you may need to set flags at updat

by duane » Post

FaceDeer wrote:Yeah, I was thinking I'd probably pull the parameters out of config that way. I'll also dig up the C++ math for "tapering" the noise when it reaches the upper limit and reproduce that in lua and in theory that'll let me figure out exactly where all the cavern edges are so that I can decorate them.
It sounds as though you'll be using more resources than if you just turned the mapgen caverns off and used your own. The mapgen will make the caverns, then you'll have to pull up the same noise tables to find them, then you'll have to write the chunks again to decorate them.
Believe in people and you don't need to believe anything else.

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: Mgv5/7 caverns added, you may need to set flags at updat

by FaceDeer » Post

duane wrote:It sounds as though you'll be using more resources than if you just turned the mapgen caverns off and used your own. The mapgen will make the caverns, then you'll have to pull up the same noise tables to find them, then you'll have to write the chunks again to decorate them.
If I read the github discussion correctly, the native cavern-generation code has one major feature that I've been unable to properly put into the lua version; it prevents the spawning of lava and water caves within cavern-containing chunks, which eliminates the floating lava and water blobs that sometimes appear in the middle of Caverealms caverns.

I dealt with the lava problem in dfcaverns by eliminating the default mapgen lava entirely and reintroducing lava as "ore" veins that were easier to plug up when they intersected caverns. The water problem is resolved by using the dynamic_liquid mod to make the floating water fall down instead of forming permanent water towers. But those were features I wanted in dfcaverns anyway that just coincidentally solved the problem, other mapgens may not want to use those as workarounds. In those cases "re-digging" exactly the same caverns as the native mapgen could be beneficial even though it's wasting a bit of effort.

I'm definitely leaning toward making that optional, though. dfcaverns will probably only work right with native caverns disabled since I want to have multiple "layers" of caverns with potentially different noise patterns defining them.

Locked

Who is online

Users browsing this forum: No registered users and 4 guests