Home

Awesome

Valleys Mapgen

Mapgen mod for Minetest 0.4.12+. Work in progress, not finished. Mod created by Gael-de-Sailly and now developed by Gael-de-Sailly, duane-r and vlapsley.

Screenshot

Discussion on Minetest Forums

How to use it ?

Download

  1. Download here the .zip file
  2. Extract the .zip archive with any archive manager (WinZip, 7-zip, file-roller…)
  3. Rename the directory to valleys_mapgen and place it in the /mods directory of Minetest.

Download using Git

Git is a very useful tool to manage repositories such as Valleys Mapgen. Open the terminal (in Linux) or the Git shell (Windows), and set the working directory (the mods folder) using cd: for example cd /home/gael/.minetest/mods or cd C:\Users\gael\minetest-0.4.13\mods. Download Valleys Mapgen: git clone https://github.com/Gael-de-Sailly/valleys_mapgen.git. Next time, you can automatically update VMG with the same cd command, and git pull origin master.

Use

Mods compatibility

Keep in mind that mapgen mods as this one are very powerful mods, that may interfere with some other mods. So, be careful when enabling many mods, the result might be unplayable. Valleys Mapgen is incompatible with all other "complete" mapgens like Watershed, Ethereal, Nore's Mg. Some mods that only partially rewrite the terrain will work with VMG: (Cave Realms, Darkage, More Ores, Nether (in this case you must add valleys_mapgen? in nether/depends.txt)). Plantlife and More Trees work but the respective biomes of the plants are not respected. It's still compatible with most of the mods that don't affect mapgen (Areas, World Edit, Mesecons, Home decor, …)

Settings

There are many settings that can be changed by the user. There are 3 ways to change the settings:

Plants API for modders

The Plants API has been introduced on October 24th, 2015. It allow mods to generate plants directly on the map.

To begin

First, make sure that you've added the valleys_mapgen dependancy in your depends.txt (followed by a question mark if optional) The only function is vmg.register_plant. It registers a plant that will be generated during mapgen. All plant parameters are passed to this function.

Parameters

Syntax (example for jungle tree)

vmg.register_plant({
	nodes = {
		trunk = "default:jungletree",
		leaves = "default:jungleleaves",
		air = "air", ignore = "ignore",
	},
	cover = 0.5,
	density = 0.06,
	priority = 73,
	check = function(t, pos)
		return t.v15 < 0.7 and t.temp >= 1.9 and t.humidity > 2 and t.v16 > 2
	end,
	grow = function(nodes, pos, data, area)
		local rand = math.random()
		local height = math.floor(8 + 4 * rand)
		local radius = 5 + 3 * rand

		vmg.make_jungle_tree(pos, data, area, height, radius, nodes.trunk, nodes.leaves, nodes.air, nodes.ignore)
	end,
})

nodes

List of nodes that will be used, could be a table or a simple string. In this table, all strings are converted into content IDs.

Many syntaxes are possible, with their default behaviour (see grow):

All cases are possible, but other cases can't be managed by default and need a grow function (see grow), like the example above with jungle tree. Anyway, the strings in this table are recursively converted into map content IDs.

cover

Decimal number between 0 and 1, which determines the proportion of surface nodes that are "reserved" for the plant. This doesn't necessarily mean that there is a plant on the node (see density), but this "cover" prevents other plants with lower priority from spawning on said nodes.

density

Number between 0 and cover. Proportion of nodes that are effectively covered by the plant.

Examples:

priority

Integer generally between 0 and 100 (no strict rule :) to determine which plants are dominating the others. The dominant plants (with higher priority) impose their cover on the others.

check

Function to check the conditions. Should return a boolean: true, the plant can spawn here ; false, the plant can't spawn and doesn't impose its cover. It takes 2 parameters:

check = function(t, pos)
	return t.v15 < 0.7 and t.temp >= 1.9 and t.humidity > 2 and t.v16 > 2
end,

grow

Optional function to override the default behaviour (see nodes) for complex plants like trees. It should "simply" generate the plant. It takes 5 parameters:

grow = function(nodes, pos, data, area)
	local rand = math.random()
	local height = math.floor(8 + 4 * rand)
	local radius = 5 + 3 * rand

	vmg.make_jungle_tree(pos, data, area, height, radius, nodes.trunk, nodes.leaves, nodes.air, nodes.ignore)
end,

Changelog

1.0 (Saturday March 7, 2015)

1.0 ~> 1.1 (Sunday March 8, 2015)

1.1 ~> 1.2 (Tuesday March 17, 2015)

1.2 ~> 1.3 (Wednesday April 8, 2015)

1.3 ~> 2.0 (Sunday May 31, 2015)

2.0 ~> 2.1 (Saturday July 4, 2015)

2.1 ~> 2.2 (Saturday September 26, 2015)

2.2 ~> 2.3 (Friday September 21, 2018)

Version of March 2016 initially considered as a developement version, and finally released after a 2 years long hiatus