[Mod] Map generator with Rivers [mapgen_rivers]

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

[Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Map Generator with Rivers (mapgen_rivers v1.0)

This is a map generator I have been developing since April 2020 (my "lockdown project"...), that aims at being as realistic as possible.

It introduces a mapgen approach that is different from usual procedural noise-based mapgens. The concept is to simulate surface geological phenomena like river flowing and erosion, using physical equations, while other mapgens generally use noises to empirically mimick landforms.

It generates rivers whose behaviour is close to real-life: they 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 (in fact any enclosed depression will form a lake).

The mod pre-generates the map at first start of a world, by creating something that I call a "grid", that is stored in the world folder as raw data, and represents a downscaled map. It's the moment at which flow and erosion calculations are at play, because they need to act on the full map (since they can have unpredictable distant effects). During actual map generation, the grid is upscaled (15x by default) and smaller-scale features are added with noise.

Pre-generation used to be done with a separate Python program, but it has been rewritten in Lua for version 1.0 (July 2021).
(pictures are outdated but the concept is still the same)

Pre-generation: Initial and final topography for a tiny 50x50 grid.Image

Map generation on Minetest: using this grid, with simplest possible settings. The grid is upscaled: each grid cell becomes a 12x12 square, so the map is 600x600. Notice how the cell pattern is obvious on river angles:Image
Same map with twisting/distorsion on Lua side, and biomes, the cell pattern is practically hidden:Image Pre-generation:
  • Initial topography is using Perlin noise
  • Flow calculation: Water flow direction is determined at every point from local slope. Flow accumulation is computed in order to find rivers and their respective flux (depending on catchment area), and depressions are filled with lakes.
  • River erosion simulation: Solves the equation E = K × D^m × S (Stream power law), that determines erosion rate E in function of water flux D (for "discharge"), downstream river slope S, and parameters K and m. This is a simplistic yet famous model, still widely used in geomorphological modelling.
  • Diffusive erosion, for now only active on sea/lake floor. This type of erosion simulates landslides on the long term, and tend to hide smaller-scale features. It is a simple Gaussian blur.
  • Isostatic equilibrium: compensation of loss/gain of weight by uplift/subsidence, only at large scale (using a large-windowed Gaussian blur). This avoids the case of mountain ranges being completely flattened by erosion. Instead, they tend toward an equilibrium.
  • Grid twisting: The grid being a regular square grid, the generated rivers make unnatural square angles. This computation step allows to smooth their trajectory by giving every grid node an X/Z offset that locally minimizes the length of river sections. It computes the forces that would act on every grid node if the rivers were mechanical springs (and the strength of these springs depend on rivers fluxes).
In-game map generation:
  • Horizontal distorsion using two 3D noises (one for each X/Z direction). They define for every point an horizontal vector determining an offset. This distorsion breaks the regularity of the grid (otherwise flagrant), but also nodes at different heights can have different offset vectors: the landscape can thus be sheared in random directions, allowing steep valleys/mountains to have very nice-looking overhangs (that would otherwise not be possible because all other calculations are strictly 2D).
  • Biomes: complete biome system using the biomegen mod if present (that was at first supposed to be a part of the present project until I realized it might be of general interest), or a basic temperature and elevation system with grass and snow.
  • Glaciers: in very cold areas, widened rivers made out of ice, to resemble glaciers. Optional and disabled by default.
Features
  • Spawn players at ground level
  • Place rivers 1 node lower to avoid overflows
  • Use physical equations derived from Manning formula to control rivers width and depth
  • Add more small-scale features during mapgen (rocks, small hills, small ponds...)
  • Replace base noise (the primordial terrain over which erosion is applied) by a more geologically realistic topography
  • Implement variable erosion parameters
  • Add more features during pregeneration, like faults, volcanoes, meteor craters... There is a big potential here, many things could be implemented and could give to every world and every place a different geological history.
Fixes
  • Harmonize settings so that all units are in Minetest nodes (some are still in grid nodes)
  • Fix seed problems at pregen (lua not able to handle uint64)
Internal
  • Put all settings at the same place, refactor settings.lua and create a separate file for default values
  • Improve version detection and backward compatibility system
  • Clean init.lua and move mapgen loop out of it
  • Find a better serialization format for the grid
Screenshots using mapgen_rivers + biomegen:
Image The first 4 screenshots use Ethereal as well.ImageImageImageImageImageImageImageImageImageImageImageImageImageImage

Download

Latest
v1.0.2

Browse on Gitlab

Dependencies: default (removed dependency in 1.0.2-dev)
Recommended: biomegen
--> biomegen was originally designed to be part of this project, until I realized it may have other uses.

License: GNU LGPL v3.0
Last edited by Gael de Sailly on Mon Jan 17, 2022 23:11, edited 13 times in total.
Just realize how bored we would be if the world was perfect.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by twoelk » Post

exciting!!

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Lone_Wolf » Post

Awesome work. Would be nice if this worked with other games too
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

This looks very interesting. I hope I will find some time to check this out next weekend.

User avatar
Panquesito7
Member
Posts: 27
Joined: Tue Jun 09, 2020 05:37
GitHub: Panquesito7
IRC: Panquesito7
In-game: Panquesito7
Contact:

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Panquesito7 » Post

Very nice mod! Gotta have to test this mod soon! 👍

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

could the OP or others post some pre-generated maps that are 30000 x 30000 nodes? I tried installing the python libraries and ran into missing files problems with noise right away

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

also, and this be confined to a certain y range using the other_worlds mod or similar?

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

MisterE wrote:
Wed Nov 18, 2020 21:39
could the OP or others post some pre-generated maps that are 30000 x 30000 nodes? I tried installing the python libraries and ran into missing files problems with noise right away
What error do you get and what installation method do you use? For my part I use pip and all works fine. Also make sure you are on Python 3.

I'm thinking about stopping to use noise, I'm aware it has problems in some cases even if it works well for me. Also it has no seed system, and no 3D simplex noise (perlin noise is not adapted because its orthogonal nature would bias the rivers that are defined by noise gradients). I may switch to opensimplex instead.

About map size, for now I recommend not exceeding 2000x2000 grid (which would give a 24000x map by default, or 30000x with a blocksize of 15), the format in which the grid is saved is currently not adapted to big maps, because there is no way to load only a part of it. I should rework this, but this may lead to a break of compatibility with older worlds.

More pre-generated maps are a good idea, the mod currently includes one but it is quite small, to keep the download light (this demo map will load if you start the game directly). Also did you manage to use the one I posted the other day?
MisterE wrote:
Wed Nov 18, 2020 21:40
also, and this be confined to a certain y range using the other_worlds mod or similar?
For now there is nothing limiting in y range. I have no idea how my mod (and Lua mapgens in general) behave with multi-layers mods, but I think there is high risk of bugs, especially if the mod loading order is not controlled. I could look into some of them to see how they work and how I can make mapgen_rivers compatible.

Oooh, that's already many things to do... I should write a clean ToDo list before all, and even if I am under lockdown, I don't have unlimited time ;)
Just realize how bored we would be if the world was perfect.

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

This is really fun to play with and the generated maps look very good so far.
Very realistic flow of the rivers and the eroded valleys.

Do not miss out to install matplotlib and colorcet like suggested in the github repo page
and you will get informed by a nice generated map on your screen :)

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

Is there a way to make rivers deeper and wider ?
I played around a bit with different values, but it seems that river size is
depending on luck and initial map seed.

so far I had good results for small maps with this config :

Code: Select all

mapsize = 350
scale = 400
vscale = 400
offset = 0
persistence = 0.7
lacunarity = 2.0

K = 3
m = 0.35
d = 0.2
sea_level = 1
flex_radius = 30

time = 10
niter = 15
~              

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Thank you for your feedback! :)
Glad to see that you managed to use the generate script.
Gundul wrote:
Sat Nov 21, 2020 10:52
Do not miss out to install matplotlib and colorcet like suggested in the github repo page
and you will get informed by a nice generated map on your screen :)
Oh yes I should add this on the description on the forum.
I think I did a bad job writing this description, I should rewrite parts of it, and make it more attractive.
Also it's not too late to find a better name, I'm thinking of it.
Gundul wrote:
Sat Nov 21, 2020 17:25
Is there a way to make rivers deeper and wider ?
I played around a bit with different values, but it seems that river size is
depending on luck and initial map seed.
[...]
A river's width depends on its catchment basin (also called drainage basin: surface in which a water drop will eventually flow in a given river), so there are small and big rivers.
Catchment basins are calculated on Python side, but river width is also configurable on Lua side.

If you want to increase these catchment areas: make continents bigger! You can increase scale, or add an offset to terrain elevation (like offset = 30).
On Lua side, you can play with max catchment, in settings tab (or mapgen_rivers_max_catchment in minetest.conf), if you decrease it, you will have wider rivers. Technically it controls the catchment area at which rivers will reach their maximal width (they can't exceed 2 full cells in width = 24 nodes if blocksize is 12).
River depth : increase riverbed slope in settings tab.
Just realize how bored we would be if the world was perfect.

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

Gael de Sailly wrote:
Sat Nov 21, 2020 21:21
Gundul wrote:
Sat Nov 21, 2020 10:52
Do not miss out to install matplotlib and colorcet like suggested in the github repo page
and you will get informed by a nice generated map on your screen :)
Oh yes I should add this on the description on the forum.
I think I did a bad job writing this description, I should rewrite parts of it, and make it more attractive.
Also it's not too late to find a better name, I'm thinking of it.
I do not think it needs an other name. It does exactly what the name says.
And your description is good also, only I guess, most people are not too much interested into
technical details. Reading is inconvenient XD. If you like to attract people keep text low and
add pictures and/or clips. :)

The map is really important when generating new terrain. It gives you first glance even the script is
still calculating. Second, after finishing you can zoom in and out and you have a cursor saying the
exact coordinates by just pointing. Take that coords, multiply with 12, add any vertical value and
you can teleport exactly to any point on the map.
Gael de Sailly wrote:
Sat Nov 21, 2020 21:21

A river's width depends on its catchment basin (also called drainage basin: surface in which a water drop will eventually flow in a given river), so there are small and big rivers.
Catchment basins are calculated on Python side, but river width is also configurable on Lua side.

If you want to increase these catchment areas: make continents bigger! You can increase scale, or add an offset to terrain elevation (like offset = 30).
On Lua side, you can play with max catchment, in settings tab (or mapgen_rivers_max_catchment in minetest.conf), if you decrease it, you will have wider rivers. Technically it controls the catchment area at which rivers will reach their maximal width (they can't exceed 2 full cells in width = 24 nodes if blocksize is 12).
River depth : increase riverbed slope in settings tab.
Thanks that already helped a lot. I already got some very good results.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Gundul wrote:
Sun Nov 22, 2020 10:39
And your description is good also, only I guess, most people are not too much interested into
technical details. Reading is inconvenient XD. If you like to attract people keep text low and
add pictures and/or clips. :)
Thanks for the advice!
Yes that's what I mean when I say it's bad. In fact I knew that some people were waiting for it, so I did not spend too much time on this description before releasing. In fact it's partly made of paragraphs I cut out in the Readme!
I think I will make a video presentation/tutorial, and a more "visual" description for the forum, with pictures and keywords. And the technical details should go in a spoiler.
Gundul wrote:
Sun Nov 22, 2020 10:39
The map is really important when generating new terrain. It gives you first glance even the script is
still calculating. Second, after finishing you can zoom in and out and you have a cursor saying the
exact coordinates by just pointing. Take that coords, multiply with 12, add any vertical value and
you can teleport exactly to any point on the map.
Oh yes I just see that I didn't say anything about map preview on the forum!
BTW you have another script to view the map, view_map.py, that accepts a scale parameter:

Code: Select all

view_map.py river_data 12
Just realize how bored we would be if the world was perfect.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by twoelk » Post

Would be great if Amidst for Minetest would have suport for this and could be used as seed preview tool
Last edited by twoelk on Tue Nov 24, 2020 14:37, edited 1 time in total.

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

here is the error I get when I try to install noise:

Code: Select all

C:\Users\gbrru>pip install noise
Collecting noise
  Using cached noise-1.2.2.tar.gz (125 kB)
Building wheels for collected packages: noise
  Building wheel for noise (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\gbrru\AppData\Local\Temp\pip-wheel-5sx6_gvk'
       cwd: C:\Users\gbrru\AppData\Local\Temp\pip-install-cnak1m0u\noise\
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\noise
  copying perlin.py -> build\lib.win-amd64-3.6\noise
  copying shader.py -> build\lib.win-amd64-3.6\noise
  copying shader_noise.py -> build\lib.win-amd64-3.6\noise
  copying test.py -> build\lib.win-amd64-3.6\noise
  copying __init__.py -> build\lib.win-amd64-3.6\noise
  running build_ext
  building 'noise._simplex' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for noise
  Running setup.py clean for noise
Failed to build noise
Installing collected packages: noise
    Running setup.py install for noise ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\gbrru\AppData\Local\Temp\pip-record-l4mg4vvk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\gbrru\appdata\local\programs\python\python36\Include\noise'
         cwd: C:\Users\gbrru\AppData\Local\Temp\pip-install-cnak1m0u\noise\
    Complete output (14 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\noise
    copying perlin.py -> build\lib.win-amd64-3.6\noise
    copying shader.py -> build\lib.win-amd64-3.6\noise
    copying shader_noise.py -> build\lib.win-amd64-3.6\noise
    copying test.py -> build\lib.win-amd64-3.6\noise
    copying __init__.py -> build\lib.win-amd64-3.6\noise
    running build_ext
    building 'noise._simplex' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\gbrru\AppData\Local\Temp\pip-record-l4mg4vvk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\gbrru\appdata\local\programs\python\python36\Include\noise' Check the logs for full command output.

I tried installing Microsoft C++ Build Tools but it must not have worked bc the error remains

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

Example map server:


For all those lazy reading and who love it even more convenient. A pregenerated map
with fly, fast, teleport and settime priv on a server.

The map:
Image

The server:

"rivers"
gundul.ddnss.de
port 39155

Check it out out and see one of the most realistic
mapgens in minetest !

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Oh thank you so much for your support! Very nice map on this server.
Logged on this evening, and discovered the spectacular landscapes around 1000;2000 (80;160 on the preview map), where the big (and very high) lake at the left flows into a complex canyon system. Lake outlet and canyonImage

Same valley but further downstreamImage

Detail of the curve at the center of previous pictureImage
Just realize how bored we would be if the world was perfect.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

MisterE wrote:
Mon Nov 23, 2020 13:35
here is the error I get when I try to install noise:

Code: Select all

C:\Users\gbrru>pip install noise
Collecting noise
  Using cached noise-1.2.2.tar.gz (125 kB)
Building wheels for collected packages: noise
  Building wheel for noise (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\gbrru\AppData\Local\Temp\pip-wheel-5sx6_gvk'
       cwd: C:\Users\gbrru\AppData\Local\Temp\pip-install-cnak1m0u\noise\
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\noise
  copying perlin.py -> build\lib.win-amd64-3.6\noise
  copying shader.py -> build\lib.win-amd64-3.6\noise
  copying shader_noise.py -> build\lib.win-amd64-3.6\noise
  copying test.py -> build\lib.win-amd64-3.6\noise
  copying __init__.py -> build\lib.win-amd64-3.6\noise
  running build_ext
  building 'noise._simplex' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for noise
  Running setup.py clean for noise
Failed to build noise
Installing collected packages: noise
    Running setup.py install for noise ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\gbrru\AppData\Local\Temp\pip-record-l4mg4vvk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\gbrru\appdata\local\programs\python\python36\Include\noise'
         cwd: C:\Users\gbrru\AppData\Local\Temp\pip-install-cnak1m0u\noise\
    Complete output (14 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\noise
    copying perlin.py -> build\lib.win-amd64-3.6\noise
    copying shader.py -> build\lib.win-amd64-3.6\noise
    copying shader_noise.py -> build\lib.win-amd64-3.6\noise
    copying test.py -> build\lib.win-amd64-3.6\noise
    copying __init__.py -> build\lib.win-amd64-3.6\noise
    running build_ext
    building 'noise._simplex' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\gbrru\appdata\local\programs\python\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"'; __file__='"'"'C:\\Users\\gbrru\\AppData\\Local\\Temp\\pip-install-cnak1m0u\\noise\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\gbrru\AppData\Local\Temp\pip-record-l4mg4vvk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\gbrru\appdata\local\programs\python\python36\Include\noise' Check the logs for full command output.

I tried installing Microsoft C++ Build Tools but it must not have worked bc the error remains
I thought there were binaries available for Python libs on Windows, but apparently that's not the case.
For this I'm sorry but I don't have any experience of compilation under Windows (I work on Linux only).
Is anybody able to help MisterE?
Just realize how bored we would be if the world was perfect.

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

well I have a linux VM, so Ill use that, and let you know about any problems

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

Gundul wrote:
Mon Nov 23, 2020 18:00
Example map server:


For all those lazy reading and who love it even more convenient. A pregenerated map
with fly, fast, teleport and settime priv on a server.

The map:
Image

The server:

"rivers"
gundul.ddnss.de
port 39155

Check it out out and see one of the most realistic
mapgens in minetest !
There is a lot of lag when exploring. I am not complaining, but is there a simple explanation--- Is it that the server does not have a lot of resources, or is it that the mapgen is laggy in itself?

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

The server has a lack of resources. Even though the map is already calculated with /emergeblocks, it looks like some chunks are recalculated when visiting. The server hardware isn't made for calculating with lua mapgens. For just showing it is enough.

[Edit] should be better now

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

so I installed the req'd packages with linux mint, and ran the script, and got this error.

Code: Select all

sudo python3 /usr/share/games/minetest/mods/mapgen_rivers/generate.py
terrain.conf river_data
Initializing model
Traceback (most recent call last):
  File "/usr/share/games/minetest/mods/mapgen_rivers/generate.py", line 98, in <module>
    terrainlib.update(model.dem, model.lakes, t=5, title='Initializing...')
  File "/usr/share/games/minetest/mods/mapgen_rivers/terrainlib/view.py", line 52, in update
    view_map(*args, **kwargs)
  File "/usr/share/games/minetest/mods/mapgen_rivers/terrainlib/view.py", line 34, in view_map
    plt.imshow(np.flipud(rgb), extent=extent, interpolation='antialiased')
  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 2671, in imshow
    __ret = gca().imshow(
  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 1601, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 5675, in imshow
    im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 855, in __init__
    super().__init__(
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 214, in __init__
    self.set_interpolation(interpolation)
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 756, in set_interpolation
    raise ValueError('Illegal interpolation string')
ValueError: Illegal interpolation string
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_games_minetest_mods_mapgen_rivers_generate.py.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/games/minetest/mods/mapgen_rivers/generate.py", line 98, in <module>
    terrainlib.update(model.dem, model.lakes, t=5, title='Initializing...')
  File "/usr/share/games/minetest/mods/mapgen_rivers/terrainlib/view.py", line 52, in update
    view_map(*args, **kwargs)
  File "/usr/share/games/minetest/mods/mapgen_rivers/terrainlib/view.py", line 34, in view_map
    plt.imshow(np.flipud(rgb), extent=extent, interpolation='antialiased')
  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 2671, in imshow
    __ret = gca().imshow(
  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 1601, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 5675, in imshow
    im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 855, in __init__
    super().__init__(
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 214, in __init__
    self.set_interpolation(interpolation)
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 756, in set_interpolation
    raise ValueError('Illegal interpolation string')
ValueError: Illegal interpolation string


here is my config file:

Code: Select all


mapsize = 1000
scale = 400
vscale = 8000
offset = 0
persistence = 0.6
lacunarity = 2.0

K = 2
m = 0.35
d = 0.2
sea_level = 0
flex_radius = 20

time = 10
niter = 10

I dont have the module colorcet installed... I couldnt find it on my repo's package list, and pip3 isnt installing to python3's directory. So to install modules I was using sudo apt install python3-lib_name

It seems to be working if I remove the package python3-matplotlib

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

I think I found the lag problem an the server. I generated again the map and disabled now
biomegen and river_mapgen mod. First tests look like lagfree now, please try again:

"rivers"
gundul.ddnss.de
Port: 39155

u18398

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by u18398 » Post

MisterE wrote:
Tue Nov 24, 2020 22:48
so I installed the req'd packages with linux mint, and ran the script, and got this error.

Code: Select all

sudo python3 /usr/share/games/minetest/mods/mapgen_rivers/generate.py

I think it has nothing to do with your config file.
And maybe you should not run generate.py as superuser.

I am running ubuntu 18.04 (mint is also a derivate of ubuntu).
I just followed the discriptions on the github page and it worked for me.

generate.py was executable for me. If it is not for you try "chmod 777 generate.py"
Last edited by u18398 on Wed Nov 25, 2020 17:17, edited 1 time in total.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

MisterE wrote:
Tue Nov 24, 2020 22:48
so I installed the req'd packages with linux mint, and ran the script, and got this error.

[...]

I dont have the module colorcet installed... I couldnt find it on my repo's package list, and pip3 isnt installing to python3's directory. So to install modules I was using sudo apt install python3-lib_name

It seems to be working if I remove the package python3-matplotlib
I think your version of matplotlib is outdated (this is quite common with package managers), and it makes the script crash. I will see how to fix this (I want the calculation to keep working at least, if matplotlib fails).
Colorcet is fully optional, it should not have anything to do with this. Just the map preview is going to be a bit weird because matplotlib's built-in color maps look so bad :)
Gundul wrote:
Wed Nov 25, 2020 05:38
I think I found the lag problem an the server. I generated again the map and disabled now
biomegen and river_mapgen mod. First tests look like lagfree now, please try again:

"rivers"
gundul.ddnss.de
Port: 39155
Ok cool, will come here again :)
For the lag problem: is there something to be fixed in my mod?
Just realize how bored we would be if the world was perfect.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 20 guests