modding forest

Robsoie
Member
 
Posts: 98
Joined: Fri Apr 29, 2016 16:22

modding forest

by Robsoie » Mon May 02, 2016 09:28

Hello

I would like to have less dense forest/jungle biome, basically my goal would be to increase the minimum spacing between trees, both for navigation and performance reasons.

I gave a look into the ...\games\minetest_game\mods\default\ mapgen.lua to test things around, but unfortunately, not having any coding ability, it's rather hard for me to try to figure out what does what.
And unfortunately the wiki
http://dev.minetest.net/Mapgen_Parameters
Is not detailling much of what is going on in the mapgen file, all i seem to have understood is that there's some kind of tree noise distribution generated and that is what is used to place the trees, and for jungles it has to do with a humidity noise distribution.

So i guess to do what i would like to do, i would have to find on how to modify those humidity noise and tree noise.

Looking further in the mapgen.lua i see by example
Code: Select all
function default.register_decorations()
   minetest.clear_registered_decorations()

   -- Apple tree and log

   minetest.register_decoration({
      deco_type = "schematic",
      place_on = {"default:dirt_with_grass"},
      sidelen = 16,
      noise_params = {
         offset = 0.036,
         scale = 0.022,
         spread = {x = 250, y = 250, z = 250},
         seed = 2,
         octaves = 3,
         persist = 0.66
      },
      biomes = {"deciduous_forest"},
      y_min = 1,
      y_max = 31000,
      schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts",
      flags = "place_center_x, place_center_z",
   })


Could
noise_params = {
offset = 0.036,
scale = 0.022,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
Be what i need to edit ?
Or am i on the completely wrong track and things are elsewhere ?
 

User avatar
qwertymine3
Member
 
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: modding forest

by qwertymine3 » Mon May 02, 2016 10:43

Are you using mapgen v5/v7 or mapgen v6?

If you are using v5/v7 this is the correct place to edit. You will also have to edit the registration jungle trees to make jungles less dense.

Although it isn't documented anywhere, based off some quick testing I think I can (quickly) explain how this works.

The perlin noise is used to generate a map of probabilities of the decoration being placed on any given node. The range of probabilities should be offset +- scale.

So to reduce the density, reduce either the offset, scale or both.
The larger scale is in comparison to offset, the more variation in density you will get.

You may also want to edit spread, which is how quickly the forest density changes.
Avatar by :devnko-ennekappao:
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: modding forest

by burli » Mon May 02, 2016 11:47

Interesting. Maybe I can use this for something else
 

Robsoie
Member
 
Posts: 98
Joined: Fri Apr 29, 2016 16:22

Re: modding forest

by Robsoie » Mon May 02, 2016 17:18

Thank you, this is very helpful.
 

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

Re: modding forest

by paramat » Mon May 02, 2016 17:40

Yes offset is average density, scale is variation of density.
For jungletrees the noise is replaced by a fixed density parameter called 'fill_ratio'.
You can use a mod with 'minetest.clear_registered_decorations' as it's first line, then copy-paste all decoration definitions but with your changes. The mod should depends on default.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests