[Mod][Merged] Valleys Mapgen [valleys_mapgen]
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
The Story It Told, About A River That Flowed...
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.
I'm still testing this, but if you'd like to try it, it's on github.
I'm still testing this, but if you'd like to try it, it's on github.
- Attachments
-
- c-demo-79.jpg (293.03 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
-
- Member
- Posts: 115
- Joined: Sun Feb 22, 2015 07:11
- GitHub: melzua
- IRC: melzua
- In-game: melzua
- Location: Catalonia
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
+1 @duane. Good idea.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
Is that normal to find a dry river in the jungle?
(imgur won't upload this image, maybe because that's my 101th one?)
(imgur won't upload this image, maybe because that's my 101th one?)
Just realize how bored we would be if the world was perfect.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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.Gael de Sailly wrote:Is that normal to find a dry river in the jungle?
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.
Believe in people and you don't need to believe anything else.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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.
Back to the drawing board.
- Attachments
-
- c-demo-80.jpg (291.89 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
I've made a beautiful screenshot but I can't upload it on imgur and on minetest forums :-/
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.
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.
:-(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.
Spoiler
Vertical axis: humidity ; Horizontal axis: temperature
- Attachments
-
- Biomes.png (53.72 KiB) Viewed 659 times
Just realize how bored we would be if the world was perfect.
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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.
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.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
You're right, of course. The biomes would probably work better without any extra temperature/humidity changes, using stricter altitude limits.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.
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.
- Attachments
-
- c-demo-81.jpg (271.51 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
I don't think so. I think we should modify the biomes. I think the savanna biome is way too high in humidity.duane wrote:Gael de Sailly wrote:The biomes would probably work better without any extra temperature/humidity changes, using stricter altitude limits.
@paramat, if you're interested by the diagram, here is the source file, (geogebra file, rename it to biomes.ggb).
Just realize how bored we would be if the world was perfect.
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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?duane wrote:So, at least that was easy to fix.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Mucking With Biomes
This is kind of interesting. Now the jungle is surrounding the savanna.
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 (273.89 KiB) Viewed 659 times
Last edited by duane on Tue Feb 16, 2016 16:26, edited 1 time in total.
Believe in people and you don't need to believe anything else.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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.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?
Believe in people and you don't need to believe anything else.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
The same diagram with your changes:
It looks strange at first but I think it could be better than the current biomes.
Spoiler
Just realize how bored we would be if the world was perfect.
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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.paramat wrote:many problems, for example rainforest can meet coniferous forest at extreme humidity.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
The tropical conifer forest exists, but that's not the same conifers than on tempered forests.sofar wrote: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.paramat wrote:many problems, for example rainforest can meet coniferous forest at extreme humidity.
Anyway I think that's not a major problem for MT's biomes.
Just realize how bored we would be if the world was perfect.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Mucking With Biomes
I like having a green border around jungles, rather than going straight to savanna. Of course, ethereal had this long ago.
It's getting complicated.
It's getting complicated.
- Attachments
-
- biomes_patch.zip
- (1 KiB) Downloaded 43 times
-
- biome-chart-02.jpg (106.62 KiB) Viewed 659 times
-
- c-demo-83.jpg (326.61 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
- prof-turbo
- Member
- Posts: 516
- Joined: Mon May 07, 2012 17:02
- Location: MinetestForFun or Teeworlds master server list
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
This looks amazing °.°
- 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][WIP] Valleys Mapgen [valleys_mapgen]
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.duane wrote:[…] the altitude chill code decreases temperature logarithmically (whereas, reality decreases it linearly).
Just realize how bored we would be if the world was perfect.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
Well, how about this?Gael de Sailly wrote: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.duane wrote:[…] the altitude chill code decreases temperature logarithmically (whereas, reality decreases it linearly).
Code: Select all
noise_heat->result[index_2d] -= 20.f * t_alt / altitude_chill;
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 (293.33 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
- 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][WIP] Valleys Mapgen [valleys_mapgen]
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):duane wrote:
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.
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 42 times
Just realize how bored we would be if the world was perfect.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]
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: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)
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;
}
}
Believe in people and you don't need to believe anything else.
- 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][Merged] Valleys Mapgen [valleys_mapgen]
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.
Just realize how bored we would be if the world was perfect.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]
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.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.
Believe in people and you don't need to believe anything else.
- duane
- Member
- Posts: 1715
- Joined: Wed Aug 19, 2015 19:11
- GitHub: duane-r
- Location: Oklahoma City
- Contact:
Re: The Story It Told, About A River That Flowed...
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.
All of these changes should appear in the upcoming minetest version.
- Attachments
-
- c-demo-91.jpg (244.05 KiB) Viewed 659 times
Believe in people and you don't need to believe anything else.
Re: [Mod][Merged] Valleys Mapgen [valleys_mapgen]
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
A list of my mods can be found here
Who is online
Users browsing this forum: Bing [Bot] and 31 guests