Time for some testing to figure out how the power of a land target neighbor affects the willingness of an AI to peace vassal to a player.
We will attack this from the data side since I don't read code.
First, a test game where Alex shares a long border with Cathy to turn on Land Target status.
Both are given 100,000 Soldiers.
The player is given twice the land, twice the population, and 3 times as many soldiers to activate Peace Vassal for Alex.
..
....
Huh, Alex says he is doing fine on his own.
The player needs 3.6 times the power of Alex to get him to peace vassal.
I thought is was 3.0 times the power of the AI or 1.5 times the power if the player was a Land Target of the AI.
Anyway, world builder's diplo mode is used to bring the player up to +10 Friendly with Alex.
He is willing to peace vassal once the player has 361,000 Soldiers to Alex's 100,000.
Relations are lowered to +9 Pleased with Alex. (Alex will no longer peace vassal)
Cathy's power is raised microscopically to 102,000 Soldiers (Alex will peace vassal
)
Relations are lowered to +8 Pleased with Alex. (Alex will no longer peace vassal)
Cathy's power is raised to 132,000 Soldiers. (Alex will not peace vassal)
Cathy's power is raised to 134,000 Soldiers. (Alex will peace vassal
)
Relations are lowered to +7 Pleased with Alex. (Alex will no longer peace vassal)
Cathy's power is raised to 166,000 Soldiers. (Alex will not peace vassal)
Cathy's power is raised to 168,000 Soldiers. (Alex will not peace vassal)
With these 3 data points, it might be possible to figure out the math formula.
Code still says:
Code:
if (kLoopTeam.getPower(true) > getPower(true))
{
iAttitudeModifier += (3 * kLoopTeam.getPower(true)) / std::max(1, getPower(true)) - 2;
It seems to say the attitude modifier is (3 * Cathy's power / Stalin's power) - 2.
When Cathy and Stalin both have 100,000 soldiers, this equation is presumably (3*100/100) - 2
3-2=1.
But the part higher up says the attitude modifier
only occurs if Cathy has more power than Stalin.
Go to the next data point, 102,000 soldiers for Cathy. (She now has more power than Stalin)
(3*102/100) - 2 = 1.06 or +1 diplo relations. That boosts the +9 Pleased secretly back up to +10 Friendly and Alex will peace vassal.
The next data point is 132,000 soldiers for Cathy.
(3*132/100) - 2 = 1.96 or +1 diplo relations. This is not enough to boost +8 Pleased up to +10 Friendly, and Alex will not peace vassal.
The next data point is 134,000 soldiers for Cathy.
(3*134/100) - 2 = 2.02 or +2 diplo relations. That boosts the +8 Pleased secretly up to +10 Friendly and Alex will peace vassal.
The next data point is 166,000 soldiers for Cathy.
(3*166/100) - 2 = 2.98 or +2 diplo relations. This is not enough to boost +7 Pleased up to +10 Friendly, and Alex will not peace vassal.
The last data point is 168,000 soldiers for Cathy.
(3*168/100) - 2 = 3.04 or +3 diplo relations. That boosts the +7 Pleased secretly up to +10 Friendly and Alex will peace vassal.
The formula works!
If a peace vassal candidate is bordered by another AI enough to activate Land Target status, then
the player will receive a secret diplo modifier if the land target AI has more power (soldiers) than the peace vassal candidate following the formula:
Attitude Modifier = Floor (3 * Land_Target_AI_Power / Peace_Vassal_AI_Power) - 2
A civ will never peace vassal at Furious no matter what the Attitude Modifier is at.