1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

AI Attitude Explained

Discussion in 'Civ4 Strategy Articles' started by ori, Jan 27, 2007.

  1. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    That is a very nice nice piece of intel, ori. Thank you :hatsoff:
     
  2. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,135
    Location:
    Madrid
    Thanks for the info, Ori.

    The first time I read this thread it was way over the cpacities of my head. I feel better prepared now.


    Two questions:

    - BTS and Item 6. Now there is a visible "-1 we don't like your having vassals".
    Is there still the invisible -1 due to Item 6, "you have 1 vassal, I have none, your team has one more member than mine"? If the answer is yes it would mean that taking a vassal gets a -2 with everyone instead of a -1.
    Or maybe Item 6 is simply visible now?

    - Item 10: WarSuccess. Is that the number of your units that they have killed? Or is it the grand total of units they have killed, no matter which nationality the dead units were (and does it include barb killed units in that case?)?
     
  3. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
    out of the top of my head (I'll check again - but don't have the files while at work ;)):
    item6 is visible
    warsuccess just adds killed units and captured cities where cities are weighed slightly more than one unit (but not really much a city is worth I think somewhere in the range of 5-10 units)...
     
  4. Yamps

    Yamps Chieftain

    Joined:
    Aug 30, 2007
    Messages:
    2,728
    Location:
    Zagreb, Croatia
    Well, this issue is always relevant I guess. :D Here's a question regarding the UN vote:

    So, according to this post TeamAttitude is used for UN voting. However, you also state that the actual integer value is used for this. How does this combine with vassals? Say you have a Friendly civ and a vassal that is hated by that civ. Friendly towards you and Furious towards the vassal gets averaged to Cautious towards the team. Would your Friendly civ vote for you in the UN? According to my WB tests, yes it would. Apparently only the integer value matters. Here's the actual WB example:

    I'm playing as Shaka, Hannibal is at high Pleased (+10 shown), Monty and Cyrus are my vassals and Hannibal hates their guts at -100 furious. UN voting comes in and all 3 vote for me, with Boudica as rival.

    I've noticed team attitude averaging: Hannibal is giving the "we don't like you enough" deny for the request to attack Boudica. His thresholds are Pleased/Cautious for the attack. However, if I modify the relations and he is Pleased towards me, Cautious towards Monty and Friendly towards Cyrus, this gets averaged to Pleased and he is willing to attack her.

    I'd appreciate some insights, how does team attitude actually come into play regarding UN voting? Or it doesn't come into play at all, judging by this example?
     

    Attached Files:

  5. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
    Vassals are weird - without looking at the code (I wrote most of this pre-warlords) I would say they are not used in this instance - they are sometimes used as team members and sometimes not :crazyeye: I'll try to find the code though...
     
  6. Yamps

    Yamps Chieftain

    Joined:
    Aug 30, 2007
    Messages:
    2,728
    Location:
    Zagreb, Croatia
    Thanks! It seems that they are not relevant here. Perhaps team attitude makes some difference in other team situations (PA and pregame team selection), I've only tested vassals.
     
  7. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
    I am sure it takes into account PA partners - but I have not found any mention of vassals...
     
  8. obsolete

    obsolete Chieftain

    Joined:
    Dec 17, 2005
    Messages:
    6,201
    Location:
    Planet Earth
    When you capture a stack of workers, do these count as KILLED units to the AI? I am guessing not because they have no att/def attribute. On the other hand, when you capture a tile and destroy a ton of airships, I assume they count as killed, despite they lack a def attribute.

    Also, it seems to be a flaw to me that the game would determine on how it is winning or losing the war just due to # of units lost/killed, instead of the total hammers of those units.

    If I lose 20 units, and he loses 10 units, but I have killed 10 battleships, and he killed 20 warriors then you see how erroneous this can be. AND YES, THIS HAS REALLY HAPPENED!

    A good example is ICBMs, if I lose 3 to SDI, I only count as 3 lost units, but if 2 get through and rape a small stack, the AI will count me as winning by a huge margin, even if I have spent far more hammers on those ICBMs than they returned worth in damage.

    Another good question, do missiles and nukes count as LOST units themselves, since when they impact they are .... well lost.
     
  9. CDC989

    CDC989 Chieftain

    Joined:
    Jan 28, 2009
    Messages:
    22
    Isn't Warlord a higher difficulty level than Chieftain? If so, why would you get +1 on Warlord and 0 on Chieftain? Or am I completely wrong?
     
  10. obsolete

    obsolete Chieftain

    Joined:
    Dec 17, 2005
    Messages:
    6,201
    Location:
    Planet Earth
    This seems a bit off to me. I've had times where AI is willing to beg for peace to me. But I decide to just take one more city, so I attack one more stack, and capture and extra city. But because I lost a couple units doing so, the AI goes back into refusal to talk mode, so then extends the war for a bunch of extra turns before he comes out willing to negotiate for peace again. Surely taking a city AND killing another stack should more than make up for losing a couple units?
     
  11. Conquistador 63

    Conquistador 63 Gypsy King

    Joined:
    Mar 30, 2006
    Messages:
    2,212
    Location:
    Brazil
    First of all, apologies for thread necromancy.
    I have been using this thread as a reference for a long time, but only recently took the time to apply the hidden modifiers' formulae trying to predict diplomatic/religious votes in a real game.

    In such game (Immortal level), I was the only candidate for religious victory and I had Peter at (visible) +9. Even then, he abstained. Worthy noticing that in said game I was last in score (rank THEM=3) and Peter was next to last (rank US=2). So I came and looked at possible invisible negative modifiers, as listed below:

    Item 1: US iBaseAttitude = 0 (XML value for Peter)
    Item 2: THEM iAttitudeChange= -1 (noble +)
    Item 3: If AggressiveAI option is ON AND THEM is Human:-2, but Agg AI was off so = 0
    Item 4 & 5: AI-AI only
    Item 6: not a team game so = 0
    Item 7: if THEM is higher ranking:+(RankDifference*iWorseRankDifferenceAttitudeChange/(NumberOfPlayersEverAlive+1)):
    Item 8: if THEM is lower ranking:+((-RankDifference)*iBetterRankDifferenceAttitudeChange/(NumberOfPlayersEverAlive+1))
    I'm not 100% sure but I believe I believe only 8 applies, and the result would be (-(-1)*2)/(4+1)= +0.4

    Item 9: if US rank >= NumberOfPlayersEverAlive/2 AND THEM rank >= NumberOfPlayersEverAlive/2 = +1
    We were both underdogs so +1 would apply.
    Item 10: 0, no wars were fought.

    Net result from invisible modifiers would be -1 (item2) + 0.4 (item8) +1 (item9)= + 0.4

    How come visible +9 was not enough if I needed > +7 for the vote?
     
  12. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
  13. Conquistador 63

    Conquistador 63 Gypsy King

    Joined:
    Mar 30, 2006
    Messages:
    2,212
    Location:
    Brazil
    Thanks for the reply.
    I was the AP owner (built in Judaism), and sole candidate - no one had the AP religion as a state religion. Peter and me shared Christianism.
     
  14. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
    one more thing I could think of: did you have any vassals or permanent allies?
    note that this is somewhat outdated since I never really got around updating it for the BtS (though the hidden modifiers are still the same - except that BtS abolished the -2 for aggressive AI).
     
  15. Conquistador 63

    Conquistador 63 Gypsy King

    Joined:
    Mar 30, 2006
    Messages:
    2,212
    Location:
    Brazil
    No vassals or PAs existed in that game. Not really a big deal, I was able to win a few elections later, when the AI reached friendly (and our votes combined reached the necessary %).

    More important is to confirm if I used the right item (8), when I had a lower score than the AI, even if it says "if THEM is lower ranking" - actually my rank would be higher than his, according to the OP definition. I got somewhat confused about that point.

    In that game was fun to notice that right after gifting a tech to Peter, he went from friendly to pleased, as the gift made him overtake another AI in score and most likely I lost the hidden underdog +1 bonus.
     
  16. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,527
    Location:
    Baden-Württemberg, Germany
    you got the right one - though it doesn't matter since the game always rounds down the fractions - so the net effect is 0. Still a +9 should have been sufficient to get him to vote for you :dunno:
     
  17. DaveMcW

    DaveMcW Chieftain

    Joined:
    Oct 8, 2002
    Messages:
    6,489

Share This Page