[Mod][Merged] Valleys Mapgen [valleys_mapgen]

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Sat Jan 23, 2016 20:23

duane wrote:
Fixerol wrote:So there will be valleys caves (default) and V7 caves for our choosing?


Well, we changed it to the V5 caves, which are basically the same but don't require any template madness. However, the Valleys Mapgen default caves are not included -- they require a lot more processing time. Only the simple caves and V5 are included.

If anyone wants to try them early, the code is on github.

Edit: By the way, the river issue has been fixed in the mainline code, and should be available in daily builds soon.

Nice! Just got done merging, compiling and roaming around. Have a question or three for you...
Which noise deals with the V5-large_caves, 'mg_valleys_np_cave1' or 'mg_valleys_np_cave2' (thinking 2)?
Probably a stupid question... Does the 'v5_caves/nov5_caves' flag allow to toggle between simple and V5 caves or are simple caves always used?
It is possible for the V5 cave gen to makes enormous caves (ala Paramat's Subterrain mod)?


edit: answered my own stupid questions by looking at the code. derp

How much faster is C cave gen then LUA? Is it worth the bother if I try to hack in how Paramat did Subterrain into the C cave gen routine?
 

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 Jan 24, 2016 00:12

blert2112 wrote:Which noise deals with the V5-large_caves, 'mg_valleys_np_cave1' or 'mg_valleys_np_cave2'?


Neither. They just make the irregular caves around the large ones.

blert2112 wrote:Does the 'v5_caves/nov5_caves' flag allow to toggle between simple and V5 caves or are simple caves always used?


The V5 caves have irregular passages similar to simple caves, but only one or the other is ever used. [Simple caves was based on paramat's Intersect, so it ended up looking a lot like his code.]

blert2112 wrote:It is possible for the V5 cave gen to makes enormous caves (ala Paramat's Subterrain mod)?


At the moment, I believe it's confined to one map chunk. If you can catch paramat at a time when he's not busy, you might get him to add them.

Edit:
How much faster is C cave gen then LUA? Is it worth the bother if I try to hack in how Paramat did Subterrain into the C cave gen routine?


According to the lua people, lua runs about half as fast as C (which is amazing for an interpreter). All of my tests confirm that in Minetest. Since the large caves are not going to affect the generation of the overworld, being deep underground, I don't think I'd be in a rush to put it in the C++ code unless it turned out to be trivial or there was a universal demand.

On the other hand, I doubt anyone would turn down an option to add them if you put it together and submitted a pull request.
 

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

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

by paramat » Sun Jan 24, 2016 13:22

The large caves added as part of the option are generated by pseudorandom noise, not perlin noise, the code is in 'cavegen.cpp', they are the same large caves as used in mgv5/v6/v7/flat/fractal. Their size is limited to mapchunk plus mapblock shell, so 7x7x7 mapblocks = 112x112x112 nodes.

The option just added is actually large pseudorandom caves plus the 3D perlin noise tunnels from mgv7/flat/fractal.

My experience is Lua is 20 times slower than C++ for general mapgen stuff.

Concerning the merged C++ mgvalleys:

I propose a change of plan for caves, i'm not keen on how random lava and water nodes are placed in the simple caves, and i'm uncomfortable with how complex and unfocussed this mapgen is becoming with all the options. What do you all think about making the new caves option the standard and removing the simple caves option? The simple caves tunnels are excellent but are similar to the 3D noise tunnels of mgv7, but we will gain underground caverns flooded with water and lava.

I'm also not sure about keeping the fast terrain option, the mapgen is already fast and the option makes the code more complex. I would prefer this mapgen to have a more defined character and be focussed on creating terrain faithful to the original.

Duane, i will probably ask you to alter your latest PR for the caves option.
 

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 » Sun Jan 24, 2016 15:27

I propose a change of plan for caves, i'm not keen on how random lava and water nodes are placed in the simple caves

I like this feature, please don't kill it, there should be at least some danger when mining, standard lava pools are so boring and rare...
 

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 Jan 24, 2016 17:47

paramat wrote:My experience is Lua is 20 times slower than C++ for general mapgen stuff.

Really?!?
I thought it was around 3 times. If that's really 20 times, that's really useless to make some complicated features to make it several percent faster, except if your computer is very, very slow.
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 Jan 24, 2016 23:08

paramat wrote:My experience is Lua is 20 times slower than C++ for general mapgen stuff.


I suspect we're both right, but for devious reasons. Lua runs very fast, and as far as crunching numbers, C/C++ doesn't beat it by much, but every time you make a call to the minetest functions, there's a lot of overhead involved. (Of course, that's why the voxelmanip routines were added, to try to keep this to a minimum.)

The lua version of Valleys is a sterling example of optimal lua code, and it only takes about twice as long to do more than the C++ mapgen does. So, in that case at least, the speed difference is not a huge factor (unless you need every ounce of speed for your server).

paramat wrote:I propose a change of plan for caves, i'm not keen on how random lava and water nodes are placed in the simple caves, and i'm uncomfortable with how complex and unfocussed this mapgen is becoming with all the options. What do you all think about making the new caves option the standard and removing the simple caves option? The simple caves tunnels are excellent but are similar to the 3D noise tunnels of mgv7, but we will gain underground caverns flooded with water and lava.


I like the simple caves, even over the 3D noise in mgv7. There are palpable differences to my eye, and I'm fond of the many water/fire falls that random lava/water placement creates (even above ground). However, I can patch them in myself. The only real question is, what do the rest of the folks here think?

paramat wrote:I'm also not sure about keeping the fast terrain option, the mapgen is already fast and the option makes the code more complex. I would prefer this mapgen to have a more defined character and be focussed on creating terrain faithful to the original.


I agree. I'm still fond of the fast terrain, but I find myself using the regular option more often.

Fixerol wrote:
I propose a change of plan for caves, i'm not keen on how random lava and water nodes are placed in the simple caves

I like this feature, please don't kill it, there should be at least some danger when mining, standard lava pools are so boring and rare...


Agreed. I even had an option to spew random water and lava outside of the caves at one point, but it got pretty messy.
 

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 Jan 25, 2016 06:09

duane wrote:
paramat wrote:What do you all think about making the new caves option the standard and removing the simple caves option?


I like the simple caves, even over the 3D noise in mgv7. There are palpable differences to my eye, and I'm fond of the many water/fire falls that random lava/water placement creates (even above ground).


Another option would be to make the V5 caves more flexible and/or less static.

If necessary, I'll put the extra lava and water into a mod, but some people might not appreciate having to load another mod for what they see as a mapgen function. That presumes, of course, that I'm the only one who prefers the simple caves' shape over the standard caves'.

As far as complicating the code goes, I can solve that by pasting in the seven lines of code that ask cavegen to create the larger caves, to the end of the simple caves function. Then you get the (my) best of both worlds, and none of the other mapgens are affected. I think this is going to be the go-to option for my personal build.

Image

You have big caves, ragged caves, lava pools, swimming pools, and more fire/water falls than you can shake a stick at. Add some colossal caves and weak rock that falls on you, and you've got a real party... but that'll have to wait.

If anyone wants to try this option, the code is on my frankencaves branch.
Attachments
frankencaves.jpg
frankencaves.jpg (302.91 KiB) Viewed 2807 times
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Mon Jan 25, 2016 07:25

duane wrote:As far as complicating the code goes, I can solve that by pasting in the seven lines of code that ask cavegen to create the larger caves, to the end of the simple caves function. Then you get the (my) best of both worlds, and none of the other mapgens are affected. I think this is going to be the go-to option for my personal build.

+1

duane wrote:Add some colossal caves and weak rock that falls on you, and you've got a real party... but that'll have to wait.

I don't like waiting. :( Yeah, it's way beyond me to do it properly myself. ;)

As for the lava/water falls in the caves. Too much for my taste. Though, I have a mod that variably reduces lava at different depths.

edit: I use the fast flag. It doesn't look that much different and feels much faster on my system. I could give you numbers but I assume you already know them.
 

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 Jan 25, 2016 08:18

blert2112 wrote:As for the lava/water falls in the caves. Too much for my taste. Though, I have a mod that variably reduces lava at different depths.


Well, the mg_valleys_water_features setting lets you control how much random water appears (0-10). The mg_valleys_lava_max_height setting controls how high or low random lava appears. Neither affects the big caves, just the simple caves part.
 

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 Jan 25, 2016 10:06

blert2112 wrote:I don't like waiting. :( Yeah, it's way beyond me to do it properly myself. ;)


The basics of subterrain aren't hard to put in, anyway. These things are freakishly huge, too. They need their own weather mods. It's still slow -- there's no getting around big features taking a long time, but I disabled large caves in any chunk that has a piece of a massive cave (to avoid lava/water appearing in mid-air), so they're not unbearable.

Image

This is a small one. The simple caves break through where they intersect, occasionally resulting in falls. The source code is on frankencaves.
Attachments
massive_cave_02.jpg
massive_cave_02.jpg (84.33 KiB) Viewed 2807 times
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

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

by benrob0329 » Mon Jan 25, 2016 14:34

Who says Minetest can't look stunning?
 

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

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

by paramat » Mon Jan 25, 2016 19:53

Okay let's keep simple caves as an option for now, especially since caves seem to be in development, for now your new PR is good for sorting out the other stuff.
Last edited by paramat on Mon Jan 25, 2016 20:40, edited 2 times in total.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

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

by cHyper » Mon Jan 25, 2016 20:01

minetest-0.4.13-3c6b2ff
sfan5 win32-dev-build

I made a new map with mapgen valleys and following error messages appears!

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
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'stone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'sandstone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'deciduous_forest'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'coniferous_forest'
2016-01-14 19:31:05: ERROR[Main]: register_decoration: couldn't get all biomes
 

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

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

by paramat » Mon Jan 25, 2016 20:17

Which version of valleys mapgen are you using?
 

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

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

by paramat » Mon Jan 25, 2016 20:31

duane wrote:I suspect we're both right, but for devious reasons. Lua runs very fast, and as far as crunching numbers, C/C++ doesn't beat it by much, but every time you make a call to the minetest functions, there's a lot of overhead involved.

Yes exactly, my approximate figure of 20 is from comparing C++ mgwatershed at 100ms per chunk to lua watershed at 2s per chunk. But i forgot that the mgwatershed time doesn't include lighting calculations, and lua watershed has heavier use of 3D noise, so 20 is excessive, probably more like 10.
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

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

by cHyper » Mon Jan 25, 2016 21:00

cHyper wrote:minetest-0.4.13-3c6b2ff
sfan5 win32-dev-build

I made a new map with mapgen valleys and following error messages appears!

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
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'stone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'sandstone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'deciduous_forest'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'coniferous_forest'
2016-01-14 19:31:05: ERROR[Main]: register_decoration: couldn't get all biomes


I use minetest_next as subgame.
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Mon Jan 25, 2016 23:26

duane wrote:The basics of subterrain aren't hard to put in, anyway. These things are freakishly huge, too. They need their own weather mods. It's still slow -- there's no getting around big features taking a long time, but I disabled large caves in any chunk that has a piece of a massive cave (to avoid lava/water appearing in mid-air), so they're not unbearable.
...

Yeah, I was looking at the code and noticed it would not be too terribly difficult to add in but... it looked like I would have to convert the z/y/x loops in Subterrain into the z/x/y of the cave gen code. It was three in the morning and I couldn't wrap my head around it. I will take a look at how you did as soon as I get done playing with this new build.

edit: Holy Moly! You were not kidding! I'm not sure the word "massive" accurately describes these caves. The Frankencaves branch is wonderful.
 

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 Jan 26, 2016 01:11

cHyper wrote:minetest-0.4.13-3c6b2ff
sfan5 win32-dev-build

I made a new map with mapgen valleys and following error messages appears!

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
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'stone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'sandstone_grassland'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'deciduous_forest'
2016-01-14 19:31:05: ERROR[Main]: get_biome_list: failed to get biome 'coniferous_forest'
2016-01-14 19:31:05: ERROR[Main]: register_decoration: couldn't get all biomes


Minetest_next makes specific provisions for mapgens five, six, and seven, but does nothing when you load valleys mapgen, so it never loads any biomes.

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
if mg_name == "v6" then
   dofile(modpath .. "/mapgenv6.lua")
elseif mg_name == "v5" or mg_name == "v7" then
   dofile(modpath .. "/mapgenv57.lua")
end


If BlockMen wants to support Valleys, he'll have to put something in there about it. Offhand, I'm not sure how difficult that would be. You might have more luck using the individual mods that go into next.

Edit: It seems to work fine with this patch. You might try it or get Blockmen to. I've no idea what to look for, having never used next.

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/init.lua b/mods/default/init.lua
index c0ebbbe..321ba67 100644
--- a/mods/default/init.lua
+++ b/mods/default/init.lua
@@ -43,7 +43,7 @@ dofile(modpath .. "/crafting.lua")
 dofile(modpath .. "/mapgen.lua")
 if mg_name == "v6" then
        dofile(modpath .. "/mapgenv6.lua")
-elseif mg_name == "v5" or mg_name == "v7" then
+elseif mg_name == "v5" or mg_name == "v7" or mg_name == "valleys" then
        dofile(modpath .. "/mapgenv57.lua")
 end
 dofile(modpath .. "/trees.lua")
diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua
index ecf4a8e..e10cacf 100644
--- a/mods/default/mapgen.lua
+++ b/mods/default/mapgen.lua
@@ -8,7 +8,7 @@ minetest.register_alias("mapgen_dirt", "default:dirt")
 minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
 minetest.register_alias("mapgen_sand", "default:sand")
 minetest.register_alias("mapgen_water_source", "default:water_source")
-minetest.register_alias("mapgen_river_water_source", "air")
+minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
 minetest.register_alias("mapgen_lava_source", "default:lava_source")
 minetest.register_alias("mapgen_gravel", "default:gravel")
 minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Tue Jan 26, 2016 02:38

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
for (s16 z = node_min.Z; z <= node_max.Z; z++)
   for (s16 x = node_min.X; x <= node_max.X; x++, index_2d++) {
      ...
      for (s16 y = node_max.Y + 1;
            y >= node_min.Y - 1;
            y--, index_3d -= ystride, vm->m_area.add_y(em, index_data, -1)) {
         ...
         float tcave = massive_cave_threshold;
         if (node_max.Y <= massive_cave_depth) {
            if (y < yblmin)
               tcave += pow(((yblmin - y) / MASSIVE_CAVE_BLEND), 2);
            else if (y > yblmax)
               tcave += pow(((y - yblmax) / MASSIVE_CAVE_BLEND), 2);
            if (noise_massive_caves->result[index_3d] > tcave) {
               vm->m_data[index_data] = n_air;
               made_a_big_one = true;
            }
         }
         ...
      }
   }

There's the part that had me wondering how to hack in in the best way. In the Subterrain mod the loop goes z/y/x so it only does this part for every z/y. Here, we see these computations are being done every z/x/y. That's a huge increase. If my thinking is correct... Given a sidelen of 100 (just for example), this was being done 100x100 times, or 10,000 times. Here it is being done every 100x100x100 times, or 1,000,000 times. Is my thinking (and math) incorrect?
Edit: So, I'm thinking, the best way for this bit of code to run is to make the loop in the order of y/x/z (or y/z/x). That way it is only done every 100 times (per my above example). Would this be best left to a mod or maybe even give it its own dedicated loop of y/x/z? Is it wasting (for the lack of a better word) enough time to worry about. I don't know much about C++ but I have to think doing something 1,000,000 times would be a big noticeable difference when compared to only doing it 100 times.
 

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 Jan 26, 2016 03:24

blert2112 wrote:
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
for (s16 z = node_min.Z; z <= node_max.Z; z++)
   for (s16 x = node_min.X; x <= node_max.X; x++, index_2d++) {
      ...
      for (s16 y = node_max.Y + 1;
            y >= node_min.Y - 1;
            y--, index_3d -= ystride, vm->m_area.add_y(em, index_data, -1)) {
         ...
         float tcave = massive_cave_threshold;
         if (node_max.Y <= massive_cave_depth) {
            if (y < yblmin)
               tcave += pow(((yblmin - y) / MASSIVE_CAVE_BLEND), 2);
            else if (y > yblmax)
               tcave += pow(((y - yblmax) / MASSIVE_CAVE_BLEND), 2);
            if (noise_massive_caves->result[index_3d] > tcave) {
               vm->m_data[index_data] = n_air;
               made_a_big_one = true;
            }
         }
         ...
      }
   }

There's the part that had me wondering how to hack in in the best way. In the Subterrain mod the loop goes z/y/x so it only does this part for every z/y. Here, we see these computations are being done every z/x/y. That's a huge increase. If my thinking is correct... Given a sidelen of 100 (just for example), this was being done 100x100 times, or 10,000 times. Here it is being done every 100x100x100 times, or 1,000,000 times. Is my thinking (and math) incorrect?


Good point!

Having profiled the operation, I can tell you that the main slowdown isn't in the loops, it's in creating another noise map. The entirety of the mapgen only consumes about 15% of the time the lighting/liquid handling + noise generation consumes (on my computer). So, you're not likely to see a huge speed gain.

However, why don't we cache the tcave values, since they don't change in the xz plane anyway? That way, we don't have to unwind any loops.

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
   float tcave_cache[csize.Y + 2];

   if (node_max.Y <= massive_cave_depth) {
      for (s16 y = node_max.Y + 1; y >= node_min.Y - 1; y--) {
         float tcave = massive_cave_threshold;

         if (y < yblmin)
            tcave += pow(((yblmin - y) / MASSIVE_CAVE_BLEND), 2);
         else if (y > yblmax)
            tcave += pow(((y - yblmax) / MASSIVE_CAVE_BLEND), 2);

         tcave_cache[y - node_min.Y + 1] = tcave;
      }
   }
...
         if (node_max.Y <= massive_cave_depth
               && noise_massive_caves->result[index_3d]
               > tcave_cache[y - node_min.Y + 1]) {
            vm->m_data[index_data] = n_air;
            made_a_big_one = true;
         }


That should save a bit of time.

Edit: I started prowling around a cave and thought, "What the hell? Where'd this artifact come from? Then I realized...

Image
Attachments
massive_cave_04.jpg
massive_cave_04.jpg (269.04 KiB) Viewed 2811 times
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Tue Jan 26, 2016 16:11

duane wrote:However, why don't we cache the tcave values, since they don't change in the xz plane anyway? That way, we don't have to unwind any loops.

Nice. I just went exploring around myself and found that it does seem a bit quicker to me. Mayhaps it's just a placebo effect but it feels much smoother. Previously, I would experience pauses in the game like it was waiting for something, I did not encounter those same pauses today.
The scale of these massive caves is incredible, I mapped an entire cave and then stood back a bit... at a view range of over 1000 it still did not all fit! Now, what to do with all this goodness? I can rewrite my custom "Nether" mod and speed it up. Are the massive caves (or can they be) reported to gennotify? If so, I should be able to build structures inside them, possibly even coax mg_villages to place a village down there and populate it.
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Tue Jan 26, 2016 19:26

The method for generating these massive caves seems the same but the caves are generated very differently from the Subterrain mod. Here's a SS from the mod...
Image
...it is very feature full and convoluted. The massive caves made by Frankencaves are very plain and tend to look like... well, cup your hands and place them together. So, why is this?
Attachments
screenshot_20160126_141956.png
screenshot_20160126_141956.png (244.14 KiB) Viewed 2811 times
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Tue Jan 26, 2016 20:48

Here you go...
https://github.com/blert2112/minetest/c ... 5e525e9060
... That should fix the featurelessness of the caves that I spoke of above. Worked nicely for me.


edit: nope, sorry, I guess I had the wrong save loaded.
 

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

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

by paramat » Tue Jan 26, 2016 21:17

The 3D noise has horizontal spread 768 and vertical spread 256 so these are 'squashed' 3D noise as in subterrain mod. with that 'flattened diamonds' look.
 

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 Jan 26, 2016 22:35

duane wrote:
duane wrote:
paramat wrote:What do you all think about making the new caves option the standard and removing the simple caves option?


I like the simple caves, even over the 3D noise in mgv7. There are palpable differences to my eye, and I'm fond of the many water/fire falls that random lava/water placement creates (even above ground).


Another option would be to make the V5 caves more flexible and/or less static.

If necessary, I'll put the extra lava and water into a mod, but some people might not appreciate having to load another mod for what they see as a mapgen function. That presumes, of course, that I'm the only one who prefers the simple caves' shape over the standard caves'.

As far as complicating the code goes, I can solve that by pasting in the seven lines of code that ask cavegen to create the larger caves, to the end of the simple caves function. Then you get the (my) best of both worlds, and none of the other mapgens are affected. I think this is going to be the go-to option for my personal build.

Image

You have big caves, ragged caves, lava pools, swimming pools, and more fire/water falls than you can shake a stick at. Add some colossal caves and weak rock that falls on you, and you've got a real party... but that'll have to wait.

If anyone wants to try this option, the code is on my frankencaves branch.


Wow, this looks so cool, real challenge for real minetester.
 

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 » Wed Jan 27, 2016 01:46

blert2112 wrote:The method for generating these massive caves seems the same but the caves are generated very differently from the Subterrain mod. Here's a SS from the mod...
Image


Image

This is the same world, location and heading you used in your screenshot, but using the C++ version. It looks pretty convoluted to me, though it's hard to tell if they're the same from the screenshots, especially with large chunks of background not yet filled in. They should be, except in cases where another cave has intersected the massive one.

If you're talking about the lava balls that form in mid-air, that's a (presumably) unintentional effect of the original large cave code that has caused complaints on the caverealms forum. People didn't appreciate lava inundating the carefully constructed environments. I removed that by disabling large caves in any chunk that had a massive cave (something you can't do from lua).

Lava can (and does) still fall into massive caves from other caves, and can still form on the floor, but it won't form in mid-air. Of course, the absence of large caves in that chunk will prevent any from intersecting, but noise-based caves will still intersect.

I hesitate to make the massive caves too crazy, because that's a great area for mods to embellish, and I don't want problems like the big lava balls interfering with them. The code that's currently in pull request #3590 has all three types of cave and gives you the option to vary random lava and water spawns from 0-10, which will also affect massive caves.
Attachments
massive_cave_05.jpg
massive_cave_05.jpg (208.37 KiB) Viewed 2811 times
Last edited by duane on Wed Jan 27, 2016 03:16, 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 » Wed Jan 27, 2016 02:24

blert2112 wrote:I just went exploring around myself and found that it does seem a bit quicker to me.


Cool.

blert2112 wrote:The scale of these massive caves is incredible, I mapped an entire cave and then stood back a
bit... at a view range of over 1000 it still did not all fit!


Yes, paramat doesn't do things small. ; )

blert2112 wrote:Now, what to do with all this goodness? I can rewrite my custom "Nether" mod and speed it up. Are the massive caves (or can they be) reported to gennotify? If so, I should be able to build structures inside them, possibly even coax mg_villages to place a village down there and populate it.


They are not. I'll look into it. I notice that large caves have a begin and end event. That wouldn't be practical with massive caves, since they span so many chunks, but we could have a "massive cave is present" event, with at least one location in it. I wonder if that's the best way to handle them. It looks as though cavegen.cpp only notifies at the beginning and end of tunnels, but I'm guessing that includes the caves themselves. I've never used gennotify.

What I'd really like is a special biome for the different cave types, but the biome table is two-dimensional.

It might turn out to be easier to copy the (single) massive cave noise from the mapgen parameters and use that to get the coordinates in mods. You'd need several chunks worth of data to get a good idea of where to place large structures, and gennotify only seems to apply to the chunk you're in.

Of course, my valleys_c helper mod just treats any open area underground the same, so I get enormous forests of three-meter mushrooms, but nothing huge. However, since it counts the open air space above a spot, I could easily plant larger schematics, at the risk of their intersecting a wall. I could even do a quick loop through the entire chunk to get an idea of how much air is in it. The loops are trivial compared to the overhead of voxelmanip pulling the data table and the creation of the noise tables I use.
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Wed Jan 27, 2016 03:02

Your image link seems borked.

I agree, it is very hard to tell from screenshots. If you have the time and want to see what I am talking about then do this... Find a new massive cave and explore just enough to get a good idea of it's shape. Now quickly exit and then run the world again only this time with the Subterrain mod active (be sure you have adjusted the upper limit, threshold and blend to match what you have valleys set to). Finish exploring the cave. I think you will see right away.
 

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 » Wed Jan 27, 2016 03:19

blert2112 wrote:Your image link seems borked.

I agree, it is very hard to tell from screenshots. If you have the time and want to see what I am talking about then do this... Find a new massive cave and explore just enough to get a good idea of it's shape. Now quickly exit and then run the world again only this time with the Subterrain mod active (be sure you have adjusted the upper limit, threshold and blend to match what you have valleys set to). Finish exploring the cave. I think you will see right away.


I think the image is fixed.

I'm going to check that out. I'm assuming you're not running a valleys mapgen world with the massive caves and then running subterrain on top of that. I've no idea what that would do. If the cave generation didn't match exactly (it wouldn't since they don't handle numbers the same) it would produce interference between the two systems.

Edit: By golly, you guys are better at this than I am. One misplaced number wrecked havoc with the generation. However, I also discovered another problem that was causing issues with the cave floor. I'm going to update both the pull request and frankencaves immediately.
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Wed Jan 27, 2016 03:55

duane wrote:I think the image is fixed.

I'm going to check that out. I'm assuming you're not running a valleys mapgen world with the massive caves and then running subterrain on top of that. I've no idea what that would do. If the cave generation didn't match exactly (it wouldn't since they don't handle numbers the same) it would produce interference between the two systems.

Yup, just running it right on top of vmg with massive caves, no problems since the lua mod just replaces what the c++ did for ungenerated areas, it is slow though.
But, I think I figured it out and am checking now. Being not so smart, I forgot about the octaves. I increased them to 6, as in the mod, and it seems to be a pretty close match.

I have another question for you...
this line added to the tcave cache loop:
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
printf("tcave: %f \n", tcave_cache[y - node_min.Y + 1]);

Always returns "1.000". If I then have it print what it thinks the value for massive_cave_threshold is, it also always returns "1.000". This is with, or without, the settings being specified in .conf
Am I writing that printf() statement wrong?
If I do 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
float tcave = 0.6f;

It prints out the "0.6" properly.

edit: yup, with the octaves increased to 6 it is a dead ringer for the Subterrain mod. You, and Paramat, do amazing work.
 

PreviousNext

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 14 guests

cron