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

Vox Populi Diplomacy Feedback

Discussion in 'Community Patch Project' started by HeathcliffWarriors, Nov 25, 2019.

  1. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    I think there will be another hotfix, so 12-20-3 is probably right.

    The DLL alterations (which comprise the bulk of the changes) are in any of the 12-20 versions, although the missing opinion changes are somewhat substantial.

    I'll await more feedback over the holidays before making any adjustments.

    Re: Land disputes, it's based on tiles that you own near one of the AI's cities that they want.
     
    Teholb likes this.
  2. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    Alright, all changes should be added as of the new hotfix (12-20-3), thanks to Gazebo.

    (I highly recommend using it.) :)
     
  3. lunker

    lunker Warlord

    Joined:
    Oct 6, 2016
    Messages:
    268
    One thing that I would like to see is more agency when it comes to the modifier "You are competing for the favour of the same City-States!". Most times this activates when I complete a CS quest accidentally, ruining existing and potential DoF's. I think it would be better if this mod was applied for actions that hurt other civ's influence, like coups, rigging, and Great Diplomats.
     
    vyyt, Kim Dong Un and civplayer33 like this.
  4. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    965
    I would also be in favor of adding mechanics that allow the player to pass on CS quests to prevent "inadvertently" completing them, but your suggestion seems good, as well.
     
    vyyt likes this.
  5. Teholb

    Teholb Warlord

    Joined:
    Feb 5, 2012
    Messages:
    199
    Ok. I've now seen the militaristic side of this version. It's brutal. I was backstabbed by Siam at some point immediately after he proposed a research agreement, which I had accepted thinking it would keep him pacified for a while during my war on Darius. France joined in on the global hate fest just a few turns later.

    upload_2019-12-23_16-53-55.png
     
  6. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    Did he declare war on you while you had a DoF? That's a bug, if so.
     
  7. Teholb

    Teholb Warlord

    Joined:
    Feb 5, 2012
    Messages:
    199
    Yes, I think the turn immediately after the DoF, or immediately after the research agreement actually. I was shocked, I'm glad that's a bug. I figured he was trying to bleed me of my reserves before backstabbing me. He did have the "backstabbed Rome" Diplo malus.
     
  8. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    The AI is not programmed to intentionally drain the Gold reserves of their enemies through trade deals.

    If you still have a savegame (or an autosave) one turn prior to the backstabbing occurring, would you mind submitting a bug report on Github? This is the second report of this (and on the most recent version), so clearly something's wrong somewhere.

    https://github.com/LoneGazebo/Community-Patch-DLL/issues
     
  9. TranceBlossom

    TranceBlossom Warlord

    Joined:
    Nov 21, 2018
    Messages:
    135
    Gender:
    Male
    Location:
    Tokyo
    Just to clarify, with the 12-20-3 hotfix we don't need to mess with any other files right? That should have all the intended changes in it?
     
  10. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    Correct. All intended changes are included.
     
  11. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    965
    I'm finding the -20 modifier for "Your friends found reason to denounce you" a bit harsh, t.b.h...personally I'd put it a bit lower since it's a global modifer that doesn't seem to decay, after all (or does it?).

    Also, I'm still getting the "Your military deployment is extremely threatening" with someone I just vassalized, which was supposed to have been fixed IIRC; this is with 12-1-1 still...should I make a bug report?
     
  12. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    965
    Oh and another thing: I find the "double dipping" for opinion modifiers with vassals to be a bit odd...if, for example, I go to war and my vassal is throwing his units into the meat grinder, which will add a penalty for "You failed to protect their lands", this penalty will count separately as a negative opinion modifier but it will also be represented as part of their general "They are X with your treatment of them as their master"; so, e.g., if he gets -5 for me failing to protect their lands, he'll apply that twice (-5 to general opinion as vassal and -5 for that specific item separately). I feel like having that apply once should be enough, personally.

    Also, could we change that whole "failing to protect their lands" thing so it only applies when his lands are actually affected and only for stuff that happens after I've vassalized them? It seems like he's getting the modifier both for City damage already done before I vassalize and then also when his units die in silly offensive operations in later wars that aren't even on his soil.
     
  13. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    It's -20 if their opinion of the friend who denounced you is greater than their opinion of you, -10 otherwise. In the latest version, it does decay (lasts 100 turns on standard speed); only applies if they consider you untrustworthy; and only applies if they haven't been backstabbed by the person who denounced you.

    -20 isn't the end of the world, anyway, and backstabbing via denouncement is rare, especially in the latest version. I think it's fine.

    If it's still present after you hit Next Turn (after vassalizing them), then yes, that's a bug and should be reported. :)

    I don't actually know how the failure to protect modifier works; will investigate, but I'll set it so that it doesn't trigger for units killed outside of the vassal's territory.
     
    Teholb, TranceBlossom and civplayer33 like this.
  14. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    965
    Hmm, it went away but I also managed to get mutual open borders with him...it's probably fine, though, just took a turn to actualize.

    Thanks for looking into the vassal stuff! That's been a nitpick for me for a long time.
     
    Teholb likes this.
  15. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    No problem, and I'll add a check to update the opinion table immediately upon vassalization, just to avoid confusion.
     
    civplayer33 likes this.
  16. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    Bear in mind that a vassalized AI mostly judges their master based on how they're being treated.
     
  17. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    965
    Yeah, if it were to be set to only trigger for stuff happening inside the vassal's territory as well as not count damage already done to his Cities before the vassalization then it's reasonable even if it double dips on that, IMO.
     
  18. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    987
    Gender:
    Male
    For anyone who's interested in understanding the new strategic diplomacy mechanics, here is the updated approach calculation (also posted on the wiki).

    This information is current as of the 12-24 build (combined with the 12-20-3 hotfix); see https://forums.civfanatics.com/thre...cember-20th-12-20.652983/page-4#post-15625839

    The strategic diplomacy edits are mostly found in steps 24-29 of this approach calculation. The changes made here were also applied in similar form for the DoRelationshipPairing calculation (which I'll post later on).

    Code:
    What is the best approach to take towards this player?
    Run through the following steps in order.
    //////////////////////////////////////////////////////
    
    All seven approach scores begin at 0.
    
    
    1. Default Neutral Weight
    
    Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    2. Last Turn Approach Biases
    
    If our approach last turn was WAR and we were preparing a war against this player last turn, add our WAR bias to the WAR approach.
    
    If our approach last turn was HOSTILE and we were preparing to demand from this player last turn, add our HOSTILE bias to the HOSTILE approach.
    
    
    3. Additional War Biases
    
    If our approach last turn was WAR, we're currently at war with them and our war goal towards this player is CONQUEST (meaning we want to destroy them completely), then add our WAR bias to the WAR approach.
    
    Domination Victory bias: If we're not at war with this player, or we are at war and it's a stalemate or better (GetWarState function), and we're going for a Domination Victory, then add our WAR bias to the WAR approach.
    
    
    4. City-State Diplomacy Mod Addition
    
    If at least one City-State has a quest for us to:
    - Declare war on this player, or;
    - Liberate a city this player owns, or;
    - Capture a city this player owns;
    
    Add our WAR bias to the WAR approach.
    
    
    5. Research Agreement
    
    If we currently have a research agreement with this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    
    
    6. Easy Target
    If these conditions are met:
    - We consider this player an easy target;
    - We're at war with them already OR we're not at war with any major civilizations.
    
    Then they're considered an "easy target" for the rest of this approach calculation.
    
    If they're an easy target:
    - Add our WAR bias to the WAR approach.
    
    
    7. Declaration of Friendship
    
    If we currently have a Declaration of Friendship with this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    
    
    8. Coop War History
    
    Check how many times this player refused to go on a coop war with us.
    +1 for each time they refused the request
    +2 for each time they refused the request by warning the target AI
    +2 for each time they broke a promise to start a coop war with us
    -1 for each time they accepted the request and we went to war together
    
    Note #1: The memory value tracking this is set to 0 for both players if one of them capitulates to the other.
    
    Note #2: If one player resurrects the other, then the value is set to 0 for both players *if positive* (bad).
    
    If the total is positive:
    - Add our DECEPTIVE bias plus the total to the DECEPTIVE approach.
    
    If the total is negative:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Subtract the total from the FRIENDLY approach (since it's negative, the sign is flipped).
    
    
    9. Resurrection
    
    If this player resurrected us ("You restored their civilization after they were annihilated!"):
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    - Set our DECEPTIVE approach score to 0.
    
    If we resurrected this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    - Set our DECEPTIVE approach score to 0.
    
    
    10. Denouncements
    
    We've currently denounced this player!
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Set our FRIENDLY approach score to 0.
    
    This player has currently denounced us!
    - Add our GUARDED bias to the GUARDED approach.
    - Set our FRIENDLY approach score to 0.
    
    
    11. Untrustworthy Players (Backstabbers)
    
    If we consider this player untrustworthy:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Set our FRIENDLY approach score to 0.
    
    If this player is untrustworthy *and* personally betrayed us by:
    - Denouncing us while we had a Declaration of Friendship, OR
    - Declaring war on us while we had a Declaration of Friendship, OR
    - Broke a military promise not to declare war on us, OR
    - Broke a promise not to conquer our protected City-State, OR
    - Declared war on us while we were their vassal...
    
    Then, apply extra penalties:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    
    12. Attacks on Protected City-States
    
    If this player killed one of our protected City-States within the past 50 turns:
    - Add our WAR bias plus the number of our protected City-States they've killed to the WAR approach.
    - Add our HOSTILE bias plus the number of our protected City-States they've killed to the HOSTILE approach.
    
    If they haven't killed any recently, but they *have* attacked one of our protected City-States within the past 30 turns:
    - Add our HOSTILE bias plus the number of our protected City-States they've attacked to the HOSTILE approach.
    - Add our GUARDED bias plus the number of our protected City-States they've attacked to the GUARDED approach.
    
    
    13. Stolen Territory
    
    If this player stole territory from us during peacetime using a Great General or America's UA:
    - Add our WAR bias plus the number of times they stole our territory to the WAR approach.
    - Add our HOSTILE bias plus the number of times they stole our territory to the HOSTILE approach.
    
    If they're also an easy target:
    - Add 2x our WAR bias to the WAR approach.
    
    * this penalty is cleared if you go to war, and does not apply while at war.
    
    
    14. Capital/Holy City Ownership
    
    If this player currently owns our original capital, and we aren't their capitulated vassal:
    - Add 2x our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    If this player currently owns our Holy City, and we aren't their capitulated vassal:
    - Add 2x our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    If this player is an easy target, and we aren't their capitulated vassal:
    - And they currently own our original capital, add 1000 to the WAR approach.
    - And they currently own our Holy City, add 5x our WAR bias to the WAR approach.
    
    *NOTE:* Using an Inquisitor on the Holy City to remove its Holy City status will clear the associated penalties.
    
    
    15. Military Threat
    What is this player's military threat level? (GetMilitaryThreat function)
    
    CRITICAL
    - Add our WAR bias to the WAR approach.
    - Add 2x our AFRAID bias to the AFRAID approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    SEVERE
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    MAJOR
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    MINOR
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    16. Warmonger Threat
    What is this player's warmonger threat level? (GetWarmongerThreat function)
    
    CRITICAL
    - Add our WAR bias to the WAR approach.
    - Add 2x our AFRAID bias to the AFRAID approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    SEVERE
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    MAJOR
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    MINOR
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    17. Military Strength Compared To Us
    What is this player's military strength compared to us? (GetPlayerMilitaryStrengthComparedToUs function)
    
    IMMENSE
    - Add 4x our AFRAID bias to the AFRAID approach.
    
    POWERFUL
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add 2x our AFRAID bias to the AFRAID approach.
    
    STRONG
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    AVERAGE
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    POOR
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    WEAK
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    PATHETIC
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    18. Economic Strength Compared To Us
    What is this player's economic strength compared to us? (GetPlayerEconomicStrengthComparedToUs function)
    
    IMMENSE
    - Add 4x our AFRAID bias to the AFRAID approach.
    
    POWERFUL
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add 2x our AFRAID bias to the AFRAID approach.
    
    STRONG
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    AVERAGE
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    POOR
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    WEAK
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    PATHETIC
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    19. Victory Dispute Level
    How competitive are we over the same victory condition? (GetVictoryDisputeLevel function)
    
    (NOTE: This is always NO COMPETITION if victory competition was disabled in DiploAIOptions.sql)
    
    FIERCE COMPETITION
    Opinion Indicator: "They know you are competing with them, and they hate it!"
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our WAR bias to the WAR approach.
    
    STRONG COMPETITION
    Opinion Indicator: "They suspect you are competing with them."
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    WEAK COMPETITION
    Opinion Indicator: "They fear you are competing with them."
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NO COMPETITION
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    20. Victory Block Level
    How much do we want to stop this player from winning? (GetVictoryBlockLevel function; the farther you are in the lead, the more they hate you)
    
    (NOTE: This is always NO DESIRE if victory competition was disabled in DiploAIOptions.sql)
    
    (NOTE 2: The player does not receive an opinion penalty if the AI's opinion of the player is Friend+.)
    
    FIERCE DESIRE
    Opinion Indicator: "Your behavior infuriates them."
    - Add our GUARDED bias to the GUARDED approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG DESIRE
    Opinion Indicator: "Your behavior angers them."
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    WEAK DESIRE
    Opinion Indicator: "Your behavior worries them."
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NO DESIRE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    21. Wonder Dispute Level
    How much are we competing with this player for World Wonders? (GetWonderDisputeLevel function)
    
    Opinion Indicator if WEAK or higher: "You are competing for World Wonders."
    
    FIERCE COMPETITION
    - Add our GUARDED bias to the GUARDED approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG COMPETITION
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    WEAK COMPETITION
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NO COMPETITION
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    22. City-State Dispute Level
    How much are we competing with this player for the favor of the same City-States? (GetMinorCivDisputeLevel function)
    
    NOTE: This check is only calculated if the AI has met at least one City-State who is still alive. If there are no living City-States in the game, or they haven't met any, no bonus or penalty will be added for this.
    
    Opinion Indicator if WEAK or above: "You are competing for the favor of the same City-States!"
    
    FIERCE COMPETITION
    - Add our GUARDED bias to the GUARDED approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG COMPETITION
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    WEAK COMPETITION
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NO COMPETITION
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    23. Land Dispute Level
    How much do we covet their lands? (GetLandDisputeLevel function)
    
    Opinion Indicator if WEAK or above: "Territorial disputes strain your relationship."
    Opinion Indicator if NONE: "You have no contested borders."
    
    FIERCE DISPUTE
    - Add our GUARDED bias to the GUARDED approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG DISPUTE
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    WEAK DISPUTE
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    NO DISPUTE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    24. Strategic Diplomacy Improvements - Ancient/Classical Era
    Skip this step if we're in the Medieval Era or later.
    
    If our land dispute level with this player is FIERCE:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    If our land dispute level with this player is WEAK or STRONG:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If we're FAR from this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If we're DISTANT from this player:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    
    25. Strategic Diplomacy Improvements for Domination Victory
    Skip this step if we're not at least in the Medieval Era (unless we're close to a Domination Victory already).
    
    Skip this step if all of these conditions are false:
    - We're aiming for a Domination Victory.
    - We're close to a Domination Victory.
    - Our leader traits give us bonuses towards war.
    
    25A. Leader Flavors
    Add the average of our Boldness and Meanness flavors to the WAR approach.
    Add the average of our Meanness and Denounce Willingness flavors to the HOSTILE approach.
    
    
    25B. Capitals We Control
    If we control at least one other major civ's original capital AND still control our own original capital.
    - Add our WAR bias plus the number of other major civs' original capitals we control to the WAR approach.
    - Add our HOSTILE bias plus the number of other major civs' original capitals we control to the HOSTILE approach.
    
    
    25C. Capitals They Control
    If they control at least one other major civ's original capital:
    
      If we're close to a Domination Victory:
      - Add 10x our WAR bias multiplied by the number of other major civs' original capitals they control to the WAR approach.
      - Add 10x our HOSTILE bias multiplied by the number of other major civs' original capitals they control to the HOSTILE approach.
    
      If we're not close to a Domination Victory:
      - Add the number of other major civs' original capitals they control to the WAR approach.
      - Add the number of other major civs' original capitals they control to the GUARDED approach.
      - Add our FRIENDLY bias MINUS the number of other major civs' original capitals they control to the FRIENDLY approach.
    
      If they're an easy target:
      - Add 5x our WAR bias to the WAR approach.
    
    
    25D. We're Close To Domination Victory
    If we're close to a Domination Victory and the other player still has their original capital:
    - Add 5x our WAR bias to the WAR approach.
    - Add 5x our HOSTILE bias to the HOSTILE approach.
    
    If they're also an easy target:
    - Add 5x our WAR bias to the WAR approach.
    
    
    25E. Normal Strategic Weight
    If we're not close to a Domination Victory, and we still own our original capital:
    
      If the other player's military strength compared to us is above average:
      - Add our FRIENDLY bias to the FRIENDLY approach.
      - Add our NEUTRAL bias to the NEUTRAL approach.
      - Add our GUARDED bias to the GUARDED approach.
      - Subtract our WAR bias from the WAR approach.
      - Subtract our HOSTILE bias from the HOSTILE approach.
      - Subtract our DECEPTIVE bias from the DECEPTIVE approach.
    
      If the other player's military strength compared to us is average or weaker:
      - Subtract our FRIENDLY bias from the FRIENDLY approach.
      - Subtract our NEUTRAL bias from the NEUTRAL approach.
      - Subtract our GUARDED bias from the GUARDED approach.
      - Add our WAR bias to the WAR approach.
      - Add our HOSTILE bias to the HOSTILE approach.
      - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
      If we have a Defensive Pact with this player, and their DP value (from DoRelationshipPairing) is greater than 0:
      - Add our FRIENDLY bias to the FRIENDLY approach.
      - Add our NEUTRAL bias to the NEUTRAL approach.
      - Subtract our GUARDED bias from the GUARDED approach.
      - Subtract our WAR bias from the WAR approach.
      - Subtract our HOSTILE bias from the HOSTILE approach.
      - Subtract our DECEPTIVE bias from the DECEPTIVE approach.
    
      If the other player's proximity to us is FAR or DISTANT and their economic strength compared to us is above average:
        - Add our NEUTRAL bias to the NEUTRAL approach.
    
        If our opinion of them is NEUTRAL or better:
        - Add our FRIENDLY bias to the FRIENDLY approach.
    
        Otherwise:
        - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
        If we have a Declaration of Friendship with them:
        - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    
    25F. Open Borders
    If we have no territorial disputes with them and they allow us Open Borders:
    If our opinion of them is FAVORABLE or better:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    Otherwise:
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    25G. Vassal
    If they're our vassal:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    25H. Coop Wars
    If the # of times they've denied a coop war (see step 8 for how this is calculated) is above 0 (bad):
    - Subtract 3x the # of denials from the FRIENDLY approach.
    - Add 3x the # of denials to the HOSTILE approach.
    - Add 3x the # of denials to the DECEPTIVE approach.
    
    If the # of times they've denied a coop war is below 0 (good):
    - Add 3x the # of denials to the FRIENDLY approach.
    - Subtract 3x the # of denials from the HOSTILE approach.
    - Subtract 3x the # of denials from the DECEPTIVE approach.
    
    
    25I. Land Dispute Level
    Add extra weight based on land dispute level:
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    WEAK
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    STRONG
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    FIERCE
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    
    
    26. Strategic Diplomacy Improvements for Science Victory
    Skip this step if we're not at least in the Renaissance Era (unless we're close to any victory condition already).
    
    Skip this step if all of these conditions are false:
    - We're aiming for a Science Victory.
    - We're close to a Science Victory.
    - Our leader traits give us bonuses towards scientific pursuits.
    
    26A. Spaceship Competition
    If the other player's team has built at least 1 spaceship part OR they're close to a Science Victory and we aren't:
    
       If victory competion hasn't been disabled in DiploAIOptions.sql:
       - Add 5x our WAR bias to the WAR approach.
       - Add 5x our HOSTILE bias to the HOSTILE approach.
    
    If they're NOT a spaceship competitor and we're close to Science Victory:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Add 2x our NEUTRAL bias to the NEUTRAL approach.
    
    
    26B. Normal Strategic Weight
    Skip this step if any weight was added in step 23A.
    
    They have a tech lead of 4 or more techs:
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
       If they're also an easy target:
       - Add our WAR bias to the WAR approach.
       - Add our HOSTILE bias to the HOSTILE approach.
    
    They have a tech lead of 2 to 3 techs:
    - Add 2x our DECEPTIVE bias to the DECEPTIVE approach.
    - Add 2x our GUARDED bias to the GUARDED approach.
    
       If they're also an easy target:
       - Add our WAR bias to the WAR approach.
       - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    We're equal in tech count, or within 1 tech of each other:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
        If their military strength compared to us is at least AVERAGE:
        - Add our FRIENDLY bias to the FRIENDLY approach.
    
    We have a tech lead of 2 to 3 techs:
    - Subtract our DECEPTIVE bias from the DECEPTIVE approach.
    - Subtract our GUARDED bias from the GUARDED approach.
    
        If their military strength compared to us is at least AVERAGE:
        - Add our FRIENDLY bias to the FRIENDLY approach.
        - Subtract our WAR bias from the WAR approach.
        - Subtract our HOSTILE bias from the HOSTILE approach.
    
    We have a tech lead of 4 or more techs:
    - Subtract 2x our DECEPTIVE bias from the DECEPTIVE approach.
    - Subtract 2x our GUARDED bias from the GUARDED approach.
    
        If their military strength compared to us is at least AVERAGE:
        - Add 2x our FRIENDLY bias to the FRIENDLY approach.
        - Subtract 2x our WAR bias from the WAR approach.
        - Subtract 2x our HOSTILE bias from the HOSTILE approach.
    
    
    26C. Defensive Pact/Research Agreement
    Skip this step if any weight was added in step 23A.
    
    If they don't have a tech lead of 4 or more techs, we have a Defensive Pact, and their DP value is above 0:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    If they don't have a tech lead of 2 or more techs, we have a Research Agreement, and we haven't already researched every tech:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    27. Strategic Diplomacy Improvements for Diplomatic Victory
    Skip this step if we're not at least in the Renaissance Era (unless we're close to any victory condition already).
    
    Skip this step if all of these conditions are false:
    - We're aiming for a Diplomatic Victory.
    - We're close to a Diplomatic Victory.
    - Our leader traits give us bonuses towards diplomacy (generally this means bonuses involving City-States).
    
    27A. Base Friendship Increase
    If the other player is not close to winning the game (or victory competition is disabled):
    - Add our FRIENDLY bias plus the average of our DoF Willingness and Loyalty flavors to the FRIENDLY approach.
    
       If we're also close to a Diplomatic Victory:
       - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    
    27B. Long-Term Alliances
    Get the DoF Type for this player (this also affects the message you get when a DoF is requested by the AI).
    
    DoF Type starts at NEW. It's set to UNTRUSTWORTHY if either player goes to war, denounces each other, or ends a DoF early.
    
    The first time a DoF is made, DoF type is set to FRIENDS. A second consecutive DoF sets it to ALLIES, and a third sets it to BATTLE BROTHERS.
    
    DOF TYPE: UNTRUSTWORTHY
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    DOF TYPE: NEW
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    DOF TYPE: FRIENDS
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Subtract our WAR bias from the WAR approach.
    - Subtract our HOSTILE bias from the HOSTILE approach.
    
    DOF TYPE: ALLIES
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Subtract 2x our WAR bias from the WAR approach.
    - Subtract 2x our HOSTILE bias from the HOSTILE approach.
    - Subtract 2x our DECEPTIVE bias from the DECEPTIVE approach.
    
    DOF TYPE: BATTLE BROTHERS
    - Add 3x our FRIENDLY bias to the FRIENDLY approach.
    - Subtract 3x our WAR bias from the WAR approach.
    - Subtract 3x our HOSTILE bias from the HOSTILE approach.
    - Subtract 3x our DECEPTIVE bias from the DECEPTIVE approach.
    
    
    27C. Global Politics
    If we don't consider them as a backstabber:
    
      If we've made Declarations of Friendship with the same leaders, and they haven't denounced one of our friends:
      - Add our FRIENDLY bias to the FRIENDLY approach.
    
      If we've made Defensive Pacts with the same leaders, and they haven't denounced one of our friends:
      - Add our FRIENDLY bias to the FRIENDLY approach.
    
      If they've denounced one of our enemies:
      - Add our FRIENDLY bias to the FRIENDLY approach.
      - Add our NEUTRAL bias to the NEUTRAL approach.
    
    If they've denounced one of our friends:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If they're friends with one of our enemies:
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    If they have a DP with one of our enemies:
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    If we consider them a backstabber:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    27D. City-State Competition
    NOTE: This check is only calculated if the AI has met at least one City-State who is still alive. If there are no living City-States in the game, or they haven't met any, no bonus or penalty will be added for this.
    
    Add extra weight for City-State Dispute Level.
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    WEAK
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    STRONG
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    FIERCE
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    Add the number of times they lowered our influence directly (spies, Great Diplomats, etc) to the number of times they've performed a coup against us.
    
    (NOTE: Performing a coup also awards a penalty for lowering influence, so coups are counted twice here.)
    
    Multiply the total by 3, and add it to the WAR and GUARDED approaches.
    
    
    27E. Protecting our City-States
    If they haven't lowered our City-State Influence directly and our dispute level over City-States is NONE or WEAK:
    
    For each City-State that we're protecting OR allied to, that they're protecting:
    - Add 2 to the FRIENDLY approach.
    - Add 2 to the NEUTRAL approach.
    - Subtract 2 from the WAR approach.
    - Subtract 2 from the HOSTILE approach.
    - Subtract 2 from the DECEPTIVE approach.
    
    
    27F. World Congress Competition
    Skip this step if the World Congress has not yet been founded.
    Skip this step if Victory Competition was disabled in DiploAIOptions.sql.
    
    If this player has more World Congress votes than any other player not on our team:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
      If they're also an easy target:
      - Add 2x our WAR bias to the WAR approach.
      - Add 2x our HOSTILE bias to the HOSTILE approach.
    
      If we're also close to winning a Diplomatic Victory:
      - Add 5x our WAR bias to the WAR approach.
      - Add 5x our HOSTILE bias to the HOSTILE approach.
    
    
    If this player has more votes than we do:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
       If they're also an easy target:
       - Add our WAR bias to the WAR approach.
       - Add our HOSTILE bias to the HOSTILE approach.
    
       If we're also close to winning a Diplomatic Victory:
       - Add 5x our WAR bias to the WAR approach.
       - Add 5x our HOSTILE bias to the HOSTILE approach.
    
    
    28. Strategic Diplomacy Improvements for Cultural Victory
    Skip this step if we're not at least in the Renaissance Era (unless we're close to any victory condition already).
    
    Skip this step if all of these conditions are false:
    - We're aiming for a Cultural Victory.
    - We're close to a Cultural Victory.
    - Our leader traits give us bonuses towards culture and/or tourism.
    
    28A. Wonder Dispute Level
    Add extra weight for Wonder Dispute Level:
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    WEAK
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    STRONG
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    FIERCE
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    
    28B. They Have Influence Over Us
    If their Influence level over us is at least POPULAR, and one of these two conditions is true:
    - Their Influence over us is at least INFLUENTIAL, OR
    - Their Influence trend is STATIC or RISING;
    
    Then, unless victory competition was disabled in DiploAIOptions.sql:
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    If they're also an easy target:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    
    28C. Tourism Bonuses
    Skip this step if any weight was added in step 26B.
    
    If they allow us Open Borders:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
       If we're also already influential on half of the civs we need in order to win a Cultural Victory:
       - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If they're our vassal:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    28D. They're the civ we have the lowest Influence on
    Skip this if we're already Influential.
    
    If they're an easy target, and victory competition wasn't disabled in DiploAIOptions.sql:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If we're also close to winning a Cultural Victory:
       - Add 5x our WAR bias to the WAR approach.
       - Add 5x our HOSTILE bias to the HOSTILE approach.
    
    If they're not an easy target:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Add 2x our DECEPTIVE bias to the DECEPTIVE approach.
    
        If we're also close to winning a Cultural Victory:
        - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    28E. Influence Level and Trend
    Skip this step if any weight was added in step 26D.
    
    If we're close to winning a Cultural Victory:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    Check our influence level over them:
    
    UNKNOWN
    - Add 2x our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    EXOTIC
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our FRIENDLY bias to the DECEPTIVE approach.
    
    FAMILIAR
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    POPULAR
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    INFLUENTIAL
    If our Influence Trend is NOT Rising:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    If our Influence Trend is Rising and our Opinion of them is FAVORABLE or better:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    If our Influence Trend is Rising and our Opinion of them is COMPETITOR or worse:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
      If they're also an easy target:
      - Add 2x our WAR bias to the WAR approach.
      - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    DOMINANT
    If our Opinion of them is FAVORABLE or better:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If our Opinion of them is COMPETITOR or worse:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
      If they're also an easy target:
      - Add 3x our WAR bias to the WAR approach.
      - Add 3x our HOSTILE bias to the HOSTILE approach.
    
    
    29. They're Close To Victory
    If they're close to Domination Victory:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    - Add 2x our GUARDED bias to the GUARDED approach.
    
    If they have at least one other major civ's original capital:
    - Add our WAR bias plus the number of other major civs' original capitals they control to the WAR approach.
    - Add our GUARDED bias plus the number of other major civs' original capitals they control to the GUARDED approach.
    - Add our HOSTILE bias plus the number of other major civs' original capitals they control to the HOSTILE approach.
    
    If victory competition has not been disabled:
    
       If they're close to winning a Science Victory:
       - Add 2x our WAR bias to the WAR approach.
       - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If they're close to winning a Culture Victory:
       - Add 2x our WAR bias to the WAR approach.
       - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If they're close to winning a Diplomatic Victory:
       - Add 2x our WAR bias to the WAR approach.
       - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If we're BOTH close to any victory condition:
       - Add 2x our WAR bias to the WAR approach.
       - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If we're BOTH close to any victory condition AND they're an easy target:
       - Add 10x our WAR bias to the WAR approach.
    
       If they're close to any victory condition, we're not close to any victory condition, AND they're an easy target:
       - Add 5x our WAR bias to the WAR approach.
    
    
    30. Disabled Victory Conditions
    If Science, Culture and Diplomatic Victories are all disabled:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    31. We're Cramped (Surrounded/Can't Expand)
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    
    32. We're very unhappy AND we have more than 0 war weariness:
    - Add our FRIENDLY bias plus 1/5th of our current war weariness to the FRIENDLY approach.
    - Add our NEUTRAL bias plus 1/5th of our current war weariness to the NEUTRAL approach.
    
    
    33. Nukes
    If the other player is a human (or Mahatma Gandhi), assume their chance of nuking us is 100%.
    
    If the other player is an AI:
    - If nukes have been used already by either of us against the other, assume their chance of nuking us is 100%.
    - Otherwise, get the other leader's Use Nuke flavor, add 1 to it and multiply it by itself. The result is their % chance of nuking us.
    
    We have nukes and they don't
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
       If they're also an easy target:
       - Add 2x our WAR bias to the WAR approach.
       - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    They have nukes and we don't, and their probability of nuking us is greater than 50%
    - Add 3x our AFRAID bias to the AFRAID approach.
    - Add 3x our GUARDED bias to the GUARDED approach.
    
    We both have nukes, and their probability of nuking us is greater than 25%
    - Add 2x our GUARDED bias to the GUARDED approach.
    
    If they've previously nuked us:
    - Add 3x our WAR bias to the WAR approach.
    - Add 3x our HOSTILE bias to the HOSTILE approach.
    - Add 3x our GUARDED bias to the GUARDED approach.
    
    
    34. Current Wars
    For each other player (not this player or any of their teammates) that we're at war with, analyze the war state (GetWarState function):
    
    Our war state with this other player is CALM or a STALEMATE
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    Our war state with this other player is DEFENSIVE or we're NEARLY DEFEATED
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    35. Global Politics
    NOTE! The AI will update its approach for players who have a lower OPINION (ranking, not score) first.
    
    If two players have the same OPINION, then it will do an initial pass of this approach function without checking step 30, and will compare the highest score for *any* approach between both players (higher scores mean stronger feelings). The player with the highest score for *any* approach will be updated first. If there is a tie again, then they will be updated by player order.
    
    
    Run these Step 30 checks for each *OTHER* player in the game, not counting the player the AI is currently selecting an approach for.
    
    35A. Current Wars
    
    If we're at war with this player or we're planning a war with this other player OR are planning to demand from this other player OR our approach towards them is WAR or HOSTILE:
    
    - Add our FRIENDLY bias to the FRIENDLY approach, and also see below;
    
      If the person whose approach we're deciding right now is our neighbor (proximity CLOSE or NEIGHBORS), we want them on our good side (since we're being hostile to the other guy):
      - Add our FRIENDLY bias to the FRIENDLY approach.
    
      Is the other player close or a neighbor? If we're being hostile to a neighbor, we need to be more friendly to others:
      - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    35B. Approaches towards higher priority civs
    Try to limit our strongest feelings for the civs who deserve it the most.
    
    If our approach towards the other player is HOSTILE:
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    If our approach towards the other player is AFRAID:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If our approach towards the other player is DECEPTIVE:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If our approach towards the other player is GUARDED:
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    35C. Defensive Pacts
    Other player has a defensive pact with the player we're looking at
    If the other player's military strength is greater than or equal to ours:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    
    35D. Other Player's War Situation
    If the other player is at war with the player we're looking at:
    
    Is the other player our biggest competitor? Yay! We like this guy.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    Are we also at war with the other player? Yay! (don't count this if we're the capitulated vassal of the player we're looking at, though)
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If we're not at war with the other player, are they our most valuable potential DoF? Then we hate this guy!
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If we're not at war with the other player and they aren't our most valuable potential DoF, are they instead our most valuable potential Defensive Pact? Then we hate this guy!
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    36. Trade Value
    
    - Multiply the total gold we're getting from trade routes with this player by 100.
    - Multiply the total science we're getting from trade routes with this player by 100.
    - Multiply the total culture we're getting from trade routes with this player by 100.
    
    - Multiply the total gold they're getting from trade routes with us by 100.
    - Multiply the total science they're getting from trade routes with us by 100.
    - Multiply the total culture they're getting from trade routes with us by 100.
    
    - Estimate our total GPT by getting the total GPT from our cities (including trade route yields) and multiply by 100.
    - Estimate our total Science per turn by getting the total Science per turn from our cities (including trade route yields) and multiply by 100.
    - Estimate our total Culture per turn by getting the total Culture per turn from our cities (including trade route yields) and multiply by 100.
    - For the Culture estimate, also add 100x the handicap bonus (FreeCulturePerTurn) to this. The AI doesn't normally receive a Culture per turn boost but humans can add one manually via DifficultyMod.xml.
    
    Calculate the "trade deltas" with this player:
    - Gold Delta = (3 * (GPT we get - GPT they get)) / GPT estimate
    - Science Delta = (5 * (SPT we get - SPT they get)) / SPT estimate
    - Culture Delta = (5 * (CPT we get - CPT they get)) / CPT estimate
    
    * The results from all divisions are rounded down to the nearest integer (any remainder is ignored).
    * If any of the estimates are 0 or negative, 1 is used in place of the estimate.
    
    Now add in the value from ongoing trade deals with this player:
    
    [Deal Value Calculation]
    Deal value starts at 0.
    
    For each ongoing deal with them:
    - If we're getting GPT from this deal, multiply the GPT by the amount of turns left in the deal, and add this to the deal value.
    
    - If we're getting resources from this deal, multiply the number of resources in the deal by the amount of turns left in the deal, and add this to the deal value.
    
    - If this deal allows us Open Borders in their lands, add 10 to deal value.
    - If this deal allows them Open Borders in our lands, add 5 to deal value.
    - If this deal has a Defensive Pact in it, add 10 to deal value.
    
    [End Deal Value Calculation]
    
    Now that we have the total deal value:
    - Add our Diplo Balance and Loyalty leader flavors together (average for each is 5); this determines how much we care about trade loyalty.
    - Multiply the total deal value by the sum of the flavors.
    - Divide by 20 and discard any remainder.
    - Divide by 5, discard any remainder; this is the final deal value we will use in the calculation.
    
    Add the Gold Delta, Science Delta, Culture Delta and Trade Deal Value together.
    
    [Special Strategic Diplomacy Check]
    If the total is greater than 0, a few sets of conditions are checked now to see if the total should be doubled.
    
    Condition set 1:
    - We're at least in the Medieval Era
    - We're going for a Domination Victory
    - We're not already close to a Domination Victory
    
    Condition set 2:
    - We're at least in the Renaissance Era
    - We're going for or close to a Diplomatic Victory
    
    If either condition set is met, proceed. Otherwise, skip this special check.
    
    Skip this special check if any of the following are true:
    - The other player is close to a victory condition, and victory competition isn't disabled.
    - Our Victory Dispute Level or Victory Block Level towards them is FIERCE.
    - For condition set 1, our land dispute level is WEAK or stronger.
    - For condition set 2, our City-State dispute level is STRONG or FIERCE.
    - For condition set 2, they've performed a coup against one of our allied City-States recently.
    - For condition set 2, the World Congress is in session and they have more votes than anyone else (not counting me or my team members).
    
    If we've gotten this far, double the total.
    [End Special Check]
    
    If the total is greater than 0:
    - Add the total to the FRIENDLY approach.
    
    
    37. Bankrupt
    If our current Gold is 0 and our current GPT is less than or equal to 0:
    
    If going to war with this player would actually increase our GPT (because we're paying them GPT):
    - Add our WAR bias plus the amount of GPT we would gain to the WAR approach.
    - Add our HOSTILE bias plus the amount of GPT we would gain to the HOSTILE approach.
    
    Otherwise:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Subtract our WAR bias from the WAR approach.
    - Subtract our HOSTILE bias from the HOSTILE approach.
    
    
    38. Bankruptcy Sanity Check
    Calculate the GPT we would lose by declaring war on this player (this calculation factors in the teammates, masters, vassals, Defensive Pacts, and allied City-States we would also go to war with).
    
    (NOTE! The GPT lost can be less than 0 - for instance, if we're giving them 50 more GPT than we're receiving in our trade deals. Also, if already at war, the calculation will always return 0.)
    
    If the GPT we would lose is greater than 0, and one of the following conditions are true:
    - This player is not close to any victory condition;
    - Victory Competition was disabled in CoreChanges.sql;
    
    Then perform the following calculation.
    - Begin by calculating our current GPT income and subtracting the GPT we would lose from declaring war.
    - Calculate the average of our instant Gold yields for this turn and the previous 9 turns, and add this to our GPT income.
    - If the total income is negative, then calculate the amount of turns it would take for us to go bankrupt at this adjusted income rate.
    - If we would go bankrupt in 30 or less turns, then the "sanity mod" is equal to the adjusted income (so if it would be -20, then the "sanity mod" is -20).
    - The sanity mod is reduced by 1% for each turn it would take to go bankrupt after declaring war - if we're already bankrupt, the reduction is 0%; if it would take 30 turns, the reduction is 30%.
    
    After this calculation:
    - Subtract the sanity mod from the WAR approach.
    - Subtract the sanity mod from the HOSTILE approach.
    
    
    39. Vassalage
    If the player we're looking at (or his team) has vassals, what do we think of them?
    For each of their vassals:
    
    If our approach towards them is HOSTILE
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If our approach towards them is WAR (only possible if currently at war with the vassal)
    - Add our WAR bias to the WAR approach.
    
    If our approach towards them is DECEPTIVE
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    If our approach towards them is GUARDED
    - Add our GUARDED bias to the GUARDED approach.
    
    
    If they're our master, then what do we think about how they've treated us?
    Tip: You can view what a vassal thinks of their treatment, and why, in the Vassalage Overview.
    
    If we are a voluntary rather than a capitulated vassal:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    CONTENT
    Add 5x our FRIENDLY bias to the FRIENDLY approach.
    Add 2x our NEUTRAL bias to the NEUTRAL approach.
    Subtract 5x our HOSTILE bias from the HOSTILE approach.
    Subtract 5x our GUARDED bias from the GUARDED approach.
    
    DISAGREE
    Add 2x our FRIENDLY bias to the FRIENDLY approach.
    Add 5x our NEUTRAL bias to the NEUTRAL approach.
    Add 2x our HOSTILE bias to the HOSTILE approach.
    Add 2x our GUARDED bias to the GUARDED approach.
    
    MISTREATED
    Add 2x our NEUTRAL bias to the NEUTRAL approach.
    Add 5x our HOSTILE bias to the HOSTILE approach.
    Add 5x our GUARDED bias to the GUARDED approach.
    
    UNHAPPY
    Subtract 2x our FRIENDLY bias from the FRIENDLY approach.
    Subtract 2x our NEUTRAL bias from the NEUTRAL approach.
    Add 5x our HOSTILE bias to the HOSTILE approach.
    Add 5x our GUARDED bias to the GUARDED approach.
    
    ENSLAVED
    Subtract 5x our FRIENDLY bias from the FRIENDLY approach.
    Subtract 5x our NEUTRAL bias from the NEUTRAL approach.
    Add 10x our HOSTILE bias to the HOSTILE approach.
    Add 10x our GUARDED bias to the GUARDED approach.
    
    
    If they're not our master, then are we both vassals of the same master?
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
    We were their vassal and they refused to give us our independence when we asked:
    - Add 4 to the WAR approach.
    - Subtract 10 from the DECEPTIVE approach.
    - Subtract 10 from the FRIENDLY approach.
    
    We were their vassal and they gave us our independence when we asked:
    - Subtract 4 from the WAR approach.
    - Add 2 to the DECEPTIVE approach.
    - Add 5 to the FRIENDLY approach.
    
    
    40. War Projection
    How well do we a think a war against this player would go? (GetWarProjection function)
    Estimated consequences of the war for us:
    
    VERY GOOD
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    GOOD
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our WAR bias to the WAR approach.
    
    STALEMATE or UNKNOWN
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    DEFEAT
    - Add our AFRAID bias to the AFRAID approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    DESTRUCTION
    - Add 2x our AFRAID bias to the AFRAID approach.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    41. Target Value
    Our assessment of this player's value as a military target (based on overall strength estimate) (GetPlayerTargetValue function)
    
    SOFT
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    - Add 2x our WAR bias to the WAR approach.
    
    FAVORABLE
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our WAR bias to the WAR approach.
    
    AVERAGE
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    BAD
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    IMPOSSIBLE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    42. Military Aggressive Posture
    How much threat is posed by their military deployment near our borders? (GetMilitaryAggressivePosture function)
    
    *Note:* Aggressive posture is NONE if they've given you Open Borders or you have a Declaration of Friendship or Defensive Pact with them.
    
    INCREDIBLE
    Opinion Indicator: "Your military deployment is extremely threatening."
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our WAR bias to the WAR approach.
    
    HIGH
    Opinion Indicator: "Your military deployment is extremely threatening."
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    MEDIUM
    Opinion Indicator: "Your military deployment is threatening."
    - Add our GUARDED bias to the GUARDED approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    LOW
    Opinion Indicator: "Your military deployment is threatening."
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    NONE
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    43. Alliances
    Note: Meeting an "any" condition multiple times (such as by denouncing 2 or more enemies) will not stack. Each "any" condition only applies once.
    
    If we don't view this player as a backstabber:
    
       If this player has denounced any of our enemies:
       - Add our FRIENDLY bias to the FRIENDLY approach.
       - Add 2x our NEUTRAL bias to the NEUTRAL approach.
    
       If this player has a Declaration of Friendship with any player we also have a Declaration of Friendship with:
       - Add 2x our FRIENDLY bias to the FRIENDLY approach.
       - Add our NEUTRAL bias to the NEUTRAL approach.
    
       If this player has a Defensive Pact with any player we also have a Defensive Pact with:
       - Add our FRIENDLY bias to the FRIENDLY approach.
       - Subtract our WAR bias from the WAR approach.
       - Subtract our HOSTILE bias from the HOSTILE approach.
    
    If this player has denounced any of our friends:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Subtract 2x our FRIENDLY bias from the FRIENDLY approach.
    - Subtract our NEUTRAL bias from the NEUTRAL approach.
    
    If this player has made a Declaration of Friendship OR a Defensive Pact with any player we've denounced:
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    - Subtract our FRIENDLY bias from the FRIENDLY approach.
    - Subtract 2x our NEUTRAL bias from the NEUTRAL approach.
    
    
    44. Religion
    If both of us have a majority religion (pantheons do not count):
    
    Get the current game (not player) era's Diplo Emphasis for Religion. This is the "emphasis".
    
    If they have a penalty for converting our cities (unless they made a promise to stop, and kept it):
    - Add our WAR bias plus 2x the emphasis to the WAR approach.
    - Add our HOSTILE bias plus 2x the emphasis to the HOSTILE approach.
    
    If we have the same religion, they have no penalty for converting our cities, and they didn't capture our Holy City:
    - Add our FRIENDLY bias plus the emphasis to the FRIENDLY approach, and also;
    
      If this religion is the World Religion, and either of us is the controller of its Holy City, then:
      - Add our FRIENDLY bias plus the emphasis to the FRIENDLY approach.
    
    If we have different religions:
    - Add our WAR bias plus 2x the emphasis to the WAR approach.
    - Add our DECEPTIVE bias plus 2x the emphasis to the GUARDED approach.
    - Add our GUARDED bias plus 2x the emphasis to the GUARDED approach.
    
      If their religion is the World Religion, and they're the controller of its Holy City, then:
      - Add our WAR bias plus the emphasis to the WAR approach.
      - Add our HOSTILE bias plus the emphasis to the HOSTILE approach.
      - Add our GUARDED bias plus the emphasis to the GUARDED approach.
    
    
    45. Ideology
    Get the current game (not player) era's Diplo Emphasis for Late Policies (Ideologies). This is the "emphasis".
    
    If we have the same ideology:
    - Add our FRIENDLY bias plus 2x the emphasis to the FRIENDLY approach.
    - Subtract our WAR bias plus 2x the emphasis from the WAR approach.
    - Subtract our HOSTILE bias plus 2x the emphasis from the HOSTILE approach.
    - Subtract our GUARDED bias plus 2x the emphasis from the GUARDED approach.
    
    If we both have ideologies, and theirs is different from ours:
    - Subtract our FRIENDLY bias plus 2x the emphasis from the FRIENDLY approach.
    - Add our WAR bias plus 2x the emphasis to the WAR approach.
    - Add our HOSTILE bias plus 2x the emphasis to the HOSTILE approach.
    - Add our GUARDED bias plus 2x the emphasis to the GUARDED approach.
    
    
    46. Reckless Expander
    If this player is a reckless expander:
    Opinion Indicator: "They believe we are expanding our empire too aggressively!"
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    47. Dogpiling
    If this player is already at war with other major civilizations, we might want to gang up on the guy we're looking at (our potential victim).
    
    For each other player that they're at war with, if it's a player that we've met:
    
    If one of the following is true:
    - The potential victim is a major competitor of ours;
    - The other warring player's war projection of the ongoing war against our potential victim is GOOD or better.
    
    And the following is NOT true:
    - Our war projection of ANY player at war with them is STALEMATE or worse.
    i.e. if we can't take someone at war with them, we don't want them to sweep over us after finishing with this guy
    
    Then add a dogpiling bonus:
    - Add weight for Victory Dispute: 0 if NONE, 1 if WEAK, 2 if STRONG, 3 if FIERCE
    - Add weight for Victory Block: 0 if NONE, 1 if WEAK, 2 if STRONG, 3 if FIERCE
    - Add weight for our war projection against the potential victim: 0 if DESTRUCTION, 1 if DEFEAT, 2 if STALEMATE, 3 if UNKNOWN, 4 if GOOD, 5 if VERY GOOD
    - Add weight for the other warring player's war projection against the potential victim: 0 if DESTRUCTION, 1 if DEFEAT, 2 if STALEMATE, 3 if UNKNOWN, 4 if GOOD, 5 if VERY GOOD
    
    If the total dogpiling bonus for all players at war with them is greater than 0:
    - Add 1/2 the dogpiling bonus (rounded down) to the WAR approach.
    - Add 1/2 the dogpiling bonus (rounded down) to the HOSTILE approach.
    
    
    48. Their Approach Towards Us
    If this player is not a human, what do we think their approach towards us is?
    
    WAR or HOSTILE
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our AFRAID bias to the AFRAID approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    GUARDED
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    AFRAID
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    NEUTRAL
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    FRIENDLY
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    49. Duel
    If there's only two major civilizations alive:
    
    Victory competition has not been disabled in DiploAIOptions.sql:
    - Add our WAR bias to the WAR approach.
    
    We're going for a Domination Victory:
    - Add 10x our WAR bias to the WAR approach.
    
    
    50. Defensive Pact
    If we currently have a Defensive Pact with this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    51. Coop Wars
    We're currently locked into a coop war against this player (third-party war bribery counts) and are unable to make peace:
    - Add our WAR bias to the WAR approach.
    
    For each other player in the game:
    
    If we have an agreement with this player to go to war with this other player "soon" (10 turns or less)
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    52. Unique Units
    If our civilization has at least one Unique Unit (UU):
    
    If we've unlocked a UU technology and have at least one UU currently active:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
      If we're also going for (or close to) a Domination Victory:
      - Add our WAR bias to the WAR approach.
      - Add our HOSTILE bias to the HOSTILE approach.
    
      If they're also an easy target:
      - Add our WAR bias to the WAR approach.
    
    If we've unlocked a UU technology but we don't have at least one UU currently active:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our WAR bias to the WAR approach.
    
    If we don't have a UU technology, but will have one soon:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    
    53. Key Players
    If they're our biggest competitor:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    If they're also an easy target:
    - Add 5x our WAR bias to the WAR approach.
    
    If they're not our biggest competitor:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    If they're a major competitor of ours:
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    If they're also an easy target:
    - Add 2x our WAR bias to the WAR approach.
    
    
    If they're our most valuable potential friend:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If they're our most valuable potential DP:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    54. War & Difficulty Bonuses
    (This entire section is ignored for vassal players.)
    
    War bonus starts at 0.
    Difficulty bonus starts at 0.
    Era is 0 if our civilization is in the Ancient Era, 1 in the Classical Era, and so on.
    
    If our leader traits give us bonuses towards war:
    - Add 3 to the war bonus, and also see below:
    
      If they're an easy target:
      - Add our WAR bias to the WAR approach.
    
      If our civilization has at least one Unique Unit (UU), we have the technology for a UU unlocked, AND at least one active:
      - Add our WAR bias to the WAR approach.
      - Add our HOSTILE bias to the HOSTILE approach.
    
      If we have a UU, a UU tech, at least one UU active, and we're going for (or are close to) a Domination Victory:
      - Add our WAR bias to the WAR approach.
      - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    If we unlocked Authority:
    - Add 1 to the war bonus.
    
    If we completed Authority:
    - Add 1 to the war bonus.
    
    If we unlocked Imperialism:
    - Add 1 to the war bonus.
    
    If we completed Imperialism:
    - Add 2 to the war bonus.
    
    If our Ideology is Autocracy:
    - Add 3 to the war bonus.
    
    If we have a temporary attack bonus (e.g. from Global Wargames)
    - Add 2 to the war bonus.
    
    
    If the war bonus is greater than 0:
    - Add the war bonus plus our current era to the WAR approach.
    - Add the war bonus plus our current era to the HOSTILE approach.
    
    
    If our Opinion of this player is COMPETITOR or worse, a bonus is also added for difficulty:
    
    - Add AIDifficultyBonusBase (see AI and Difficulty) to the difficulty bonus. This ranges from 0 (Settler) to 9 (Deity).
    - If less than 0, difficulty bonus is set to 0; if greater than 10, difficulty bonus is set to 10.
    - Subtract 4 if this is a COMPETITOR, 2 if this is an ENEMY, and 0 if they're UNFORGIVABLE.
    
    If the difficulty bonus is greater than 0:
    - Add the difficulty bonus plus our current era to the WAR approach.
    - Add the difficulty bonus plus our current era to the HOSTILE approach.
    - Add the difficulty bonus plus our current era to the DECEPTIVE approach.
    
    
    If the war OR the difficulty bonus is greater than 0:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
      If they're also an easy target:
      - Add our WAR bias to the WAR approach.
    
    
    55. Leader Personality
    (currently only Ashurbanipal, Montezuma and Gandhi have extra weight added)
    NOTE: The check evaluates whether the AI has the relevant traits, not the leader name.
    
    If we are Assyria, and we haven't researched every tech already:
       If they have more techs than we do:
       - Add our WAR bias plus their tech lead to the WAR approach.
    
       If we have more techs than they do:
       - Add our FRIENDLY bias plus our teach lead to the FRIENDLY approach.
    
       If we have the same number of techs:
       - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    If we are Montezuma:
    - Add 2x our WAR bias to the WAR approach.
    - Add 2x our HOSTILE bias to the HOSTILE approach.
    
    
    If we are Gandhi:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    
       If we currently have at least one nuke, and Nuclear Gandhi is enabled (DiploAIOptions.sql, active by default), then:
       - Add 100 to the WAR approach.
       - Add 100 to the HOSTILE approach.
       - Set our FRIENDLY approach score to -1000.
       - Set our NEUTRAL approach score to -1000.
       - Set our AFRAID approach score to -1000.
       - Set our DECEPTIVE approach score to -1000.
    
    
    56. World Congress Resolutions
    (This entire section is ignored for vassal players, or if the World Congress is disabled/hasn't been founded yet.)
    
    If the United Nations has been constructed, and we're going for (or close to) a Diplomatic Victory:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Subtract our WAR bias from the WAR approach.
    - Subtract our HOSTILE bias from the HOSTILE approach.
    
    If one of us is sanctioned by the World Congress:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If the Casus Belli resolution is active:
    - Subtract our FRIENDLY bias from the FRIENDLY approach.
    - Subtract our NEUTRAL bias from the NEUTRAL approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If the Global Peace Accords resolution is active:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    - Subtract our WAR bias from the WAR approach.
    - Subtract our HOSTILE bias from the HOSTILE approach.
    
    If the Cold War resolution is active, and we can't make trade routes to at least one major civilization that we've met:
    
    If we can't make trade routes to this player (not same ideology):
    - Subtract our FRIENDLY bias plus the ideology emphasis (see step 43) from the FRIENDLY approach.
    - Subtract our NEUTRAL bias plus the ideology emphasis from the NEUTRAL approach.
    - Add our WAR bias plus the ideology emphasis to the WAR approach.
    - Add our HOSTILE bias plus the ideology emphasis to the HOSTILE approach.
    - Add our GUARDED bias plus the ideology emphasis to the GUARDED approach.
    
    If we can make trade routes to this player (same ideology):
    - Add our FRIENDLY bias plus the ideology emphasis to the FRIENDLY approach.
    - Add our NEUTRAL bias plus the ideology emphasis to the NEUTRAL approach.
    - Subtract our WAR bias plus the ideology emphasis from the WAR approach.
    - Subtract our HOSTILE bias plus the ideology emphasis from the HOSTILE approach.
    - Subtract our GUARDED bias plus the ideology emphasis from the GUARDED approach.
    
    
    57. Other Player Vassalage Penalty
    If this player is not our master, and they have vassals:
    
    - Increase the WAR approach score by 10% for each vassal they have.
    - Increase the GUARDED approach score by 10% for each vassal they have.
    
    
    58. Distance
    The farther away a player is the less likely we are to want to attack them!
    
    If we don't have a valid attack target for this player (we're not able to reach them):
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    
    Otherwise, check the proximity between us (GetProximityToPlayer function):
    
    NEIGHBORS
    - Multiply our WAR approach score by 2.
    - Multiply our HOSTILE approach score by 2.
    
    CLOSE
    - Increase our WAR approach score by 50%.
    - Increase our HOSTILE approach score by 50%.
    
    FAR
    We're going for a Domination Victory:
    - Multiply our WAR approach score by 2.
    - Multiply our HOSTILE approach score by 2.
    
    DISTANT
    We're going for a Domination Victory:
    - Increase our WAR approach score by 50%.
    - Increase our HOSTILE approach score by 50%.
    
    We're not going for a Domination Victory:
    - Decrease our WAR approach score by 50%.
    - Decrease our HOSTILE approach score by 50%.
    
    
    59. Easy Target Multiplier
    If this player is an easy target, war is good; demands and sulking are less good.
    
    (Don't do this if we have a Declaration of Friendship with the player, or if we're a vassal of someone)
    - Increase our WAR approach score by 25%.
    - Decrease our HOSTILE approach score by 25%.
    
    
    60. Opinion
    Opinion is applied as a +/- % modifier to Approach scores after all other modifiers have been considered.
    
    However, each leader also has several personality values which affect how much a positive or negative opinion will change their approach. These personality values are once again based on AI flavors, which are randomized slightly from game to game to be less predictable.
    
    The higher a modifier for an approach is, the more having a positive opinion (above Favorable) or negative opinion (below Competitor) will affect that approach.
    
    This applies both ways (a leader with a high War modifier will add more weight to the War approach if their opinion is negative, but will also remove more weight from the War approach if their opinion is positive). In contrast, a leader with a low War modifier will add or remove less weight based on opinion.
    
    The modifiers are as follows:
    WarMod = WAR bias * Boldness
    HostileMod = HOSTILE bias * Denounce Willingness
    DeceptiveMod = DECEPTIVE bias * Meanness
    GuardedMod = GUARDED bias * (10 - Forgiveness)
    AfraidMod = AFRAID bias * (10 - Boldness)
    FriendlyMod = FRIENDLY bias * Loyalty
    NeutralMod = NEUTRAL bias * Diplo Balance * 2
    
    Note that in the code, good modifiers subtract opinion (negative is good) and bad modifiers add opinion (positive is bad).
    
    IF OPINION IS GREATER THAN 20 (Competitor)
    
    Increase hostility and fear:
    
    - Multiply WAR approach score by (100 + WarMod + Opinion).
    - Divide WAR approach score by 100.
    
    - Multiply HOSTILE approach score by (100 + HostileMod + Opinion).
    - Divide HOSTILE approach score by 100.
    
    - Multiply DECEPTIVE approach score by (100 + DeceptiveMod + Opinion).
    - Divide DECEPTIVE approach score by 100.
    
    - Multiply GUARDED approach score by (100 + GuardedMod + Opinion).
    - Divide GUARDED approach score by 100.
    
    - Multiply AFRAID approach score by (100 + AfraidMod + Opinion).
    - Divide AFRAID approach score by 100.
    
    Decrease friendliness and neutrality:
    
    - Multiply FRIENDLY approach score by 100.
    - Divide FRIENDLY approach score by (100 + FriendlyMod + Opinion).
    
    - Multiply NEUTRAL approach score by 100.
    - Divide NEUTRAL approach score by (100 + NeutralMod + Opinion).
    
    
    IF OPINION IS LOWER THAN -20 (Favorable)
    
    - Multiply Opinion by -1.
    
    Increase friendliness:
    
    - Multiply FRIENDLY approach score by (100 + FriendlyMod + Opinion).
    - Divide FRIENDLY approach score bv 100.
    
    Decrease hostility, fear and neutrality:
    
    - Multiply WAR approach score by 100.
    - Divide WAR approach score by (100 + WarMod + Opinion).
    
    - Multiply HOSTILE approach score by 100.
    - Divide HOSTILE approach score by (100 + HostileMod + Opinion).
    
    - Multiply DECEPTIVE approach score by 100.
    - Divide DECEPTIVE approach score by (100 + DeceptiveMod + Opinion).
    
    - Multiply GUARDED approach score by 100.
    - Divide GUARDED approach score by (100 + GuardedMod + Opinion).
    
    - Multiply AFRAID approach score by 100.
    - Divide AFRAID approach score by (100 + AfraidMod + Opinion).
    
    - Multiply NEUTRAL approach score by 100.
    - Divide NEUTRAL approach score by (100 + NeutralMod + Opinion).
    
    
    IF OPINION IS IN THE -19 TO 19 RANGE (Neutral)
    
    Increase neutrality:
    - Multiply NEUTRAL approach score by (100 + NeutralMod).
    - Divide NEUTRAL approach score by 100.
    
    
    61. Domination Victory Disabled
    If Domination Victory is disabled as a victory type:
    - Divide our WAR approach score by 2, rounded down.
    - Divide our HOSTILE approach score by 2, rounded down.
    
    
    62. Modder Bonus/Penalty
    If base approach weight (flat or percentage) was added or subtracted in DiploApproachWeights.sql, add or subtract it now.
    
    Flat weight is factored in before percentage weight.
    
    
    63. Negative Approach Weights
    At this point in the function, if any approach weight is negative, set it to 0 instead.
    
    
    64. Recent Peace Treaty
    If we signed a Peace Treaty recently, war and hostility weight is removed for a time.
    
    On Settler difficulty, WAR and HOSTILE weights are set to 0 for 20 turns after a peace treaty is signed.
    
    On difficulties above Settler, the AIDifficultyBonusBase (see AI and Difficulty) is subtracted from 20 to determine how many turns the AI has no WAR/HOSTILE weight for. The minimum is 11 turns.
    
    
    65. Other Player is someone else's Vassal
    If they're a vassal of someone else, set our WAR approach score to 0 (unless we're at war with them).
    
    
    66. Other Player is our Vassal
    If they're our vassal:
    
    If they're a major competitor of ours (this bar is set very high for vassals) or they control other major civs' original capitals, skip this next step.
    
    If we're going for or close to a Domination Victory and they still have their original capital, skip this next step.
    
    Otherwise:
    - Set our WAR approach score to 0.
    - Set our HOSTILE approach score to 0.
    
    
    67. We're a Vassal
    If we're a vassal and this other player isn't our master:
    
    If we don't view them as a backstabber:
    - Set our HOSTILE approach score to 0.
    
    
    68. Capital-Free Fearlessness
    If we don't have a capital city (only possible at the start of the game or with the Complete Kills setting):
    - Set our AFRAID approach score to 0.
    
    
    69. Backstabbing Deterrent
    If going to war with this player would do any of these:
    - Backstab a friend;
    - Backstab a player we have a Defensive Pact with;
    - Backstab a player we have an Opinion of ALLY towards;
    - Break a military promise (not to declare war).
    
    Then set our WAR approach score to 0.
    
    
    70. War Disallowed
    If war against this player has been disabled in CoreChanges.sql:
    - Set our WAR approach score to 0.
    
    
    71. Always War
    If the "Always War" or "No Changing War Or Peace" game options are enabled and we're at war with them:
    - Set our WAR approach score to 100 and all others to 0.
    
    
    72. Can't Declare War
    If we can't declare war on this player (and we aren't already at war):
    - Set our WAR approach score to 0.
    
    
    73. Teammates
    If we're on the same team:
    - Set our FRIENDLY approach score to 100 and all others to 0.
    
    
    74. Make Approach Change Gradually
    Approach scores change gradually from turn to turn to avoid rapid jumping between values, which would be erratic and exploitable.
    
    For each of the approaches:
    
    A. Retrieve the approach weight we had for this approach last turn.
    
    B. Check if we should override last turn's value due to special circumstances:
    - If war/hostile weight is zeroed out due to a recent peace treaty, set last turn value for WAR to 0.
    - If they're a vassal of someone else and we're not at war with them, set last turn value for WAR to 0.
    - If they're a vassal of someone else and we just started a war with them, set last turn value for WAR to this turn's value.
    - If war/hostile weight is zeroed out because they're our vassal, set last turn value for WAR and HOSTILE to 0.
    - If hostile weight is zeroed out because we're someone's vassal, set last turn value for HOSTILE to 0.
    - If war weight is zeroed out because going to war would backstab a friend, set last turn value for WAR to 0.
    - If war against this player has been disabled in DiploAIOptions.sql, set last turn value for WAR to 0.
    
    C. Calculate the "average" value of this turn's score and the last turn's score using this formula: (0.5 + (Approach Score * 0.10) + (Approach Score Last Turn * (1 - 0.10)))
    
    D. Round down to remove any remainder.
    
    E. If the average is the same as the value last turn, but the value this turn increased/decreased, then add/subtract 1 from the average so it changes by at least 1.
    
    F. Set the approach value for this approach to the average value.
    
    
    75. War Face
    If the highest approach score after all these calculations is WAR (therefore the AI is planning a war), the AI will pick a "War Face", which determines how it will act towards you until WAR isn't the highest approach anymore. Note that being at war overrides the War Face.
    
    If the AI's highest approach is NOT the WAR approach, then it resets the War Face type (so that a new one can be decided on next time).
    
    If the AI had a War Face last turn, it will use that one. Otherwise, it will figure out the next-highest APPROACH score (after WAR), and based on the result, pick a war face.
    
    If the next-highest approach score is:
    
    HOSTILE
    - AI will act HOSTILE to you until it's ready for war.
    
    GUARDED
    - AI will act GUARDED to you until it's ready for war.
    
    DECEPTIVE
    - AI will act NEUTRAL to you until it's ready for war.
    
    AFRAID
    - AI will act HOSTILE to you until it's ready for war.
    
    FRIENDLY
    - AI will act FRIENDLY to you until it's ready for war.
    
    OTHERWISE
    - AI will act NEUTRAL to you until it's ready for war.
    
    
    76. Friendliness Override
    If we have denounced this player, or they have denounced us, or we consider them an "untrustworthy friend" (backstabber), then:
    
    If the highest approach score towards them is FRIENDLY or DECEPTIVE
    - If our opinion of them is Enemy or Unforgivable, then change our approach for step #76 to GUARDED.
    - Otherwise, change our approach for step #76 to NEUTRAL.
    
    If the highest approach score towards them is WAR and our War Face is FRIENDLY
    - If our opinion of them is Enemy or Unforgivable, then change our War Face to GUARDED.
    - Otherwise, change our War Face to NEUTRAL.
    
    
    77. Log Approach Change
    If logging is enabled, approach values and changes will be logged at this time.
    
    
    78. Decide what Approach to show to the player
    The AI picks its highest approach and uses that towards you (unless changed in step #76). If all approach scores are 0, it will use the NEUTRAL approach.
    
    If the AI is planning war with you, they will use their War Face (see steps #75 and #76).
    
    If the AI's approach towards you is DECEPTIVE, it will show up as FRIENDLY.
    
    If the AI is currently at war with you, the message WAR! is shown in place of their usual approach.
    
    If the AI has just denounced you, the message DENOUNCING! is shown in place of their usual approach.
    
    If the AI has just been resurrected, the message RECALLED TO LIFE is shown in place of their usual approach.
    
    Otherwise, the approach shown to you is the AI's approach towards you.
    
     
    Last edited: Dec 24, 2019
  19. TranceBlossom

    TranceBlossom Warlord

    Joined:
    Nov 21, 2018
    Messages:
    135
    Gender:
    Male
    Location:
    Tokyo
    Just as an update, I updated to the -3 hotfix (without the dll files you posted a few hours ago) and continued playing. I'm not sure if it's because of the diplo changes in the hotfix or my getting a stronger military & some CS alliances, but things calmed down significantly compared to the constant war of the early eras. After a bit I got declared on by Monty while he was already at war with the Netherlands, which was a very dumb move because we ganged up and took most of his cities until he capitulated to me. Austria and the Netherlands got defensive pacts with me, and I haven't been declared on since even while continuing to wonderspam and snowballing into a science victory soon. Once this game ends I might do another tradition wonderspam game and see if the AI still hates me as much as it initially did this game.
     
    HeathcliffWarriors likes this.
  20. Teholb

    Teholb Warlord

    Joined:
    Feb 5, 2012
    Messages:
    199
    I didn't keep that save, @HeathcliffWarriors
    I'll be more careful with keeping saves when I suspect something is a bug. Normally I don't make much comment about the versions, but I feel like I've gotten decent enough to the point that I can offer feedback. God help me for my first submission, I've never done it before. I'll upload a 12-24 MP tomorrow morning.

    Merry Christmas, everyone!
     
    HeathcliffWarriors likes this.

Share This Page