[Mod][Merged] Valleys Mapgen [valleys_mapgen]

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

The Story It Told, About A River That Flowed...

by duane » Fri Feb 12, 2016 04:22

Rivers running through my deserts annoy me. I've tried getting the biomes to cooperate and put just a bit of vegetation around them, but it always adds too much complication to the code. So, I went the opposite route -- rivers gradually dry up as you approach desert regions, leaving nothing but desolate channels and endless thirst.

Image

I'm still testing this, but if you'd like to try it, it's on github.
Attachments
c-demo-79.jpg
c-demo-79.jpg (293.03 KiB) Viewed 2954 times
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Ivà » Fri Feb 12, 2016 11:07

+1 @duane. Good idea.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Fri Feb 12, 2016 11:28

Is that normal to find a dry river in the jungle?

Image
screenshot_20160212_121623.png
screenshot_20160212_121623.png (1012 KiB) Viewed 2954 times

(imgur won't upload this image, maybe because that's my 101th one?)
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Sat Feb 13, 2016 01:28

Gael de Sailly wrote:Is that normal to find a dry river in the jungle?


That's a case of a high-heat, low-humidity jungle. It's another balancing act between losing water in hot jungles or losing water in dry grasslands. Once I get the basics working, I'll try to adjust it for the extremes.

Needless to say, it'll be a lot easier to add it to the lua.

I also found another bug in the humidity handling, though it doesn't seem to have much obvious effect.
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Mon Feb 15, 2016 16:23

Just when I think I've got the riverbeds working, I realize that I've made the jungle tree problem even worse.

Image

Back to the drawing board.
Attachments
c-demo-80.jpg
c-demo-80.jpg (291.89 KiB) Viewed 2954 times
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Mon Feb 15, 2016 19:53

I've made a beautiful screenshot but I can't upload it on imgur and on minetest forums :-/

duane wrote:Just when I think I've got the riverbeds working, I realize that I've made the jungle tree problem even worse.

Back to the drawing board.
:-(

I think I've found the explanation for the incoherent biome repartition around rivers (where there is a dry savanna next to the river and a grassland higher). The current biome system uses Voronoi diagrams to define biomes. I've made a diagram with GeoGebra.
+ Diagram

That's not due to humidity, but to temperature. The temperature is decreased (leftward move), so it may leave the "savanna" zone and enter the grassland or forest zone, without humidity change. So that's these biomes that are incoherent.
Attachments
Biomes.png
Biomes.png (53.72 KiB) Viewed 2954 times
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by paramat » Tue Feb 16, 2016 06:59

Thanks for the diagram, i added a background making the best attempt at keeping all biome names readable.
The biome system being a voronoi diagram makes it very difficult to tune and balance, months of work and many problems, for example rainforest can meet coniferous forest at extreme humidity.

Image
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Tue Feb 16, 2016 09:09

Gael de Sailly wrote:I think I've found the explanation for the incoherent biome repartition around rivers (where there is a dry savanna next to the river and a grassland higher)...
That's not due to humidity, but to temperature. The temperature is decreased (leftward move), so it may leave the "savanna" zone and enter the grassland or forest zone, without humidity change. So that's these biomes that are incoherent.


You're right, of course. The biomes would probably work better without any extra temperature/humidity changes, using stricter altitude limits.

However, the problem in my screenshot turns out to be the decrease in altitude in the riverbed raising the humidity. So, at least that was easy to fix.

Image
Attachments
c-demo-81.jpg
c-demo-81.jpg (271.51 KiB) Viewed 2954 times
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Tue Feb 16, 2016 10:25

duane wrote:
Gael de Sailly wrote:The biomes would probably work better without any extra temperature/humidity changes, using stricter altitude limits.
I don't think so. I think we should modify the biomes. I think the savanna biome is way too high in humidity.

@paramat, if you're interested by the diagram, here is the source file, (geogebra file, rename it to biomes.ggb).
Biomes.zip
(7.64 KiB) Downloaded 67 times
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

Fixerol
Member
 
Posts: 633
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Fixerol » Tue Feb 16, 2016 14:38

duane wrote:So, at least that was easy to fix.
Image


Is it possible to encounter same savannah but more hot one, so river will be without jungles? or it is always jungles in savannah river?
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Mucking With Biomes

by duane » Tue Feb 16, 2016 16:21

This is kind of interesting. Now the jungle is surrounding the savanna.

Image

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua
index c92514c..fe50cbb 100644
--- a/mods/default/mapgen.lua
+++ b/mods/default/mapgen.lua
@@ -672,7 +672,7 @@ function default.register_biomes()
       y_min = 5,
       y_max = 31000,
       heat_point = 85,
-      humidity_point = 20,
+      humidity_point = 10,
    })
 
    minetest.register_biome({
@@ -690,7 +690,7 @@ function default.register_biomes()
       y_min = -112,
       y_max = 4,
       heat_point = 85,
-      humidity_point = 20,
+      humidity_point = 10,
    })
 
 
@@ -708,8 +708,8 @@ function default.register_biomes()
       --node_river_water = "",
       y_min = 1,
       y_max = 31000,
-      heat_point = 85,
-      humidity_point = 50,
+      heat_point = 65,
+      humidity_point = 30,
    })
 
    minetest.register_biome({
@@ -726,8 +726,8 @@ function default.register_biomes()
       --node_river_water = "",
       y_min = -3,
       y_max = 0,
-      heat_point = 85,
-      humidity_point = 50,
+      heat_point = 65,
+      humidity_point = 30,
    })
 
    minetest.register_biome({
@@ -744,8 +744,8 @@ function default.register_biomes()
       --node_river_water = "",
       y_min = -112,
       y_max = -4,
-      heat_point = 85,
-      humidity_point = 50,
+      heat_point = 65,
+      humidity_point = 30,
    })
 
 
Attachments
c-demo-82.jpg
c-demo-82.jpg (273.89 KiB) Viewed 2954 times
Last edited by duane on Tue Feb 16, 2016 16:26, edited 1 time in total.
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Tue Feb 16, 2016 16:25

Fixerol wrote:Is it possible to encounter same savannah but more hot one, so river will be without jungles? or it is always jungles in savannah river?


Well, check the diagrams above. If you have hot + humid, it's always going to be jungle. Savannah, desert, and jungle share the same heat range.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Tue Feb 16, 2016 16:58

The same diagram with your changes:
+ New digram

It looks strange at first but I think it could be better than the current biomes.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by sofar » Tue Feb 16, 2016 18:18

paramat wrote:many problems, for example rainforest can meet coniferous forest at extreme humidity.


This is entirely valid, and happens in many locations in real-life. For instance, not more than 80km away from me, there is a coastal rainforest that is directly backed by conifers.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Tue Feb 16, 2016 18:56

sofar wrote:
paramat wrote:many problems, for example rainforest can meet coniferous forest at extreme humidity.


This is entirely valid, and happens in many locations in real-life. For instance, not more than 80km away from me, there is a coastal rainforest that is directly backed by conifers.

The tropical conifer forest exists, but that's not the same conifers than on tempered forests.
Anyway I think that's not a major problem for MT's biomes.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Mucking With Biomes

by duane » Wed Feb 17, 2016 03:20

I like having a green border around jungles, rather than going straight to savanna. Of course, ethereal had this long ago.

Image

It's getting complicated.

Image
Attachments
biomes_patch.zip
(1 KiB) Downloaded 67 times
biome-chart-02.jpg
biome-chart-02.jpg (106.62 KiB) Viewed 2954 times
c-demo-83.jpg
c-demo-83.jpg (326.61 KiB) Viewed 2954 times
 

User avatar
prof-turbo
Member
 
Posts: 518
Joined: Mon May 07, 2012 17:02

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by prof-turbo » Wed Feb 17, 2016 14:42

This looks amazing °.°
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Sun Feb 21, 2016 10:13

duane wrote:[…] the altitude chill code decreases temperature logarithmically (whereas, reality decreases it linearly).

The Lua VMG uses only positive values. That's not the case for the C++ VMG. Temperature is from -20 to 120, so the exponential decreasing of the temperature (valleys_mapgen.cpp:621-623) is inverted on very cold places. It should be linear.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Sun Feb 21, 2016 11:38

Gael de Sailly wrote:
duane wrote:[…] the altitude chill code decreases temperature logarithmically (whereas, reality decreases it linearly).

The Lua VMG uses only positive values. That's not the case for the C++ VMG. Temperature is from -20 to 120, so the exponential decreasing of the temperature (valleys_mapgen.cpp:621-623) is inverted on very cold places. It should be linear.


Well, how about this?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
noise_heat->result[index_2d] -= 20.f * t_alt / altitude_chill;


The drawback is that biome temperature fluctuations are much more prominent, causing the snow line to be more ragged. It doesn't look as pretty to me. On the plus side, it's a bit faster to generate.

Image

I don't think many mods are going to be too particular about what happens below zero temperature, so it probably won't be a major issue.
Attachments
c-demo-88.jpg
c-demo-88.jpg (293.33 KiB) Viewed 2954 times
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Sun Feb 21, 2016 13:34

duane wrote:Image

I've tried to change the altitude chill code with what you have proposed, and I've not seen these strange snow lines, even with the same world seed (from your dry_rivers branch):
Image

But I've found another problem that only occurs with dry_rivers: jungle trees growing in the river where the river meets the sea, at y=0 only.
Image
I've uploaded the images on GitHub by dragging-dropping on a comment field. I don't know whether they will be deleted since they're not used in GitHub.
Attachments
linear_altitude.patch.zip
(622 Bytes) Downloaded 43 times
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

by duane » Sun Feb 21, 2016 17:07

Gael de Sailly wrote:I've tried to change the altitude chill code with what you have proposed, and I've not seen these strange snow lines, even with the same world seed (from your dry_rivers branch)


Well, I probably made a mistake at some point. It's not a major issue for me. Both methods give similar results within the area most people will be focused on. If you and paramat like this method, I'll try to put it into the dry_rivers patch. This is what I'm testing at the moment, though I haven't had much time to focus on it yet:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp
index 94abed3..77a9785 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen_valleys.cpp
@@ -597,7 +599,8 @@ int MapgenValleys::generateTerrain()
          // Derive heat from (base) altitude. This will be most correct
          // at rivers, since other surface heights may vary below.
          if (use_altitude_chill && (surface_y > 0 || river_y > 0))
-            t_heat *= pow(0.5f, MYMAX(surface_y, river_y) / altitude_chill);
+            //t_heat *= pow(0.5f, MYMAX(surface_y, river_y) / altitude_chill);
+            t_heat -= 20.f * MYMAX(surface_y, river_y) / altitude_chill;
 
          // If humidity is low or heat is high, lower the water table.
          float delta = noise_humidity->result[index_2d] - 50.f;
@@ -661,7 +664,8 @@ int MapgenValleys::generateTerrain()
          // This is similar to the lua version's seawater adjustment,
          // but doesn't increase the base humidity.
          if (t_alt > 0)
-            humid *= pow(0.5f, t_alt / altitude_chill);
+            //humid *= pow(0.5f, t_alt / altitude_chill);
+            humid -= 20.f * t_alt / altitude_chill;
          noise_humidity->result[index_2d] = humid;
       }
 
@@ -674,8 +678,8 @@ int MapgenValleys::generateTerrain()
             // The altitude hasn't changed. Use the first result.
             noise_heat->result[index_2d] = t_heat;
          else if (t_alt > 0)
-            noise_heat->result[index_2d] *=
-               pow(0.5f, t_alt / altitude_chill);
+            //noise_heat->result[index_2d] *= pow(0.5f, t_alt / altitude_chill);
+            noise_heat->result[index_2d] -= 20.f * t_alt / altitude_chill;
       }
    }
 


I think I'll have to tone down the humidity change, since I'm seeing more cold desert than I'd like, even when it's set down to zero humidity. One good thing I've noticed is that the biome noises are more prominent, causing the trees clump together better, rather than trying to follow rivers.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Sun Feb 21, 2016 18:30

I would like to keep the logarithmic humidity increase near the rivers. The influence of the rivers on humidity is important when you are close to the river, and becomes quickly insignificant when climbing up, contrary to the altitude chill that is linear. But I have not tested your code. If you think that's better, you can commit it.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by duane » Mon Feb 22, 2016 02:36

Gael de Sailly wrote:I would like to keep the logarithmic humidity increase near the rivers. The influence of the rivers on humidity is important when you are close to the river, and becomes quickly insignificant when climbing up, contrary to the altitude chill that is linear. But I have not tested your code. If you think that's better, you can commit it.


I agree. I mean to keep the logarithmic function near rivers. The humidity change there is, of course, for the altitude function that (sort of) takes the place of the sea-level humidity and soil thickness functions in the lua. It's helpful, but a bit too strong as I posted it.
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: The Story It Told, About A River That Flowed...

by duane » Wed Mar 02, 2016 02:14

In case anyone missed it, the mainline minetest code now features dry riverbeds where the humidity is low. We also managed to correct some technical problems that may have been causing caves and dungeons to spawn in weird places, made swamps look less sandy and more swampy, removed river water from the seas, figured out a more robust way of varying humidity and temperature by altitude, and made the heightmap more accurate for mods.

All of these changes should appear in the upcoming minetest version.

Image
Attachments
c-demo-91.jpg
c-demo-91.jpg (244.05 KiB) Viewed 2954 times
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by Don » Wed Mar 02, 2016 03:50

Nice work!
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by azekill_DIABLO » Thu Mar 10, 2016 18:35

where is cave stuff = false in the mod? i can't found it.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by duane » Thu Mar 10, 2016 19:32

azekill_DIABLO wrote:where is cave stuff = false in the mod? i can't found it.


In your settings tab:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
advanced settings
- mods
  - valleys_mapgen
    - mapgen
      - caves
        - features
          - cave stuff

It's disabled by default.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by paramat » Mon Mar 14, 2016 09:01

duane, i merged this PR https://github.com/minetest/minetest/pull/3850 that affects mgvalleys.
I tested it and mgvalleys caves seem okay, but as i don't completely understand the code perhaps you could check this isn't subtly breaking something?
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by burli » Mon Mar 14, 2016 13:08

Love this mg. Are there any known issuse with other mods?
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]

by burli » Mon Mar 14, 2016 18:14

This map is really deadly. I spawned in a deasert biome, Trier to find The next tree, cut one block, made an axe and then I was attacked by sandmonster.

In another world i spawend in a snow biome and walked and walked and I starved before I found any food
 

PreviousNext

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 7 guests

cron