AI Alliances

Petromax

Chieftain
Joined
Jun 12, 2014
Messages
37
Does anyone know what it is that triggers the ais to start forming anti-player alliances? Is it some number of cities, or tech level?
 
Having a Supreme power with number of cities greater than 4 after turn 200 and at difficulty harder than Chieftain makes computer players jealous and angry at you and form alliances against you.
 
Having a Supreme power with number of cities greater than 4 after turn 200 and at difficulty harder than Chieftain makes computer players jealous and angry at you and form alliances against you.
if I'm not mistaken there is also a condition for checking if the player has built the Great Wall or the UN, if the human player has such buildings, then the dominance variable is not included?

and there is also a check for the byte byte_64C7A5 to see if it is equal to zero or not, what is it responsible for?
 
checking if the player has built the Great Wall or the UN
It is not for human player, but for two computer players.
C-like:
// 0055E5D4
      if ( sub_403558(aCiv1, aCiv2)
        && !j_Q_CivHasWonder_sub_453E51(aCiv2, 6) //Great Wall
        && !j_Q_CivHasWonder_sub_453E51(aCiv2, 0x18) //United Nations
        && (V_Civs_stru_64C6A0[aCiv1].Government < 5u || (V_Civs_stru_64C6A0[aCiv1].Treaties[aCiv2] & 0x800) != 0)
        || sub_403558(aCiv2, aCiv1)
        && !j_Q_CivHasWonder_sub_453E51(aCiv1, 6)
        && !j_Q_CivHasWonder_sub_453E51(aCiv1, 0x18)
        && (V_Civs_stru_64C6A0[aCiv2].Government < 5u || (V_Civs_stru_64C6A0[aCiv2].Treaties[aCiv1] & 0x800) != 0) )
      {
I believe this branch is for their relations.
And if not - other branch for human player. It involves a lot of other checks, but the main is:
C-like:
// 0055EB9D
v40 = (V_Game_stru_655AE8.HumanPlayersBits & (1 << i)) != 0
                   && V_Game_stru_655AE8.CivsRating[i] == 7
                   && V_Game_stru_655AE8.DifficultyLevel
                   && V_Civs_stru_64C6A0[i].Cities > 4
                   && V_Game_stru_655AE8.Turn > 200;
byte_64C7A5
Did not find it. At what offset?
 
Did not find it. At what offset?
if ( byte_655C22[a1] == 7
&& word_64C708[714 * a1] > 4
&& word_64C708[714 * a2] > 1
&& !byte_64C7A5[1428 * a1]
&& byte_655B08 )
{
dword_64B11C = word_655AF8 > 200;
}
one of the conditions in those checks is byte_64C7A5, but you don't see it in the structure, although it's a different section of code at a different address 004575D0

below is a check for wonders of the world
if ( sub_40259F(a1, 6) || sub_40259F(a1, 24) )
{
dword_64B11C = 0;
where the variable dword_64B11C is either reset or remains one if it was set above. here this variable is responsible for activating the dominance mode 00457B08
 
Last edited:
That is a different function sub_45705E for relations between P1 and P2 (player1 and player2). Here dword_64B11C is some sort of vendetta flag. It is set with almost the same conditions:
  • P1 Power = Supreme
  • P1 cities > 4
  • P2 cities > 1
  • Difficulty > Chieftain
  • Turn > 200
  • P1 doesn't have Nuke.
GreatWall or UN of P1 resets this flag.
Later this flag is used in several functions for some decisions of P2 about P1.
But forming alliances against human player is in different function sub_55D8D8. This is the only one function with reference to SIGNALLIED and SIGNNATO messages (GAME.TXT).
 
Top Bottom