Civ4LeaderHeadInfos deciphering

Khoukharev

Chieftain
Joined
Dec 1, 2007
Messages
97
Location
Moscow, Russia
Could you please help me to understand what exactly these lines do

Code:
<iBaseAttitude>0</iBaseAttitude>
<iBasePeaceWeight>0</iBasePeaceWeight>
<iPeaceWeightRand>3</iPeaceWeightRand>
<iWarmongerRespect>2</iWarmongerRespect>

<iEspionageWeight>100</iEspionageWeight>


<iRefuseToTalkWarThreshold>8</iRefuseToTalkWarThreshold>

<iNoTechTradeThreshold>5</iNoTechTradeThreshold>
<iTechTradeKnownPercent>30</iTechTradeKnownPercent>

I tried to look there, but "UNKNOWN EFFECT" is not exactly the explanation I can use.

Thanks in advance!
 
Please note that this forum is for completed tutorials and reference documents; questions like this are better off in the main C & C forum which will get much more traffic.

Anyhow, I can answer most of this.
Code:
<iBaseAttitude>0</iBaseAttitude>
<iBasePeaceWeight>0</iBasePeaceWeight>
<iPeaceWeightRand>3</iPeaceWeightRand>
<iWarmongerRespect>2</iWarmongerRespect>

These are all Attitude modifiers. ori's Attitude explained topic gives a good overview of this kind of thing.

iBaseAttitude is that leader's starting attitude value with everyone. For example, if Shaka's iBaseAttitude is -1, he will immediately start at a -1 attitude value towards anyone he meets.

iBasePeaceWeight and iPeaceWeightRand are the two components of one of the more complex attitude modifiers called (unsuprisingly) PeaceWeight. At the start of the game, every AI is given a PeaceWeight value which is the sum of their Base and a random number from zero to their iPeaceWeightRand-1. If iBasePeaceWeight is 5 and iPeaceWeightRand is 3 then that leader will have a PeaceWeight Value of 5, 6, or 7.

Then this impacts that AIs relations with other AIs in the following manner:
Code:
iAttitude += (4 - abs(AI_getPeaceWeight() - GET_PLAYER(ePlayer).AI_getPeaceWeight()));
The absolute difference between the 2 AI adjusted PeaceWeights is subtracted from 4 and that attitude modifier is in place for both of them. As an example, if both had an adjusted PeaceWeight of 12 then they would each get +4 relations with each other because 4 - |12-12| = 4. On the other hand, if one AI has a PeaceWeight of 2 and the other has a PeaceWeight of 10, they would each have -4 with each other because 4 - |10-2| = -4. The PeaceWeight only impacts AI-AI relations and has no effect on that leader's dealing with human players.

iWarmongerRespect is another AI-AI attitude modifier and a much simpler one. In relations between 2 AIs they each receive an attitude modifier equal to the smaller of their respective iWarmongerRespect numbers. So if both have a iWarmongerRespect of 2, they each get a +2. If one has a iWarmongerRespect of 2 and the other has 0, they each get a 0 modifier (i.e. no change).

Code:
<iEspionageWeight>100</iEspionageWeight>
This is used in determining how much of an AIs commerce will be dedicated towards Espionage. It also impacts AI strategy and civic valuations. I believe higher numbers mean higher espionage spending and usage but the strategy code is kinda confusing in this regard.

Code:
<iRefuseToTalkWarThreshold>8</iRefuseToTalkWarThreshold>
This one should be fairly self-explanatory. The higher the number, the longer they will refuse to negotiate with an opponent while at war.

Code:
<iNoTechTradeThreshold>5</iNoTechTradeThreshold>
This is the infamous "We fear you are becoming too advanced" limit. The WFYABTA topic explains this better than I could. In simplest turns, the lower this number, the more likely the AI is to refuse to trade any techs with you because of other trades you have made.

Code:
<iTechTradeKnownPercent>30</iTechTradeKnownPercent>
This is the tech monopoly limit; "we don't want to start trading this away just yet" or something similar. The AI will refuse to trade any tech it has until at least this percent of the people they have met know that tech. The lower the number, the more willing they will be to trade their techs.
 
Top Bottom