'lava depth' mapgen parameter has been removed

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

'lava depth' mapgen parameter has been removed

by paramat » Tue Nov 19, 2019 00:48

Cave liquids in MT were hardcoded and limited to water or lava until recently. In MT 5.0.0 it became possible to define cave liquid nodes in the biome definitions, and this will be the method to use in future, the hardcoded stuff is deprecated and will eventually be removed.

As part of this process, the deprecated 'lava depth' mapgen parameter has just been removed from the development version of MT (so this change will appear in MT 5.2.0 stable).
This parameter has only been present since MT 5.0.0.
This change only affects games other than MTGame, and where the game is not yet using biome definitions to define and locate cave liquids.
This change only affects mapgens other than 'V6'.

Previously:
Lava only appeared below 'lava depth', which by default was y = -256 in most mapgens, y = 1 in 'Valleys' mapgen.

Now:
Lava only appears below y = water level - 256.
'water level' is the 'water level' mapgen parameter set for a world, by default y = 1.

So there will be no change in most mapgens if you were using the default value of 'lava depth'.
Lava will be deeper than the previous default in 'Valleys' mapgen, a harmless change and actually an improvement.
This is essentially a return to the behaviour before i added the parameter.

If this change causes a problem for anyone, you can solve this by using biome definitions to locate lava, as MTGame now does, see the 'mapgen.lua' file in the 'default' mod.
If you are using a game which is affected in a problematic way, you may want to contact the game creator and encourage them to define and locate cave liquids in the biome definitions, this will need to be done eventually anyway.

I can answer any questions in this thread and help with any disruption.
 

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

Re: 'lava depth' mapgen parameter has been removed

by paramat » Tue Nov 19, 2019 02:15

Huh ... just realised something ... the 'lava depth' parameter was released into MT 5.0.0, but in MT 5.0.0 the harcoded cave liquid code was already deprecated. So the 'lava depth' parameter should never have been released into MT 5.0.0., it should have been removed before release.
My mistake, sorry for that. Even more good reason to remove this parameter as soon as possible.
 

User avatar
Wuzzy
Member
 
Posts: 3643
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: 'lava depth' mapgen parameter has been removed

by Wuzzy » Tue Nov 19, 2019 16:46

I generally applaud the removal of weird obscure features that should have never been added in the first place. This is the right decision.

But I notice a small conceptual problem with cave liquids:
What if I register two biomes at the same height but different cave liquids (e.g. lava vs water)? That would look weird, wouldn't it? OK, I should probably not do it anyway, but still. To have non-weird cave liquids, I now must redundantly register the cave liquid at the same height for basically all biomes, right? And if I want to ever change the cave liquid, I must touch a ton of biome definitions … This seems like a bug factory.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

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

Re: 'lava depth' mapgen parameter has been removed

by paramat » Tue Nov 19, 2019 18:55

With the new 'biome defined cave liquids' approach, the cave liquid for the caves of a mapchunk is decided by the biome of the midpoint node of the mapchunk being generated.
If you define multiple biomes that overlap vertically and also have identical heat / humidity points, that is an error in defining biomes. The result would probably be consistently one cave liquid for all mapchunks though, decided by the structure of the biome-choosing code. That would not be 'weird'.

> To have non-weird cave liquids, I now must redundantly register the cave liquid at the same height for basically all biomes, right?

Ideally, all biomes should now (there is no rush to do this, the old hardcoded behaviour is deprecated but still present as a fallback, and will be for a while, probably more than a year) define the cave liquid node (or a list to choose randomly between), the node (or entry in the list) can be "air" to not place cave liquids.

If a biome definition lacks a definition of cave liquid, the caves of that mapchunk will fall back to the old hardcoded behaviour of water or lava. I would not call that 'weird' because it would look fine if it was intentional. However, it is obviously far better to define cave liquids for all biomes, to be ready for when the old hardcoded fallback is removed in 1+ years.

> And if I want to ever change the cave liquid, I must touch a ton of biome definitions

Yes, as with any biome-defined node, but you gain the advantages: Definable per-biome cave liquids that can be any node, not just water or lava.

> This seems like a bug factory.

Not at all, it just takes a little more time to make the simple changes. No one considers (or, should not) the current biome-defined nodes (top, filler, stone, water ...) a bug factory.
 

User avatar
firefox
Member
 
Posts: 1507
Joined: Wed Jan 14, 2015 07:34
Location: Xanadu
In-game: Red_Fox

Re: 'lava depth' mapgen parameter has been removed

by firefox » Wed Nov 20, 2019 09:12

awesome!
do cave liquids still get randomly placed as cubic blobs, or do they actually fill cave floors like lakes and rivers?

not not directly related to cave liquids, but pretty close:
since underground biomes use the same parameters, does "node_top" actually apply to the cave floor?
i always wanted to have caves that grow moss on the floor and are illuminated by glowing water (luminescent algae).
building inspiration: viewtopic.php?f=3&t=15550 --- my game: viewtopic.php?f=49&t=15860 --- =(^.^)= nyan~
 

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

Re: 'lava depth' mapgen parameter has been removed

by paramat » Fri Nov 22, 2019 00:43

Cave liquids are still a little 'blobby' yes, i have not yet investigated fixing that.

'top' and 'filler' nodes only apply to the world surface, not to caves.
However, since MT 5.0.0, decorations can be placed on cave floors and/or ceilings, so high density decorations can be used to add a layer of nodes.
Use fill_ratio = 10.0 for high-performance complete coverage (1 decoration per surface node).

Code: Select all
        fill_ratio = 0.02,
        -- The value determines 'decorations per surface node'.
        -- Used only if noise_params is not specified.
        -- If >= 10.0 complete coverage is enabled and decoration placement uses
        -- a different and much faster method.
 


Return to News



Who is online

Users browsing this forum: No registered users and 1 guest