Page 1 of 1

Important changes: Define dungeon nodes in biome definitions

PostPosted: Mon Jul 01, 2019 23:18
by paramat
A change has just been made to the development version of the MT engine that removes most of the disgusting hardcoded dungeon node code.

The following now applies to mapgens other than v6:

The MT 5.0.0 and 5.0.1 stable releases added the ability to define the dungeon nodes in biome definitions.
You should now define dungeon nodes in biome definitions instead of doing so using mapgen aliases.
As an example of how to do this see this recent commit to MTGame https://github.com/minetest/minetest_game/commit/e7be81242b04ff410b06ac1cc562c7b1eb758510

From new documentation https://github.com/minetest/minetest/blob/95371c16e9a7d2d7c264457914eac4926c738ba6/doc/lua_api.txt#L6596

Code: Select all
        node_dungeon = "default:cobble",
        -- Node used for primary dungeon structure.
        -- If absent, dungeon nodes fall back to the 'mapgen_cobble' mapgen
        -- alias, if that is also absent, dungeon nodes fall back to the biome
        -- 'node_stone'.
        -- If present, the following two nodes are also used.

        node_dungeon_alt = "default:mossycobble",
        -- Node used for randomly-distributed alternative structure nodes.
        -- If alternative structure nodes are not wanted leave this absent for
        -- performance reasons.

        node_dungeon_stair = "stairs:stair_cobble",
        -- Node used for dungeon stairs.
        -- If absent, stairs fall back to 'node_dungeon'.


If a biome does not define dungeon nodes they will fall back to the 'mapgen_cobble' mapgen alias, if that is not defined by a game, the dungeon nodes will fall back to the biome 'node_stone'.

Games that do not use mapgen v6 (i highly recommend not supporting mapgen v6, it will make your game much simpler and easier to develop) now do not need to define as many mapgen aliases.

From new documentation https://github.com/minetest/minetest/blob/95371c16e9a7d2d7c264457914eac4926c738ba6/doc/lua_api.txt#L281

Code: Select all
### Aliases needed for all mapgens except Mapgen V6

* mapgen_stone
* mapgen_water_source
* mapgen_river_water_source

`mapgen_river_water_source` is required for mapgens with sloping rivers where
it is necessary to have a river liquid node with a short `liquid_range` and
`liquid_renewable = false` to avoid flooding.

#### Deprecated aliases

* mapgen_lava_source
* mapgen_cobble

Use biome-defined cave liquids and dungeon nodes instead.


if a game does not use mapgen v6 and defines cave liquids and dungeon nodes in biome definitions (as it now should), you only need to define 3 mapgen aliases.

I can answer any questions here, feel free to ask.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Thu Jul 04, 2019 14:49
by Wuzzy
Why is mapgen_lava_source deprecated? How will mapgen v6 know which node to use for lava then?

If the dungeon stair node is a full cube, will the dungeons still be walkable?

i highly recommend not supporting mapgen v6, it will make your game much simpler and easier to develop

Supporting v6 anyway is fun!

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Thu Jul 04, 2019 18:16
by v-rob
It would be nice if there was a second version of v6 added that supported the full biomes. I like v6 better than any other mapgen (especially because the cave generation is actually different, whereas the other mapgens are extremely monotonous since they're all the same), but it's not changeable.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Mon Jul 08, 2019 23:06
by paramat
Wuzzy wrote:Why is mapgen_lava_source deprecated? How will mapgen v6 know which node to use for lava then?

If the dungeon stair node is a full cube, will the dungeons still be walkable?

Lava and cobble aliases are only deprecated for non-v6 mapgens, the notification of deprecation is only in the 'non-v6' section. In the v6 section those aliases are listed as required.
Maybe 'deprecation' wasn't the best way to document this, perhaps 'soon unsupported in non-v6 mapgens' would be better.

And yes, dungeons stair corridors are still passable even with full-cube stairs.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Mon Jul 08, 2019 23:10
by paramat
v-rob wrote:It would be nice if there was a second version of v6 added that supported the full biomes.

I've suggested this a few times and can code it quite easily, my opinion about doing so has changed a few times, currently i'm fairly neutral. There hasn't been much interest from other core devs.
It will be a little different though to be compatible with the Biome API, no mudflow.
Adding a new mapgen is a huge responsibility for MT, as worlds will always have to be supported, so this would need a lot of justification. I find it difficult to consider v6 terrain interesting enough to be worth it, it never rises above y = 47.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Thu Jul 11, 2019 14:15
by Termos
paramat wrote:
v-rob wrote:I find it difficult to consider v6 terrain interesting enough to be worth it, it never rises above y = 47.

I don't think max terrain height is what contributes to it being interesting,
rather it's a function of view range, which is 100 by default, fairly small.

Take v7 and cartpathian for example, both generate large flats way wider than 200 nodes, that means standing in the middle you see nothing on default setting, boring as hell.
On the other hand, ~600 nodes high monstrosities occasionaly generated by these mapgens cannot be appreciated on any reasonable view settings, even on unlimited view range the game becomes hardly playable and it's difficult to keep all of it loaded anyway.

Smaller scale of terrain features makes it more suitable for smaller view ranges, because of more varied terrain within view radius and thus more interesting.
I'd argue v6 is more interesting on default settings than most other available mapgens.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Wed Jul 17, 2019 03:05
by Sokomine
Termos wrote:Smaller scale of terrain features makes it more suitable for smaller view ranges, because of more varied terrain within view radius and thus more interesting.
I'd argue v6 is more interesting on default settings than most other available mapgens.

That may very well be true. I sometimes enjoy walking around on a map, exploring terrain. But once it comes down to building something, view range needs to be less extreme. Areas where several biomes intersect are usually particulary intresting places for a settlement. And there's a second factor: If there's too much nice scenery, it might turn into a too long search for the best place to build. Sometimes a bit less is more, and a world that lacks something motivates to improve it.

Re: Important changes: Define dungeon nodes in biome definit

PostPosted: Wed Jul 17, 2019 04:44
by v-rob
Sokomine wrote:And there's a second factor: If there's too much nice scenery, it might turn into a too long search for the best place to build.

Way too true. I can barely ever find any good places to do anything, and when I do, I get bogged down with what to build, how to build it, and what to build with. Sometimes, I think many of the minimalistic things are better.

Regardless, I can still disable snowlands and change desert frequency, so I'm fairly happy.