mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2025-07-02 16:30:44 +02:00
Changed the way river width is determined in settings
- min_catchment now in square nodes instead of cells - River widening power as input instead of calculating it from max_catchment
This commit is contained in:
@ -90,11 +90,9 @@ if mapgen_rivers.settings.center then
|
||||
map_offset.z = blocksize*Z/2
|
||||
end
|
||||
|
||||
-- Width coefficients: coefficients solving
|
||||
-- wfactor * min_catchment ^ wpower = 1/(2*blocksize)
|
||||
-- wfactor * max_catchment ^ wpower = 1
|
||||
local wpower = math.log(2*blocksize)/math.log(max_catchment/min_catchment)
|
||||
local wfactor = 1 / max_catchment ^ wpower
|
||||
local min_catchment = mapgen_rivers.settings.min_catchment / (blocksize*blocksize)
|
||||
local wpower = mapgen_rivers.settings.river_widening_power
|
||||
local wfactor = 1/(2*blocksize * min_catchment^wpower)
|
||||
local function river_width(flow)
|
||||
flow = math.abs(flow)
|
||||
if flow < min_catchment then
|
||||
|
Reference in New Issue
Block a user