- Joined
- Mar 5, 2017
- Messages
- 4,173
Hi all,
Water luxuries tend to cluster together away from the fish and crabs. I think the relevant code in ResourceGenerator.lua is this:
Any idea what numbers could be modified to allow water luxuries to be placed more frequently than water bonuses?
Water luxuries tend to cluster together away from the fish and crabs. I think the relevant code in ResourceGenerator.lua is this:
function ResourceGenerator:__PlaceWaterLuxury(eChosenLux, pPlot)
if (ResourceBuilder.CanHaveResource(pPlot, self.eResourceType[eChosenLux])) then
-- Randomly detetermine each plot if a water luxury is placed less likely if there are adjacent of the same type
local iBonusAdjacent = 0;
if( self.iStandardPercentage < self.iTargetPercentage) then
iBonusAdjacent = -1.5;
elseif ( self.iStandardPercentage > self.iTargetPercentage) then
iBonusAdjacent = 1;
end
local iRandom = 15 * self.iOccurencesPerFrequency + 300;
--print ("Random Frequency: " , iRandom);
local score = TerrainBuilder.GetRandomNumber(iRandom, "Resource Placement Score Adjust");
score = score / ((ResourceBuilder.GetAdjacentResourceCount(pPlot) + 1) * (3.0 + iBonusAdjacent));
if(score * self.iSeaFrequency[eChosenLux] >= 85 + 5 * self.iOccurencesPerFrequency) then
ResourceBuilder.SetResourceType(pPlot, self.eResourceType[eChosenLux], 1);
return true
end
end
return false;
end
Any idea what numbers could be modified to allow water luxuries to be placed more frequently than water bonuses?