Page 1 of 1

What's the minimum number of nodes for a game?

PostPosted: Thu Feb 02, 2017 09:33
by burli
I noticed that there are some nodes hard coded in the engine.

I assume: sand, stone, water, riverwater, dirt, dirt with grass, cobble and mossy cobble for dungeons and lava for caves

Did I miss one?

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 01:05
by octacian
As far as I know, nothing content-related is coded in the engine. I thought it was literally an engine anyways.

Could you link some code to show this?

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 04:10
by TumeniNodes
burli wrote:I noticed that there are some nodes hard coded in the engine.

I assume: sand, stone, water, riverwater, dirt, dirt with grass, cobble and mossy cobble for dungeons and lava for caves

Did I miss one?


I thought only air and clouds might be.
I had only thought this, quite a while back when I attempted to change the cloud texture, to find absolutely nothing changes them.

I also made the mistake once of using giveme cloud and had to install the mod with the mithril drill (or something like that) to get rid of them, while in creative mode.

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 05:46
by burli
No, you need minimum some aliases for some nodes. I played with the minimal development test and I got a NodeResolver error for river water source, even if I used v7 mapgen

So you have to register a handful of nodes or aliases to satisfy the engine

Even singlenode needs aliases

https://github.com/minetest/minetest/issues/1840

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 15:18
by octacian
Well, with this in mind, I must say that this does not mean the nodes are registered in the engine. Air is registered in MTG, found it a while ago, it's called "You hacker you." Cloud is also registered as default:cloud. So I don't think any nodes are actually registered in the core, but just mapgen. The mapgen requires specific things so could cause this. I personally think that something should be done about this. But the problem is found in mapgen, it's not that nodes are being registered in core.

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 15:38
by burli
octacian wrote:Well, with this in mind, I must say that this does not mean the nodes are registered in the engine. Air is registered in MTG, found it a while ago, it's called "You hacker you." Cloud is also registered as default:cloud. So I don't think any nodes are actually registered in the core, but just mapgen. The mapgen requires specific things so could cause this. I personally think that something should be done about this. But the problem is found in mapgen, it's not that nodes are being registered in core.


What I mean is, that some nodes are coded to the engine, the C++ part. And the mapgen is part of the engine

So if you make a game you have to register some aliases for stone, water, riverwater and so on, even if they are not used in your game or even if the mapgen doesn't use them.

I talk about aliases like this

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.register_alias("mapgen_stone", "default:stone")


If I remove them I get a node resolver error. I ran into this issue while tinker around with the minimal development test game. It's missing an alias for river_water_source and I always got an error, even if I used mg v7

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 20:05
by kaadmy
Minetest's mapgen needs some specific nodes, but you can just alias the non-air types to default:stone :D

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 21:17
by burli
And I want to know these specific nodes

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 22:15
by kaadmy
The engine can use any node, but I think it only uses these:
https://github.com/minetest/minetest/bl ... apnode.cpp

Re: What's the minimum number of nodes for a game?

PostPosted: Fri Feb 03, 2017 23:16
by paramat
The cloud node and texture in MTGame have nothing to do with the moving clouds, which are directly drawn and don't use textures.

The hardcoded nodes are air and ignore https://github.com/minetest/minetest/blob/master/builtin/game/register.lua#L332 maybe unknown too.

The basic mapgen aliases that 'mapgenBasic' (non-mgv6 mapgens) needs are air, stone, water_source for base terrain and cobble for dungeons if you have those enabled.
See https://github.com/minetest/minetest/blob/master/src/mapgen.cpp#L588

Mgv6 may need extra nodes https://github.com/minetest/minetest/blob/master/src/mapgen_v6.cpp#L88 but check the fallbacks below.
Mgvalleys needs lava_source https://github.com/minetest/minetest/blob/master/src/mapgen_valleys.cpp#L114

Large caves and mgv6 small caves, 'cavesRandonWalk', like to have water_source and lava_source but both fallback to air https://github.com/minetest/minetest/blob/master/src/cavegen.cpp#L156

The Biome API needs river_water_source https://github.com/minetest/minetest/blob/master/src/mg_biome.cpp#L53

The reason river_water_source is important is because for mgvalleys (and future mapgens that have sloping rivers) it is essential to have a water type that is non-renewable and has flowing range 2, to not overflow river banks on sloping rivers.

Re: What's the minimum number of nodes for a game?

PostPosted: Sat Feb 04, 2017 07:35
by paramat
Just merged changes:
MapgenBasic now needs river_water_source.
Gravel (used in mgv6 mapgen for a rare surface material) now falls back to stone.
So mgv6 now needs stone, dirt, dirt_with_grass, sand, water_source, lava_source and cobble.

So the minimum looks like:
stone
dirt
dirt_with_grass
sand
water_source
river_water_source
lava_source
cobble

Re: What's the minimum number of nodes for a game?

PostPosted: Sat Feb 04, 2017 08:57
by burli
Thanks paramat

Re: What's the minimum number of nodes for a game?

PostPosted: Sat Feb 04, 2017 14:57
by TumeniNodes
good stuff

Re: What's the minimum number of nodes for a game?

PostPosted: Sat Feb 04, 2017 18:04
by TumeniNodes
paramat wrote:The cloud node and texture in MTGame have nothing to do with the moving clouds, which are directly drawn and don't use textures


That is why I added the "maybe" to my including cloud in my statement. And mentioned it basically serves no purpose other than it is useful in making an extremely clean and white structure or road :P Iwhen I started messing with it, I had intended on creating a "cloud city" thinking I might be able to eventually create a city or tower which was built in a cloud and it could move with said cloud... (Im a big dreamer :D )

But I have a question... is there any[i] way at all, or, is it even possible to create a mod which might add an option to change how the clouds are drawn?
If someone wanted to make them more whispier or even more puffy-like..., or even different shades? (just asking) Because this would be [i]very
cool and extremely welcomed by me...

Re: What's the minimum number of nodes for a game?

PostPosted: Sun Feb 05, 2017 08:19
by paramat
Someone is working on a clouds API, there is an unfinished PR. Stuff like colour, direction N, S, E, or W, speed, fraction of cloud cover, maybe more like possible multiple levels for use in stacked realms. The colour is likely to be a plain colour not a texture as clouds need to be drawn fast as currently.

Re: What's the minimum number of nodes for a game?

PostPosted: Mon Feb 06, 2017 03:29
by Wuzzy
2.
Air and Ignore.