Align terrain movement snowline parameters with shader and add polar land ice threshold
This commit is contained in:
@@ -7,8 +7,9 @@ mountain_rock_height_km: 2.3 # Height in km >= 2.3 is rocky mountain
|
||||
snow_height_km: 3.1 # Altitude in km >= 3.1 is high peak snow
|
||||
polar_snow_line_enabled: true # Whether latitude reduces snowline altitude
|
||||
polar_snow_line_base_km: 2.5 # Base snowline at temperate latitudes
|
||||
polar_snow_factor_start: 0.88 # Latitude distFromCenter where polar cooling starts (polar caps only)
|
||||
polar_snow_factor_end: 0.98 # Latitude distFromCenter where sea-level snowline is reached
|
||||
polar_snow_factor_start: 0.40 # Latitude distFromCenter where polar cooling starts (matches simple.frag)
|
||||
polar_snow_factor_end: 0.85 # Latitude distFromCenter where sea-level snowline is reached (matches simple.frag)
|
||||
polar_land_ice_threshold: 0.72 # Latitude distFromCenter where sea-level polar ice starts (matches simple.frag)
|
||||
|
||||
# Slope and elevation movement penalties
|
||||
# Elevation difference (deltaH in km) between hex centers
|
||||
|
||||
@@ -12,8 +12,9 @@ TerrainMovementConfig::TerrainMovementConfig()
|
||||
snowHeightKm(3.1f),
|
||||
polarSnowLineEnabled(true),
|
||||
polarSnowLineBaseKm(2.5f),
|
||||
polarSnowFactorStart(0.88f),
|
||||
polarSnowFactorEnd(0.98f),
|
||||
polarSnowFactorStart(0.40f),
|
||||
polarSnowFactorEnd(0.85f),
|
||||
polarLandIceThreshold(0.72f),
|
||||
uphillSlopeMultiplier(4.0f),
|
||||
downhillSlopeBonusMultiplier(2.0f),
|
||||
minStepCost(0.25f),
|
||||
@@ -77,6 +78,9 @@ bool TerrainMovementManager::loadConfig(const QString &filePath)
|
||||
if (root.hasChild("polar_snow_factor_end")) {
|
||||
m_config.polarSnowFactorEnd = root["polar_snow_factor_end"].asFloat(0.85f);
|
||||
}
|
||||
if (root.hasChild("polar_land_ice_threshold")) {
|
||||
m_config.polarLandIceThreshold = root["polar_land_ice_threshold"].asFloat(0.72f);
|
||||
}
|
||||
|
||||
if (root.hasChild("uphill_slope_multiplier")) {
|
||||
m_config.uphillSlopeMultiplier = root["uphill_slope_multiplier"].asFloat(4.0f);
|
||||
@@ -164,6 +168,13 @@ QString TerrainMovementManager::getTerrainType(int tx, int ty, Matrix2D<TerrainP
|
||||
return "sneeuw";
|
||||
}
|
||||
}
|
||||
if (distFromCenter >= m_config.polarLandIceThreshold) {
|
||||
float tIce = std::max(0.0f, std::min(1.0f, (distFromCenter - m_config.polarLandIceThreshold) / 0.20f));
|
||||
float polarLandIce = tIce * tIce * (3.0f - 2.0f * tIce);
|
||||
if (polarLandIce > 0.5f) {
|
||||
return "sneeuw";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Rocky mountain
|
||||
|
||||
@@ -41,6 +41,7 @@ struct TerrainMovementConfig {
|
||||
float polarSnowLineBaseKm;
|
||||
float polarSnowFactorStart;
|
||||
float polarSnowFactorEnd;
|
||||
float polarLandIceThreshold;
|
||||
|
||||
float uphillSlopeMultiplier;
|
||||
float downhillSlopeBonusMultiplier;
|
||||
|
||||
Reference in New Issue
Block a user