Gael-de-Sailly
462942cc22
Use iterative finite differences for diffusion, instead of gaussian blur
...
Allows variable diffusion coefficients
2020-12-27 13:46:25 +01:00
Gael-de-Sailly
1b96f52e47
Decrease variations of parameter m
2020-12-27 13:45:24 +01:00
Gael-de-Sailly
3ccb6932ad
Implement simple tectonics.
...
Uplift and subsidence are determined with a noise, at every iteration.
There is no distinctive pattern like tectonic plates, just vertical movements
disturbing rivers from their equilibrium state, and thus creating more diversity.
More lakes and waterfalls especially.
2020-12-24 15:35:27 +01:00
Gael-de-Sailly
32f3cd9925
Fixed 3D noise map, and removed catchment_reference
...
Now K and m are determined independently.
Alsoo removed debug plotting.
2020-12-24 15:33:03 +01:00
Gael-de-Sailly
ae46ada648
Use a class for noise map generation, and add a function for 3D slice of a 2D noise.
2020-12-24 15:33:03 +01:00
Gael-de-Sailly
4b1d11dd73
Implement variable K and m erosion parameters
...
For now noise parameters are hardcoded.
2020-12-24 15:30:35 +01:00
Gael-de-Sailly
c175f2bbf7
Document conf files
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
ca68738ba7
Reworked parameters, and rename 'terrain.conf' to 'terrain_default.conf'
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
85e545d5ac
Fixed sea level variations
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
e0aecdc3f3
Added a second method for local flow calculation. It is possible to switch between them using the 'flow_method' parameter.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
83728cc932
Fixed lakes elevation
...
There were sometimes missing water patches near a lake's edge, when the neighbour catchment area was lower.
This commit allows to divide a cell into several mini-catchment basins, to fill only a part of it with water.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
9ffa150263
Added function 'noisemap' to generate a noise map with a quite unified parameter set, and an option for logarithmic noise. For future use.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
2a9335332b
Added optional sea level variations for the simulation.
...
This results in more varied coastline morphologies.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
9b4a9b2516
Rework default erosion parameters,
...
Fix ignored values of K and m,
and changed processes order.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
7529291ab4
For bounds.py (calculation of offsets), use the same data type as rivers
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
b4f97bec61
For noise map seed: don't go over ±4096, to prevent rounding errors on coordinates (because noise library uses 32-bit floats)
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
3dc874a494
Added description of the algorithm + acknowledge the authors of the paper.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
f0dddee33c
Lakes map: keep initial height (reduces file size)
...
Lake height is calculated for every basin, and there is a lake if lake height is higher than ground height. If it is lower, there is no lake.
In that case, it was previously raised to ground level, but since this can be done in Lua, we can write initial lakes height in the files.
This has the advantage of reducing file size, since there are bigger areas of equal values, that are more efficiently compressed.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
ecd2c7d3f9
Completely change flow routing algorithm,
...
use a local flow calculation, determine depressions, and link them using a minimum spanning tree (Boruvka's algorithm).
This is based on a paper by Cordonnier et al, 2019.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
40098d6be3
Use standard int instead of uint8, int32, etc.
...
Much faster with NumPy.
2020-12-24 14:48:17 +01:00
Gael-de-Sailly
faef1658a9
Fixed map centering, and converted polygon coordinates to map nodes instead of grid nodes.
2020-12-22 16:38:30 +01:00
Gael-de-Sailly
d5cf4a6267
Optionally center the map around x=0 z=0
2020-12-20 22:28:54 +01:00
Gael-de-Sailly
53f88d337d
Protect map preview from exceptions
...
Since map preview is optional, an exception should not propagate to terrain calculation, so print an error message + traceback but keep the script running.
2020-11-25 13:12:24 +01:00
Gael-de-Sailly
3644965842
Fix bool settings being improperly loaded as strings
2020-11-17 20:56:02 +01:00
Gael-de-Sailly
9725979363
Fix increments for argument parsing
2020-11-17 20:45:11 +01:00
Gael-de-Sailly
ebacd3cdd4
Add license, update/improve documentation
2020-11-15 11:43:30 +01:00
Gael-de-Sailly
fc0a158385
Disable glaciers by default
2020-11-15 11:26:50 +01:00
Gael-de-Sailly
050ca3b779
Change demo data, update to a grid using new default parameters
2020-11-15 11:19:28 +01:00
Gael-de-Sailly
1f41423104
Print a clear message when grid is ready
...
Also use plt.pause before plotting, ensuring plot is updated in real time
2020-11-15 11:13:42 +01:00
Gael-de-Sailly
52766e8918
Added settingtypes
2020-11-15 11:10:19 +01:00
Gael-de-Sailly
28c674d57c
Decrease default diffusion factor
2020-11-14 19:14:09 +01:00
Gael-de-Sailly
90f60ea6fb
typo
2020-11-14 19:13:58 +01:00
Gael-de-Sailly
803114aaab
Generate data in river_data
instead of data
2020-11-14 19:12:12 +01:00
Gael-de-Sailly
9594a79f8b
Configurable output directory
...
Now relative to the directory the script is *run in*.
2020-11-14 18:26:13 +01:00
Gael-de-Sailly
d93234c9b7
Moved Python files inside a folder (package), except the 2 that are directly executable
2020-11-14 17:35:27 +01:00
Gael-de-Sailly
7acd0af550
Use biomegen.generate_all
2020-11-14 17:35:03 +01:00
Gael-de-Sailly
3792cd5dc8
Added support for biomegen mod
2020-11-14 17:35:03 +01:00
Gael-de-Sailly
6b9c091dd5
Fix file opening mode on the Lua side, to avoid crashes on Windows
2020-11-14 17:31:36 +01:00
Gael-de-Sailly
b90cecdaf7
Allow command-line options for Python processing
2020-11-14 14:30:53 +01:00
Gael-de-Sailly
c33f2d9582
Python side: rework config system.
...
Load `terrain.conf` of the script directory by default.
Add a `terrain_higher.conf` for alternative terrain.
2020-11-14 12:19:40 +01:00
Gael-de-Sailly
8a15bc924d
Dynamic map displaying
...
Map is displayed at every iteration if matplotlib library is installed
2020-11-14 12:05:52 +01:00
Gael-de-Sailly
3fda369fb5
Rewritten map viewer
...
Now displays map statistics even if there is no matplotlib
2020-11-13 11:04:27 +01:00
Gael-de-Sailly
30136bf60a
Added scale (blocksize) parameter for view_map.py
2020-11-10 13:19:20 +01:00
Gael-de-Sailly
9475b49b8d
Removed duplicate calls to 2 scripts
2020-11-10 13:18:02 +01:00
Gael-de-Sailly
36b49a7fe2
Add settings for parameters in terrain_rivers.py
2020-07-21 14:12:20 +02:00
Gaël de Sailly
103cd49d78
Optionally disable distorsion
...
by setting 'mapgen_rivers_distort = false' in minetest.conf
2020-07-21 14:01:29 +02:00
Gaël de Sailly
25c5cb2e1f
Reverse axes order for heightmaps (iterate in Z direction first instead of X)
2020-07-21 12:46:23 +02:00
Gael-de-Sailly
6f43430574
Added glaciers, and re-organized noise definitions
2020-05-24 12:09:21 +02:00
Gael-de-Sailly
625768f967
Added snow and ice in function of temperature.
...
Uses noise parameters of builtin biomegen
2020-05-23 18:13:00 +02:00
Gael-de-Sailly
4edd1a946e
Horizontal shifting according to 3D noises:
...
makes slopes more irregular and natural-looking, allows overhanging.
This is done by generating an intermediate 2D elevation map and, for each node in 3D, add a 2D offset vector to the position, and seek this position on the heightmap.
2020-05-23 15:52:16 +02:00