mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2025-07-03 17:00:42 +02:00
Compare commits
2 Commits
terrainlib
...
v1.0
Author | SHA1 | Date | |
---|---|---|---|
54b94e6485 | |||
09de0fd298 |
@ -5,10 +5,16 @@ Semi-procedural map generator for Minetest 5.x. It aims to create realistic and
|
||||
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
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
|
||||
Mod dependencies: `default` required, and [`biomegen`](https://github.com/Gael-de-Sailly/biomegen) optional (provides biome system).
|
||||
|
||||
|
@ -1,5 +1,17 @@
|
||||
-- rivermapper.lua
|
||||
|
||||
-- This file provide functions to construct the river tree from an elevation model.
|
||||
-- Based on a research paper:
|
||||
--
|
||||
-- Cordonnier, G., Bovy, B., and Braun, J.:
|
||||
-- A versatile, linear complexity algorithm for flow routing in topographies with depressions,
|
||||
-- Earth Surf. Dynam., 7, 549–562, https://doi.org/10.5194/esurf-7-549-2019, 2019.
|
||||
--
|
||||
-- Big thanks to them for releasing this paper under a free license ! :)
|
||||
|
||||
-- The algorithm here makes use of most of the paper's concepts, including the Planar Boruvka algorithm.
|
||||
-- Only flow_local and accumulate_flow are custom algorithms.
|
||||
|
||||
local function flow_local_semirandom(plist)
|
||||
local sum = 0
|
||||
for i=1, #plist do
|
||||
|
Reference in New Issue
Block a user