Experimental map generator for Minetest, implementing river networks, lakes, and erosion.
Go to file
Gael-de-Sailly 02f9805507 Fix river shape in confluences (less sharp riverbeds when a small rivers joins a big one)
Also cleaned and commented the code
2022-01-19 17:58:46 +01:00
terrainlib_lua Added more comments in terrainlib_lua 2022-01-07 14:48:36 +01:00
.gitignore Generate data in `river_data` instead of `data` 2020-11-14 19:12:12 +01:00
CHANGELOG.md Bump version (1.0.2) and add changelog 2022-01-10 12:44:33 +01:00
LICENSE Add license, update/improve documentation 2020-11-15 11:43:30 +01:00
README.md Remove 'default' hard dependency 2022-01-17 23:20:34 +01:00
compatibility.lua Code style consistency: use tabs for indentation in all Lua code 2021-07-24 18:55:13 +02:00
environment.yml Updated README.md and added environment.yml 2021-07-24 18:49:17 +02:00
geometry.lua Localize all global functions in load.lua and geometry.lua 2022-01-03 16:20:51 +01:00
heightmap.lua Fix river shape in confluences (less sharp riverbeds when a small rivers joins a big one) 2022-01-19 17:58:46 +01:00
init.lua Remove 'default' hard dependency 2022-01-17 23:20:34 +01:00
load.lua Localize all global functions in load.lua and geometry.lua 2022-01-03 16:20:51 +01:00
mod.conf Remove 'default' hard dependency 2022-01-17 23:20:34 +01:00
noises.lua Use builtin logging system and appropriate loglevels 2022-01-03 16:33:56 +01:00
polygons.lua Fix river shape in confluences (less sharp riverbeds when a small rivers joins a big one) 2022-01-19 17:58:46 +01:00
pregenerate.lua Use builtin logging system and appropriate loglevels 2022-01-03 16:33:56 +01:00
readconfig.py Python map viewing: read conf file, and take world folder as input 2021-07-24 17:21:21 +02:00
settings.lua Bump version (1.0.2) and add changelog 2022-01-10 12:44:33 +01:00
settingtypes.txt Corrected mistake in settingtypes 2022-01-03 12:04:49 +01:00
view.py Python map viewing: read conf file, and take world folder as input 2021-07-24 17:21:21 +02:00
view_map.py Python map viewing: read conf file, and take world folder as input 2021-07-24 17:21:21 +02:00

README.md

Map Generator with Rivers

mapgen_rivers v1.0.2 by Gaël de Sailly.

Semi-procedural map generator for Minetest 5.x. It aims to create realistic and nice-looking landscapes for the game, focused on river networks. It is based on algorithms modelling water flow and river erosion at a broad scale, similar to some used by researchers in Earth Sciences. It is taking some inspiration from Fastscape.

Its main particularity compared to conventional Minetest mapgens is that rivers that flow strictly downhill, and combine together to form wider rivers, until they reach the sea. Another notable feature is the possibility of large lakes above sea level.

Screenshot

It used to be composed of a Python script doing pre-generation, and a Lua mod reading the pre-generation output and generating the map. The code has been rewritten in full Lua for version 1.0 (July 2021), and is now usable out-of-the-box as any other Minetest mod.

Author and license

License: GNU LGPLv3.0

Code: Gaël de Sailly

Flow routing algorithm concept (in terrainlib/rivermapper.lua): Cordonnier, G., Bovy, B., & Braun, J. (2019). A versatile, linear complexity algorithm for flow routing in topographies with depressions. Earth Surface Dynamics, 7(2), 549-562.

Requirements

No required dependency, but biomegen recommended (provides biome system).

Installation

This mod should be placed in the mods/ directory of Minetest like any other mod.

Usage

It is recommended to use it only in new worlds, with singlenode mapgen. On first start, it runs pre-generation to produce a grid, from which the map will be generated. This usually takes a few seconds, but depending on custom settings this can grow considerably longer.

By default, it only generates a 15k x 15k map, centered around the origin. To obtain a bigger map, you can increase grid size and/or block size in settings, but this can be more ressource-intensive (as the map has to be loaded in full at pre-generation).

Settings

Settings can be found in Minetest in the Settings tab, All settings -> Mods -> mapgen_rivers.

Most settings are world-specific and a copy is made in mapgen_rivers.conf in the world folder, during world first use, which means that further modification of global settings will not alter existing worlds.

Map preview

The Python script view_map.py can display the full map. You need to have Python 3 installed, as well as the libraries numpy, matplotlib, and optionally colorcet. For conda users, an environment.yml file is provided.

It can be run from command line by passing the world folder. Example:

./view_map.py ~/.minetest/worlds/test_mg_rivers