[Mod] River / mountain range mapgen [0.7.2] [watershed]

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

[Mod] River / mountain range mapgen [0.7.2] [watershed]

by paramat » Wed Feb 19, 2014 01:27

Image


Download, rename to 'watershed' https://github.com/paramat/watershed/archive/master.zip
Browse code https://github.com/paramat/watershed

For Minetest 0.4.13 and later
Depends default stairs bucket
Licenses: Source code LGPL (2.1). Textures CC BY-SA (3.0)

A singlenode realm with sea level at y = 1, an auto-spawn function spawns the player on low land.
My past mapgens have applied a river pattern that is independant of the terrain it cuts through.
In watershed the entire terrain is generated by a method of using 3D perlin noise (using the absolute value of 3D noise) that creates a landscape of long winding valleys, water is added to the base of the valleys to form the rivers, the rivers therefore look naturally placed as if they have eroded the valleys into the landscape.


Features

A use of 3D noise that creates long winding river valleys, however this alone would have rivers all on one level, so this terrain is then placed on top of the similar use of noise but upside-down and on a larger scale that creates a web of winding mountain ranges / ridges that surround large lowland areas and lakes. All this is placed on top of a very large scale height variation that creates alternating contients and archipelagos, the island chains being the tops of the submerged mountain ranges.

Rivers and tributaries become narrower and shallower with altitude. They merge with oceans and lakes at sea level, forming watershed systems.
The terrain is a blend between rough and smooth perlin noises, roughest at the mountain ranges and smoothest in the lowlands between.
Uses an arctan function density gradient to create occasional floatlands throughout the atmosphere, and occasional caves underground.
A highly connective web of underground fissures.
Stability table system only places fine materials if supported by a chosen minimum number of stone nodes below.
The mod's own 16x16 node pixel-clouds throughout the atmosphere.
Rare obsidian volcanos near the mountain ridges/island chains.
Inclined sandstone strata.
Ores are within networks within strata.
Lux ore has it's own strata layer, drops 8 lux crystals craftable with glass to lights.

9 3D biomes selected by 3D temperature and humidity noises:

Tundra (dry grass node with random dirt-with-snow and ice)
Snowy plains (snowblocks on dirt nodes)
Taiga (snowy pinetrees, snowblocks on dirt nodes)
Dry grassland (dry grass node)
Grassland (grass node)
Deciduous forest (grass node, appletrees, 5 grasses, flowers)
Desert (desert sand, cactus and dry shrub)
Savanna (dry grass node, golden grass and acacia trees)
Rainforest (grass node, dense jungletrees, junglegrass)

Beaches with dune grass on higher sands.
Papyrus on river banks in warmer biomes.

Saplings for all 4 tree types, grown by luavoxelmanip.
Chat command '/regen' regenerates the player's current chunk, requires 'server' or 'rollback' privs.


The 3D minimap mod


Image


https://github.com/paramat/watershedmini

There is a unique node for each of the 9 biomes, any biome with trees has that tree's leaves as the map node.
The default zoom factor is 16 so this is a mapblock resolution map. The map matches watershed 0.5.0 so just multiply map X and Z co-ordinates by 16 to get the corresponding co-ordinates in watershed.
Soon i will place the map high above the clouds and spawn the player there, currently having the clouds visible looks wrong and is a problem if you want to fly up and get an overhead view of the map.


Crafting

type = "cooking",
output = "default:desert_stone",
recipe = "watershed:redcobble",

output = "watershed:light 8",
recipe = {
{"default:glass", "default:glass", "default:glass"},
{"default:glass", "watershed:luxcrystal", "default:glass"},
{"default:glass", "default:glass", "default:glass"},

output = "watershed:acaciawood 4",
recipe = {
{"watershed:acaciatree"},

output = "watershed:pinewood 4",
recipe = {
{"watershed:pinetree"},


Image


Image


Image


Image


Image


Image
Last edited by paramat on Fri Apr 14, 2017 23:35, edited 30 times in total.
 

User avatar
Linxx
Member
 
Posts: 401
Joined: Wed May 16, 2012 00:37

by Linxx » Wed Feb 19, 2014 03:20

paramat wrote:http://i.imgur.com/8tMQmwR.png


Download, rename to 'watershed' https://github.com/paramat/watershed/archive/master.zip
Browse code https://github.com/paramat/watershed

watershed 0.2.0 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL

*** There are bugs, fixes coming ***
A realm between y = 6000 and y = 8000.
Enable fly then teleport to y = 7000, fly up to find the surface.
Chunk generation time 2 seconds non lua-JIT.
5 biomes selected by temperature:
Desert
Rainforest (jungletrees, junglegrass)
Grassland (junglegrass, 5 grasses)
Deciduous forest (appletrees, 5 grasses, flowers)
Taiga (Pinetrees)


http://i.imgur.com/u7pVFE4.png


http://i.imgur.com/XubZRzB.gif


^ 2km x 1km river map

That's just amazing!! :O
 

User avatar
webdesigner97
Member
 
Posts: 1321
Joined: Mon Jul 30, 2012 19:16
Location: Bergisch Gladbach, Germany
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Wed Feb 19, 2014 08:30

Version 0.2.1.
Many bugfixes. Golden ratio 4 noise canyon generation. Continental scale height variation to create archipelagos (disabled by default, still testing parameters).

Good screenshot, thanks for that, the sandy paths and streams in the highlands are fun to hike along. They made me realise this method is also good for generative paths.
 

User avatar
Casimir
Member
 
Posts: 1151
Joined: Fri Aug 03, 2012 16:59

by Casimir » Wed Feb 19, 2014 10:04

So, when will you switch to C++ and start making mapgen v8?
 

User avatar
Krock
Developer
 
Posts: 3920
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

by Krock » Wed Feb 19, 2014 11:42

Casimir wrote:So, when will you switch to C++ and start making mapgen v8?

Yes, I would like it more when it's in C++ (maybe increases speed and fun) :)
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Wed Feb 19, 2014 19:25

So far, the freedom, independance and simplicity of working as a lua mapgen modder still outweighs the speed advantages of C++, but only because of the lua voxel manipulator.
Eh ... 2 seconds per chunk to slow? ;) i did add 2 more 3D noises in 0.2.1 which will be removed again for 0.2.2 for more speed, trying to keep this as simple as possible, unlike paragen which has become a monster.
I will be adding all the usual mapgen stuff like ores, fissures and clouds, so this will get a little slower in future, i'll try to keep it under 3 seconds.
 

thetoon
Member
 
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Wed Feb 19, 2014 21:44

paramat wrote:So far, the freedom, independance and simplicity of working as a lua mapgen modder still outweighs the speed advantages of C++, but only because of the lua voxel manipulator.
Eh ... 2 seconds per chunk to slow? ;) i did add 2 more 3D noises in 0.2.1 which will be removed again for 0.2.2 for more speed, trying to keep this as simple as possible, unlike paragen which has become a monster.
I will be adding all the usual mapgen stuff like ores, fissures and clouds, so this will get a little slower in future, i'll try to keep it under 3 seconds.


I played with many of your generators recently. They're clearly wonderful on the feature side, and they're getting even better.

Still, I do think he has a point : 2 sec/chunk is kinda slow. Of course, there's a lot to do in such a short time, but it could be better. At least it should : I tried all of your mods on a rather beefy computer (think: big heavy digital artist workstation), and it's not much better on that side, block collection is still lagging because of the generation.

Beside using a separate thread (unless it's already done?), here's a little idea, that might need a little work on the C++ side, but could benefit ALL mapgen makers : what dazzled my in your code is that you generate entire chunks, going through every node, etc. This is not needed. Let's divide players' behaviour in two categories :

* digging/building. These are lengthy actions, and mapgen times are neglectable in comparison. Of course, generation need to be non-blocking, but that's all.
* exploring. This is where we could do something. As long as a given player explores the land, there's no need to generate hidden nodes. Only visible ones are to be expected.

So since your generators (3-)loop through a chunk's nodes, they could simply decide to ignore ('continue' the loop) for every block that has no water/air neighbour. The trick would be to generate in two steps, then : a first one, quick, like this. And then only later (i.e. when player stopped moving for a while, or entered said chunk) the full generation. No change could be done on a semi-generated chunk, of course.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Wed Feb 19, 2014 22:36

Version 0.2.2
I removed those 2 extra 3D noises which were processing heavy, returned to 0.2.0 parameters and added fissures and ores.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Thu Feb 20, 2014 08:29

Version 0.2.2 has a bug, parameter TERCEN was set 1000 nodes too high, it should be somewhere around 7000.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Fri Feb 21, 2014 10:06

Version 0.2.3
Added savanna with acacia trees and golden grasses.
Added clouds, cacti, papyrus, ice, dry shrubs.
Added arctan density gradient to create rare floatlands throughout the atmosphere.
Note the jungles are so thick you can easily travel in 3D within the canopy by cutting stairs and jumping.
Last edited by paramat on Fri Feb 28, 2014 11:48, edited 1 time in total.
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

by RHR » Fri Feb 21, 2014 10:43

this 4 biome island looks so good ... '[*_*]'
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Fri Feb 28, 2014 09:19

thetoon wrote:2 sec/chunk is kinda slow.
[...]
what dazzled my in your code is that you generate entire chunks, going through every node, etc. This is not needed. Let's divide players' behaviour in two categories :

* digging/building. These are lengthy actions, and mapgen times are neglectable in comparison. Of course, generation need to be non-blocking, but that's all.
* exploring. This is where we could do something. As long as a given player explores the land, there's no need to generate hidden nodes. Only visible ones are to be expected.

So since your generators (3-)loop through a chunk's nodes, they could simply decide to ignore ('continue' the loop) for every block that has no water/air neighbour. The trick would be to generate in two steps, then : a first one, quick, like this. And then only later (i.e. when player stopped moving for a while, or entered said chunk) the full generation. No change could be done on a semi-generated chunk, of course.

Yes although fast compared to non lua-voxel manipulator, and fine for singleplayer, 3 seconds per chunk is still a rather annoying amount of lag for a multiplayer server. The fastest i can go is 1-2 seconds per chunk for my ultra simple mapgens.
I thought through your map generating suggestion, it is impossible to do, even if it was possible it would actually be less efficient, so much more complex as to be slower ;)
Last edited by paramat on Fri Feb 28, 2014 09:20, edited 1 time in total.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Fri Feb 28, 2014 12:18

Version 0.2.5

Soil depth table, a tree will only be placed if the soil is deep enough for it's roots (appletree 2, acacia 3, pine 4, jungletree 5).
An arctan function used for thinning of dirt/sand with altitude, dirt/sand now thins to a thin layer instead of diappearing completely, this enables floatlands to have dirt/sand and biomes throughout the atmosphere.

Ores are now hidden a little below surface level, to make them harder to find.
Biomes are now 3D and are selected per node by temperature and humidity 3D perlin noises.
Tundra returns, grasslands are swapped and have more variety of grasses, using the new 'golden grass' from savanna.
Dark clouds return in areas of very high humidity.

Image
Last edited by paramat on Fri Feb 28, 2014 12:21, edited 1 time in total.
 

User avatar
Inocudom
Member
 
Posts: 3007
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Fri Feb 28, 2014 17:40

One thing that is missing from this mapgen is support for other mods that generate ores, plants, trees, and strata. If you add support for those mods, VanessaE might find this mapgen to be very interesting. What sayeth you?
My whole legacy is an abomination.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Sat Mar 01, 2014 00:46

Perhaps ...
Options for additional mod ores would be easy to do, i guess moreores would be the one to support, seems popular.
 

User avatar
Inocudom
Member
 
Posts: 3007
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat Mar 01, 2014 01:45

paramat wrote:Perhaps ...
Options for additional mod ores would be easy to do, i guess moreores would be the one to support, seems popular.

Seems a bit limited. How about a mod that allows for other mods to use the clone nodes of your biomes for generating their stuff?
My whole legacy is an abomination.
 

Nore
Developer
 
Posts: 492
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sat Mar 01, 2014 06:19

paramat wrote:Perhaps ...
Options for additional mod ores would be easy to do, i guess moreores would be the one to support, seems popular.

What about doing like mg does? It adds a mg.register_ore function, and the supported mods like moreores or technic call this function. By the way, what about changing the ore generation to something less classic? For example, you could make gold more frequent near rivers, etc. and make ores generate a bit more like IRL (I mean, you would get a lot of ore in some places, and almost none elsewhere)
 

User avatar
Inocudom
Member
 
Posts: 3007
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat Mar 01, 2014 06:21

Nore wrote:
paramat wrote:Perhaps ...
Options for additional mod ores would be easy to do, i guess moreores would be the one to support, seems popular.

What about doing like mg does? It adds a mg.register_ore function, and the supported mods like moreores or technic call this function. By the way, what about changing the ore generation to something less classic? For example, you could make gold more frequent near rivers, etc. and make ores generate a bit more like IRL (I mean, you would get a lot of ore in some places, and almost none elsewhere)

What would be the solution for plants and trees?
My whole legacy is an abomination.
 

Nore
Developer
 
Posts: 492
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sat Mar 01, 2014 06:21

Inocudom wrote:
Nore wrote:
paramat wrote:Perhaps ...
Options for additional mod ores would be easy to do, i guess moreores would be the one to support, seems popular.

What about doing like mg does? It adds a mg.register_ore function, and the supported mods like moreores or technic call this function. By the way, what about changing the ore generation to something less classic? For example, you could make gold more frequent near rivers, etc. and make ores generate a bit more like IRL (I mean, you would get a lot of ore in some places, and almost none elsewhere)

What would be the solution for plants and trees?

Same... (mg does that too...)
 

User avatar
rubenwardy
Moderator
 
Posts: 5298
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Sat Mar 01, 2014 12:10

This looks amazing!
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

Sokomine
Member
 
Posts: 3460
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sat Mar 01, 2014 16:02

Nore wrote:By the way, what about changing the ore generation to something less classic? For example, you could make gold more frequent near rivers, etc. and make ores generate a bit more like IRL (I mean, you would get a lot of ore in some places, and almost none elsewhere)

That would be more realistic but less good for gameplay I think. At least on most servers. You'd need quite a lot of players to get trade running. And you'll need trade because you won't get "something of everything" anymore - just more of one ore than you'll ever need, while the other ones cannot be found. A huge server with lots of players beeing on and good trading mods may benefit - singleplayer would be less fun.
A list of my mods can be found here.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Sat Mar 01, 2014 18:44

Nore wrote:What about doing like mg does? It adds a mg.register_ore function, and the supported mods like moreores or technic call this function.

That's impressive i might have a look at that. Currently ore selection is as simple as possible for speed, there isn't any selection by depth because i want all ores available in the floatlands.
Nore wrote:By the way, what about changing the ore generation to something less classic? For example, you could make gold more frequent near rivers, etc. and make ores generate a bit more like IRL (I mean, you would get a lot of ore in some places, and almost none elsewhere)

I'll consider, i won't add a new noise for ores, instead i could use existing values to vary ore distribution, but not over very large scales because i agree with Sokomine that would not be fun ... i like the idea that a player on a mid-sized floatland would still have a variety of ores available.
In asteroid mod i use a 3D perlin noise to create interlocking webs of ores, but the scale is not too big (256-512 nodes) so any large asteroid has all ores present.
Last edited by paramat on Sat Mar 01, 2014 18:46, edited 1 time in total.
 

User avatar
paramat
Developer
 
Posts: 3102
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

by paramat » Wed Mar 05, 2014 12:05

Version 0.2.6
Ore veins and sandstone as strata in stone.

Thanks Nore for the suggestion, i realised i could combine ore veins with paragen type rock strata. 2 low octave noises are added, one is 1D noise to vertically locate the strata, the other is a 3D noise to distort and slope the strata and make the ore patchy. This still needs work and tuning but the basics are there.
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

by RHR » Wed Mar 05, 2014 13:32

A picture is worth a thousand words

Image
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 8 guests