Leaderhead Flavor/Bias limits?

Joined
Jul 31, 2014
Messages
836
Hi all,

With regards to leader flavors and biases (the ones found in the leaders table), if I remember correctly, these values are hard-capped in the .DLL (a maximum of like 10 or 20)?

Does anyone know where these caps are defined inside the DLL .cpp files?
 
CvFlavorManager.cpp, RandomizeWeights function

Code:
void CvFlavorManager::RandomizeWeights()
{
	int iI;
	int iMin, iMax, iPlusMinus;

	iMin = /*0*/ GC.getPERSONALITY_FLAVOR_MIN_VALUE();
	iMax = /*20*/ GC.getPERSONALITY_FLAVOR_MAX_VALUE();
	iPlusMinus = /*2*/ GC.getFLAVOR_RANDOMIZATION_RANGE();

	for(iI = 0; iI < GC.getNumFlavorTypes(); iI++)
	{
		// Don't modify it if it's zero-ed out in the XML
		if(m_piPersonalityFlavor[iI] != 0)
		{
			m_piPersonalityFlavor[iI] = GetAdjustedValue(m_piPersonalityFlavor[iI], iPlusMinus, iMin, iMax);
		}
	}
}

So it doesn't seem to be hardcoded - it's capped by some Defines (see GlobalAIDefines.xml).
 
The flavors aren't hard capped, but I warn you setting them to anything above 10 or so will lead to very odd AI behavior. The code in many cases assumes that flavors are reasonably low when calculating ratios.
 
@ Pawels, thanks! Entirely overlooked that file.... was looking throughout CvInfos/CvPlayerAI/CvDiplomacy, no wonder xD

@ ls612, Time to set Gandi nukes to >9000 then :lol:

(They are needed to be low due to flavors, especially growth and expansion, being used as numerators/denominators & co-efficients of each other right?)
 
Top Bottom