[0.4.11] Meshnodes, mapgen “v5”, other recent developments

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Two new features for the mgv5, mgv7 biome API (not mgv6):

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()
^ These lines can be used in a mod to clear any previously registered biomes, decorations and ores. Once i create the default set of biomes for mgv5, mgv7 these lines can be used in a mod to clear those just before you register your own, or if you don't register new biomes, decorations and ores this will reduce mgv5, mgv7 to base terrain (stone, air and water only) so you can continue to use paragenv7 or whatever mod requires base terrain.
Of course you can choose which of these lines to use to clear what you choose to clear, for example many players will be happy with the default ores so can leave those as default.


Code: Select all

mg_biome_np_heat = {
    offset = 50
    scale = 50
    spread = (500.0, 500.0, 500.0)
    seed = 5349
    octaves = 3
    persistence = 0.5
}

mg_biome_np_humidity = {
    offset = 50
    scale = 50
    spread = (500.0, 500.0, 500.0)
    seed = 842
    octaves = 3
    persistence = 0.5
}
^ These lines can now be added to minetest.conf to set the heat and humidity noise parameters. These are examples of the new superior 'group format' for noise parameters, however the single line format will be supported for a while.
The 3 numbers in brackets are the 'spread' of heat and humidity in nodes (the largest scale structure in the noise variation), these need to be increased if you have a lot of biomes, to avoid tiny biomes and narrow biome stripes.

***** Please note the default heat and humidity noise parameters have now changed, the persistences have been reduced to 0.5. If you are using the biome API and have a set of registered biomes, for biome continuity in your mgv5 or mgv7 world you will need to set the old defaults through minetest.conf:

Code: Select all

mg_biome_np_heat = {
    offset = 50
    scale = 50
    spread = (500.0, 500.0, 500.0)
    seed = 5349
    octaves = 3
    persistence = 0.7
}

mg_biome_np_humidity = {
    offset = 50
    scale = 50
    spread = (500.0, 500.0, 500.0)
    seed = 842
    octaves = 3
    persistence = 0.55
}
However the new parameters should create a better pattern of biomes so i recommend using the new defaults if you can, and if starting a new world.
Last edited by paramat on Sun Dec 14, 2014 23:45, edited 6 times in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

Could you explain why did you pre-register any biomes in the first place, please?
What I mean is, why not leave empty stones by default like in mgv7?

I haven't use v5 yet and haven't follow it's development up until now, so you can safely assume I know nothing about mgv5.

Could you explain the ideas behind mgv5 development, please?

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by Krock » Post

4aiman wrote:What I mean is, why not leave empty stones by default like in mgv7?
It's something great to have default biomes in mgv5/7.
Many newbies ask why there is no dirt and are not happy to have install a mod for that first.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

Krock wrote:
4aiman wrote:What I mean is, why not leave empty stones by default like in mgv7?
It's something great to have default biomes in mgv5/7.
Many newbies ask why there is no dirt and are not happy to have install a mod for that first.
Ah, I can see that point of yours, Krock.
While they truly are asking and not happy to install some mods, there's an explanation, why it was so.

But I can't make up some nice answer to "Why do I have to unregister smth to use mgv5?"
I mean, it's like deliberately downloading Ubuntu Ultimate Edition and then stripping it down to a normal version in order to install the soft you really need. Or like getting SteamOS and then removing Steam to use Desura.

But the thing is, with Ubuntu one can easily switch to some "simpler" variation of it, while here I can't see any choice left.

Don't get me wrong, I'm not against predefined biomes, it's just that I'm struggling to make Magichet as slim as possible and additional code doesn't help me to do it.
Moreover, what if there're 2 or more places where biomes are registered? Which one should unregister all predefined biomes in the case when I just can't soft-depend? (Say, I got some really neat mods on terms I won't change those. May seem unreal, but can happen.)

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

It was always intended for mgv7 to have default biomes, but hmmmm never got around to it because he's unhappy with mgv7 and has not finished it. Now biomes are my job as the mapgen tea-boy.
Many new players try mgv7 before understanding mods and don't realise it's missing biomes, then say something like 'it seems bleak', some make video reviews of a stone world, it makes a bad impression.
In future most players will use mgv7/v5 with the default biomes instead of defining their own, so it makes sense to require experienced modders to disable default biomes instead of requiring inexperienced new players and the majority to enable them.
When there are 2 or more mods that define sets of biomes, as long as both have 'clear registered biomes' before their biome definitions the order they run in will decide which biome system is used, the order is controlled with dependancies.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

Oh... ok then.

But what if I can't change the dependencies? What if the licence won't let me do it?

Is there a way to clear default biomes by setting some option to false in minetest.conf?
Like "use_predefined_biomes_for_mgv5=false"?
As long as MT will be able to load minetest.conf supplied with subgames one would be able to disable default biomes prior to loading any mods \^_^/


Another thing about biomes:
FM now has the 'layers' feature which enabled a modder to define multiple layers thus creating different biomes at different heights.
I deliberately provide no links - it's "didn't look into your code = didn't steal it" thing I guess (I'm trying to avoid licensing issues).

Is there a chance smth like that would be done for MT?
Would've been useful for nether and heaven as well as any other "realm" above or below the overworld )

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

4aiman wrote:But what if I can't change the dependencies? What if the licence won't let me do it?

Is there a way to clear default biomes by setting some option to false in minetest.conf?

FM now has the 'layers' feature which enabled a modder to define multiple layers thus creating different biomes at different heights.
Is there a chance smth like that would be done for MT?
No licence should prevent you changing dependancies, if it does complain to the modder, dependancies always need changing by the end user.

No.

The mgv5/v7 biome API already has layers: use 'height min' and 'height max' to stack them up, you can have up to 256 biomes registered so plenty for each layer. For each mapchunk the biome API sees which biomes are active for that altitude and will calculate biomes accordingly.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Update to the post above, we just remembered to add code to clear decorations and ores as well as biomes:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()
^ These lines can be used in a mod to clear any previously registered biomes, decorations and ores.
Once i create the default set of biomes for mgv5, mgv7 these lines can be used in a mod to clear those just before you register your own, or if you don't register new biomes, decorations and ores this will reduce mgv5, mgv7 to base terrain (stone, air and water only) so you can continue to use paragenv7 or whatever mod requires base terrain.
Of course you can choose which of these lines to use to clear what you choose to clear, for example many players will be happy with the default ores so can leave those as default.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Here are the new noise sections in doc/lua_api.txt:

*****
Noise Parameters
--------------------
Noise Parameters, or commonly called NoiseParams, define the properties of perlin noise.
- offset
Offset that the noise is translated by (i.e. added) after calculation.
- scale
Factor that the noise is scaled by (i.e. multiplied) after calculation.
- spread
Vector containing values by which each coordinate is divided by before calculation.
Higher spread values result in larger noise features.
A value of {x=250, y=250, z=250} is common.
- seed
Random seed for the noise. Add the world seed to a seed offset for world-unique noise.
In the case of minetest.get_perlin(), this value has the world seed automatically added.
- octaves
Number of times the noise gradient is accumulated into the noise.
Increase this number to increase the amount of detail in the resulting noise.
A value of 6 is common.
- persistence
Factor by which the effect of the noise gradient function changes with each successive octave.
Values less than 1 make the details of successive octaves' noise diminish, while values
greater than 1 make successive octaves stronger.
A value of 0.6 is common.
- lacunarity
Factor by which the noise feature sizes change with each successive octave.
A value of 2.0 is common.
- flags
Leave this field unset for no special handling.
Currently supported are:
- defaults
Specify this if you would like to keep auto-selection of eased/not-eased while specifying
some other flags.
- eased
Maps noise gradient values onto a quintic S-curve before performing interpolation.
This results in smooth, rolling noise. Disable this for sharp-looking noise.
If no flags are specified (or defaults is), 2D noise is eased and 3D noise is not eased.
- absvalue
Accumulates the absolute value of each noise gradient result.
*****
PerlinNoise: A perlin noise generator
- minetest.get_perlin(seeddiff, octaves, persistence, scale) or minetest.get_perlin(noiseparams)
*****

If you want to calculate noise at point using minetest.get_perlin() you can now either use the old single-line format:

Code: Select all

minetest.get_perlin(seeddiff, octaves, persistence, scale)
(which confusingly uses the word 'scale' for what is actually 'spread') or the table format shown below. If you have noiseparams already defined in a mapgen mod for creating perlin noise maps you can now input those noiseparams directly into minetest.get_perlin().

Two new optional noise parameters have been added to the table format: 'lacunarity' and 'flags'.
Lacunarity has in the past always been set to 2.0, and will be set to that value if the line is left out.
Lacunarity is the ratio of the 'spreads' of adjacent octaves, up until now each additional octave created detail on a scale half as big (1/2.0), now you can control that. for example a lacunarity of 3.0 will create a wider range of detail for the same number of octaves, or, the same range of detail for a smaller number of octaves, both at the expense of noise quality. If in doubt leave it at 2.0.
Flags allows you to ease 3D noise, un-ease 2D noise, and get the absolute value of noise.
Interestingly 2D noise has in the past always been eased, now you can un-ease it to make it more spiky.

Noise parameters format for 2D or 3D perlin noise or perlin noise maps:

Code: Select all

np_terrain = {
    offset = 0,
    scale = 1,
    spread = {x=384, y=384, z=384},
    seed = 5349,
    octaves = 5,
    persist = 0.63,
    lacunarity = 2.0,
    flags = "eased"
}
Therefore a single noise parameter table can be used to get 2D or 3D noise, when getting 2D noise spread.z is ignored.

Further explanation by hmmmm on IRC:

Code: Select all

<hmmmm> leave flags blank for noise just like you're used to, eased/non-eased is determined by the type of noise it's being used for
<hmmmm> 2d noise uses eased by default
<hmmmm> 3d noise uses non-eased by default
<hmmmm> this is needed for backwards compatibility
<hmmmm> if you want to do something a little different though... you need to specify the flags field
<hmmmm> 2d noise with the "eased" flag does nothing really because it's already eased by default
<paramat> 2d noise has always been eased then?
<hmmmm> yup
<hmmmm> if you specify "noeased" though, or just have the flags field present without "eased" present, it'll disable easing on 2d noise
<hmmmm> if you specify "eased" on 3d noise, it'll ease your 3d noise
<hmmmm> if you specify "noeased" on 3d noise or leave nothing at all, it'll be regular 3d noise
<hmmmm> let's say you want absolute noise but you don't want to specify eased or not eased
<hmmmm> you'd specify defaults instead
<hmmmm> flags = "defaults, absvalue" would make the noise eased or not eased based on if it's being used for 2d or 3d noise
<hmmmm> by the way, you understand the flags specifier format, right?
<hmmmm> there's the comma-delimited string format, and then there's the table format
<hmmmm> "flag1, flag2" sets flag 1 and flag 2
<hmmmm> "noflag1, flag2" specifically unsets flag1 in case it's set by default, and sets flag2
<hmmmm> flags = { flag1 = true, flag2 = true } in table format
<hmmmm> or...
<hmmmm> flags = { flag1 = false, flag2 = true }  which is equivalent to flags = { noflag1 = true, flag2 = true }
<paramat> and luaperlinnoise [in the C++ code] is the lua wrapper around the new noise stuff?
<hmmmm> LuaPerlinNoise has been around since forever... I just updated it so that it can take advantage of the new parameters
<hmmmm> also you weren't able to specify coordinate-specific spread factors
<hmmmm> the (250.0, 250.0, 250.0) thing
<hmmmm> how much the noise is spread out by :)
<hmmmm> celeron seems to have previously called that "scale", but i use the word scale for what the end result is multiplied by
<hmmmm> which is usually what scaling represents...
<paramat> yeah scale is the old wordage for spread
<hmmmm> i didn't realize my terminology was conflicting until i read LuaPerlinNoise's ctor
<paramat> so now for getting perlin noise at point in lua we can use the same noiseparam format that's used for getting lua perlinmaps?
<hmmmm> yea
<paramat> great i have been wanting that
EDIT Corrected some details and added content to this post.
Last edited by paramat on Thu Dec 18, 2014 20:21, edited 5 times in total.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by TenPlus1 » Post

Paramat: I've followed instruction and added the necessary lines to minetest.conf and to Ethereal mod to clear biomes and such before creating new one's, but... on a fresh using 'test' as seed I end up in lava and from then outwards it's all bamboo, none of the other biomes make an appearance... Is this a bug or have I missed something ???

hmmmm
Member
Posts: 47
Joined: Tue Apr 02, 2013 04:04

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by hmmmm » Post

??? Spread doesn't need Z to be equal to 1 for 2d noise
Just the {x,y,z} size value passed as a parameter when creating noise map objects do.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Thanks hmmmm, i had misunderstood you on IRC, now corrected.
TenPlus1, thanks for testing mgv7 biomes, so much new mapgen and noise stuff has been added recently it's taking me a long time to check it all.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Another correction to my last post above, flags are in comma-delimited string format (requires quotes around flags), or table format. See hmmmm's explanation for details.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Since a week or so ago mgv7 filler depth has been reduced. For some reason average filler depth was 2 * 'depth_filler', now the average filler depth is 'depth_filler' as it should be. In the past you may have noticed this unusually deep filler and reduced your value of 'depth_filler' to compensate, if so now you may want to increase it again.
The depth of filler is actually varied by noise, the variation being roughly -1 to +1 node but could occasionally be as large as -2 to +2 nodes.
Last edited by paramat on Sun Dec 21, 2014 09:29, edited 1 time in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

Complain or not - if someone has chosen to release his/her work under CC with the ND attribution, then I won't be able to change dependencies.
My point is, it's the engine that should provide means to allow users to have additional content licensed under any license.
However, I got your point, paramat. Wouldn't disturb you about this if you'll say that won't be fixed ;)

So, about the layers...
The mgv5/v7 biome API already has layers: use 'height min' and 'height max' to stack them up, you can have up to 256 biomes registered so plenty for each layer. For each mapchunk the biome API sees which biomes are active for that altitude and will calculate biomes accordingly.
How can I create 2 layers with a "sky" above each?
To make myself clearer I'd like to make an example:
Say, I'm to register a biome that would be "on the top". That's perfectly doable with as many biomes as I would like to (I barely would want more than 50).

Then I'd like to have another biome underneath it. But with it's own hills and mountains.
It should be a 1000 meters below the "top one", so there won't be any blocks visible above the player.

I believe that's not doable with the current mgv5/7. Or is it?
Do you have any examples that don't use LVM? :)

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

4aiman wrote:I believe that's not doable with the current mgv5/7.
Or is it? Do you have any examples that don't use LVM? :)
Correct, layers as you describe are not possible with v5/v7. Lua mapgen could do it though.

Nope, LVM is essential for lua mapgen, without LVM you would wait 1min per chunk.
Last edited by paramat on Sun Dec 21, 2014 07:41, edited 2 times in total.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Now that a default grassland biome has been added to builtin, 'clear registered biomes' must be added to any mod that registers biomes, to avoid the builtin biome merging into the mod's biomes. Add this line immediately before registering your biomes:

Code: Select all

minetest.clear_registered_biomes()
Of course you should be doing this already since another mod may have registered biomes and decorations before yours. The mod that 'wins' is decided by setting dependancies to make it run last. You should get in the habit of clearing both biomes and decorations before registering your own, see the post in this thread on this subject.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Post deleted, issue is covered in lua voxel manipulator thread.
Last edited by paramat on Tue Jan 06, 2015 07:00, edited 2 times in total.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

A request to the forum admin: please do not delete this thread until 0.4.12 as it contains so much useful information.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

@paramat:

Pardon me insisting, but can layers be implemented into the core mapgen?

Pardon me insisting even more, but can you add a setting that automatically unregister any biomes before loading the very first mod? What do you have against it?

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

Luckily for you, i will be suggesting that any new core mapgens make full use of the vertical space by including stacked realms or floatlands reaching to the world top. If i write a new core mapgen it will certainly have one of these features.

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

4aiman wrote:Complain or not - if someone has chosen to release his/her work under CC with the ND attribution, then I won't be able to change dependencies.
If this hypothetical situation arises, explain to the modder that changing dependancies is often essential for their mod to be usable by players, ask the modder to license their 'depends.txt' under a different licence, if they refuse they are an uncooperative idiot =) and in that situation there's nothing you can do, too bad. The devs are not going to spend their extemely limited free time coding something for a hypothetical situation caused by an idiot.
4aiman wrote:Pardon me insisting even more, but can you add a setting that automatically unregister any biomes before loading the very first mod? What do you have against it?
This can't be added because you can do that easily by making a simple mod that contains 'clear_registered_biomes()' and set the dependancies of the other mods to make it run first.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by 4aiman » Post

It's rather "won't" than "can't".

Funny enough, hmmmm was saying that register_biome() is an undocumented feature and should NOT be used at all on December, 29th.

So, rather than arguing with you on forcing modders to supply an additional mod and depend on it (which requires making a game AND breaks mods like "ethereal" - I can't see why you can't see the problem of standalone mods that use mapgen v5/v7), I want to ask about the future of your changes.

There's still no sign of documentation on biomes api.
Moreover, min and max height are disregarded by the game (0.4.11-55-gcd4d213) and biomes get placed at any altitude of the surface.

So, if biomes api is to become "released", that would clear out anything. In the end, one just can't complain that smth is amiss in the just-added feature. The only question: when?

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

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by paramat » Post

It seems too early to document it publicly, however there is some information and example biomes here viewtopic.php?f=3&t=10860
Height_min/max have been renamed y_min/max.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [0.4.11] Meshnodes, mapgen “v5”, other recent developmen

by rubenwardy » Post

4aiman wrote:There's still no sign of documentation on biomes api.
Moreover, min and max height are disregarded by the game (0.4.11-55-gcd4d213) and biomes get placed at any altitude of the surface.
Jordach wrote some documentation on Biomes: https://www.dropbox.com/s/llwlj2ua0aozk ... I.odt?dl=0
But no, it is not present in lua_api.txt yet.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Locked

Who is online

Users browsing this forum: No registered users and 3 guests