I could place dirt on the floor here, but I think I'd rather leave that up to mods. (The dirt you see here is being placed by a mod.)
blert2112 wrote: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".
mg_valleys_massive_cave_threshold = 7blert2112 wrote:The value will change as you approach the top and bottom limits so that the ceilings and floors don't end up being flat cutoff surfaces. It blends them to look more natural. At least, that is how I understand it.
paramat wrote:Yes this.
Beyond the y values the cave noise threshold is smoothly increased to taper the caves down to nothing.
So the threshold will be mostly 0.6, but near the top and base limits it will increase.
blert2112 wrote:Regarding the tcave values of '1.00000' that I am/was getting. For some reason I am now getting correct values. No clue what has happened other than I deleted the old world and started a new one. I am going to clean out my build folder and start fresh just in case. Having to run cmake again is a bear, guess I should make a script instead of doing it through the gui.
duane wrote:... I didn't know it had a gui.
#define MASSIVE_CAVE_YBLMIN -32808 // -33000 + MASSIVE_CAVE_BLEND * 1.5
# Where the map generator stops.
# Please note:
# - Limited to 31000 (setting above has no effect)
# - The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks).
# - Those groups have an offset of -32, -32 nodes from the origin.
# - Only groups which are within the map_generation_limit are generated
# type: int min: 0 max: 31000
# map_generation_limit = 31000
blert2112 wrote:I don't think that the lower limit should be hardcoded into the massive caves code...
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp
index 85df4cc..c29cc35 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen_valleys.cpp
@@ -75,6 +75,10 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenParams *params, EmergeManager *
this->heatmap = NULL;
this->humidmap = NULL;
+ this->map_gen_limit = MYMIN(MAX_MAP_GENERATION_LIMIT,
+ g_settings->getU16("map_generation_limit"));
+ printf("mgl: %f\n", this->map_gen_limit);
+
MapgenValleysParams *sp = (MapgenValleysParams *)params->sparams;
this->spflags = sp->spflags;
@@ -842,7 +846,7 @@ void MapgenValleys::generateCaves(s16 max_stone_y)
v3s16 em = vm->m_area.getExtent();
- float yblmin = MASSIVE_CAVE_YBLMIN;
+ float yblmin = -map_gen_limit + MASSIVE_CAVE_BLEND * 1.5f;
float yblmax = massive_cave_depth - MASSIVE_CAVE_BLEND * 1.5f;
bool made_a_big_one = false;
float tcave_cache[csize.Y + 2];
@@ -864,11 +868,11 @@ void MapgenValleys::generateCaves(s16 max_stone_y)
// This allows random lava spawns to be less common at the surface.
s16 lava_chance = pow(lava_features, 3)
* ceil((lava_max_height - node_min.Y + 1)
- * 10.f / MAX_MAP_GENERATION_LIMIT);
+ * 10.f / map_gen_limit);
// This allows random water spawns to be more common at the surface.
s16 water_chance = pow(water_features, 3)
- * ceil((MAX_MAP_GENERATION_LIMIT - abs(node_min.Y) + 1)
- * 10.f / MAX_MAP_GENERATION_LIMIT);
+ * ceil((map_gen_limit - abs(node_min.Y) + 1)
+ * 10.f / map_gen_limit);
u32 index_2d = 0;
u32 index_3d = 0;
diff --git a/src/mapgen_valleys.h b/src/mapgen_valleys.h
index 7b338c7..fb3c0cd 100644
--- a/src/mapgen_valleys.h
+++ b/src/mapgen_valleys.h
@@ -36,7 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Cave blend distance near YMIN, YMAX
#define MASSIVE_CAVE_BLEND 128.f
-#define MASSIVE_CAVE_YBLMIN -32808 // -33000 + MASSIVE_CAVE_BLEND * 1.5
class BiomeManager;
@@ -113,6 +112,8 @@ class MapgenValleys : public Mapgen {
int ystride;
int zstride;
+ float map_gen_limit;
+
u32 spflags;
bool humid_rivers;
bool use_altitude_chill;
duane wrote:Why is the lower limit 33000? I thought the map limit was 31000.
Fixerol wrote:I'm playing latest GIT and I have strange feeling that RNG is forcing jungles on me, lots of jungles near rivers.


Here's a fun place to start. You only have a few trees, but there's lots of sparkling water, colorful reefs, several deep caves, and goblins playing in the surf. Watch out for the crocodiles!
Fixerol wrote:Since last humidity changes my favourite place suffered some climate changes :) Yes, jungles yet again. This kind of jungle blend feels really strange and off balance. BTW, second screenshot features Filmic HDR PR (much better colours ingame).
Even more fun... since they are desert ones now... bare sand.
noise_humidity->result[index_2d] *= (1 + pow(0.5f, MYMAX((surface_max_y - noise_rivers->result[index_2d]) / 3.f, 0.f))) * humidity_offset;function vmg.get_humidity_raw(pos)
local v13 = vmg.get_noise(pos, 13) -- Clayey soil : wetter
local v15 = vmg.get_noise(pos, 15) -- Sandy soil : drier
local v18 = vmg.get_noise(pos, 18) -- Humidity noise
return 2 ^ (v13 - v15 + v18 * 2) -- Make sure that humidity is positive. Humidity is between 0.25 and 16.
end
function vmg.get_humidity(pos)
local y = pos.y
local flatpos = pos2d(pos)
local hraw = vmg.get_humidity_raw(flatpos)
-- Another influence on humidity: Dirt thickness, because when the dirt layer is very thin, the soil is drained.
local v7 = vmg.get_noise(flatpos, 7)
local thickness = math.max(v7 - math.sqrt(math.abs(y)) / dirt_reduction, 0) -- Positive
local soil_humidity = hraw * (1 - math.exp(-thickness - 0.5)) -- Yes I love exponential-like functions. You can modelize whatever you want with exponentials !!!
-- Get base ground level to know the river level that influences humidity
local v1 = vmg.get_noise(flatpos, 1)
local v3 = vmg.get_noise(flatpos, 3) ^ 2
local base_ground = v1 + v3
local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) -- At the sea level, sea_water is 1. Every 6 nodes height divide it by 2.
local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) -- At the river level, river_water is 1. Every 3 nodes height divide it by 2.
local water = sea_water + (1 - sea_water) * river_water -- A simple sum is not satisfactory, because it may be bigger than 1.
return soil_humidity * (1 + water)
end
noise_humidity->result[index_2d] += 50 * (1 + pow(0.5f, MYMAX((surface_max_y - noise_rivers->result[index_2d]) / 3.f, 0.f))) * humidity_offset - 50;
Does bumping the noise offsets for humidity and temperature down help or does that just cause problems in the highlands?
TheReaperKing wrote:Congratulations on having your work added to the official version!!!
Fixerol wrote:Maybe adjusting those parameters will eliminate jungles at least in those alien biomes (also in deep forested valleys).
mg_valleys_spflags = noaltitude_chill,nohumid_riversGael de Sailly wrote:February 8th 2015, first line of VMG's code. A year on, already.
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
mg_valleys_spflags = noaltitude_chill,nohumid_rivers
Fixerol 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
mg_valleys_spflags = noaltitude_chill,nohumid_rivers
I think it is not good with those, also weird thought come to me: i can actually outrun the mapgen when fast fly is enabled, is it ok?
Users browsing this forum: Bing [Bot] and 9 guests