Could anyone knowing well lua confirm this please ? I think I've found why there are too much marsh (for me
) :
Function AddFeatures() (lines 3593....)
------>>> We are in the case where 'temp>=jungleThreshold' (see the else) so the calculation "rainfallMap.data > PWRand() * marshRange + jungleThreshold" is not considered because temp is always >= jungleThreshold whatever the result of PWRand() * marshRange.
So the real test is 'temperatureMap.data > mc.treesMinTemperature' , leading to have a marsh if there is no chance to have trees?
Edit: I would replace the incriminated code with
It would make use of the mc.marshPercent that is not used for now.
) :Function AddFeatures() (lines 3593....)
Spoiler :
Code:
if rainfallMap.data[i] < jungleThreshold then
if not plot:IsMountain() then
local treeRange = jungleThreshold - zeroTreesThreshold
if rainfallMap.data[i] > PWRand() * treeRange + zeroTreesThreshold then
if temperatureMap.data[i] > mc.treesMinTemperature then
TerrainBuilder.SetFeatureType(plot, featureForest)
end
end
end
else
local marshRange = 1.0 - jungleThreshold
------>>> if rainfallMap.data[i] > PWRand() * marshRange + jungleThreshold and temperatureMap.data[i] > mc.treesMinTemperature then
TerrainBuilder.SetTerrainType(plot, g_TERRAIN_TYPE_GRASS)
TerrainBuilder.SetFeatureType(plot, featureMarsh)
else
------>>> We are in the case where 'temp>=jungleThreshold' (see the else) so the calculation "rainfallMap.data > PWRand() * marshRange + jungleThreshold" is not considered because temp is always >= jungleThreshold whatever the result of PWRand() * marshRange.
So the real test is 'temperatureMap.data > mc.treesMinTemperature' , leading to have a marsh if there is no chance to have trees?
Edit: I would replace the incriminated code with
Code:
local marshThreshold = rainfallMap:FindThresholdFromPercent(mc.marshPercent,false,true)
if rainfallMap.data[i] < marshThreshold and temperatureMap.data[i] > mc.treesMinTemperature then
Last edited:
