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:
    970
    Gender:
    Male
    Location:
    Canada
    Thank you for your detailed feedback! It sounds like bloc formation has improved and the AI can actually pose a challenge with their aggression now.

    There's a lot of factors in the approach calculation, and Unique Units are intended to make the AI more aggressive, particularly for warmongers. I'll be posting it today.

    Vanilla design choice. My assumption is that it's to make the AI more likely to stay consistent in its behavior once it denounces you, and to form blocs better.

    It was a bug but in a different way; coups allowed you to dodge penalties for stealing, for some unfathomable reason, and there was another bug where AI players benefitted from being caught plotting against the target AI. I fixed the syntax to work correctly, but I wasn't the one to add the penalty; will change for next release so it doesn't affect elections.

    Voting behavior is not controlled by the diplomacy AI, it's controlled by the "league AI" in CvVotingClasses, which is entirely unfamiliar to me at the moment. :)

    Suggestions relating to improving voting AI should go on Github.
     
    Coffee Monopoly likes this.
  2. 4CV

    4CV Warlord

    Joined:
    Jan 9, 2017
    Messages:
    129
    Gender:
    Male
    Well, then of course I'm happy with it... :twitch:
     
  3. Blue Ghost

    Blue Ghost King

    Joined:
    Sep 5, 2016
    Messages:
    687
    Makes perfect sense to me. If I publicly announce to the entire world that you’re a bad guy and my enemy, that surely creates a strong incentive for me to continue acting in a manner consistent with that. Same as how a public declaration of friendship incentivizes behaving in a manner befitting an alliance.
     
  4. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    You asked why. :)

    To say it's a vanilla design choice is not to say it makes sense - but in this case, I think the incentive makes sense.
     
    TranceBlossom and 4CV like this.
  5. Ziad

    Ziad Emperor

    Joined:
    Nov 11, 2013
    Messages:
    1,794
    Location:
    Lebanon
    I tend to play Huge Marathon games and I've noticed that it's almost far too easy to piss off the entire world even after just taking a few cities. I take out one aggressive neighbor in early eras and suddenly I'm Attila with -300 relations with everyone.

    Considering larger maps tend to have more cities and slower games have a slower decay level relative to war tempo, is it possible to make some diplo penalties associated with war inversely scale with map size, namely city conquest? War declarations possibly scale with speed or distance?

    I know it already does to some extent but I feel it could be tuned more.
     
    Last edited: Nov 28, 2019
    Kim Dong Un, mikes61293 and vyyt like this.
  6. Rafs

    Rafs Warlord

    Joined:
    Mar 12, 2016
    Messages:
    129
    I play similar settings (highlands maps, pretty big maps), most of the hate you get from wars will be from close neighbors and people who don't like war, targets that are farther away care less about wars you are involved in, at least this has been my experience. Also, the less cities your target has, the more hate you'll get per city, so early era wars can get you in a lot of trouble (during an era or two) compared to late game wars (where the alliance blocs are more or less defined), so you gota see if it's worth taking those cities compared to completely pillaging them and leaving them in shambles.
    Imho, the "warmonger hate" is tunned more or less fine, you'll get a bit to a lot of hate (so far I believe this is normal, you'd also be worried if an AI starting take over another one), the problem is this will put you on a negative loop with AIs, making it less likely to get DOFs and joint wars, which are the way you can keep a good standing with them despite warring. If you want to go to war I'd recommend trying to stick with 2-4 AIs (try to gift them some luxes) and coax them into warring with you.
    Only part I wish was a bit more "real" is when you are taking down somebody someone hates, but he hasn't declared, you get big penalties anyway. I know I'd be pleased if someone I saw as a threat was getting taking down a peg or two, even if I haven't declared on them myself.
    On a final note, you'll have to remember most AIs hate when you are succesful and/or warring, so the path to the warrior's victory is almost always a lonely one (except for your vassals :king:)
     
  7. ASCII Guy

    ASCII Guy Chieftain

    Joined:
    Oct 30, 2019
    Messages:
    74
    Gender:
    Male
    I'm not a warmongerer! I only took Ethiopia's capital in the first 50 turns, removing them from the game. ...and made Siam and India my vassals, therby ruling the entire continent.

    The French UA is too appealing to just sit on a few cities and leave it at that. But unfortunately I went for science instead of culture because I had no power in World Congress.
     
  8. 4CV

    4CV Warlord

    Joined:
    Jan 9, 2017
    Messages:
    129
    Gender:
    Male
    Oh no, of course not! Just make one neighbour vanish and enslave two more, that's nothing. If I lived next to you, I'd sleep very well...
    Spoiler :
    ... and very soon forever, I suppose :eek2: R.I.P.
     
  9. Ziad

    Ziad Emperor

    Joined:
    Nov 11, 2013
    Messages:
    1,794
    Location:
    Lebanon
    I mean I get it but in this game I conquer 5 cities from two different civs over 100 turns and I'm gettjng screeched at by someone in the opposite side of the world.

    This is almost too much. Is war supposed to just be one civ and one city at a time? Even on Huge?

    All I'm saying is that these penalties seem more appropriate for standard games but I can understand if balancing this might be too much.
     
    Last edited: Nov 28, 2019
  10. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    UPDATE!
    The approach calculation has been added to the diplomacy guide. Now you can see exactly how the AI calculates its approaches and decides to go to war with you.

    https://civ-5-cbp.fandom.com/wiki/Detailed_Guide_to_Diplomacy#Approach_Calculation

    The calculation is enormous, please excuse the delay in getting it all typed up. :)

    If you'd rather read it here, here's the current code (as of the 11-25-2 hotfix; I will not be updating this post, but I will update the wiki):
    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 Additions
    
    For each City-State:
    - If the City-State has a quest for us to declare war on this player, add our WAR bias to the WAR approach.
    - If the City-State has a quest for us to liberate a city this player owns, add our WAR bias to the WAR approach.
    - If the City-State has a quest for us to 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. 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.
    
    
    7. 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).
    
    
    8. 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.
    
    
    7. 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.
    
    
    8. Untrustworthy Friends (Backstabbers)
    
    A player is considered a backstabber ("untrustworthy friend") if one of these conditions are true:
    - The player currently owns our original capital and/or Holy City, and we aren't their vassal.
    - The player denounced us or declared war on us while we had a Declaration of Friendship with them.
    - The player broke a promise not to declare war on us (military promise).
    - The player broke a promise not to conquer our protected City-State (City-State conquest promise).
    - The player has Declared War on any players they made a Declaration of Friendship with.
    - The player has Denounced at least two players they made a Declaration of Friendship with.
    - The player ended our Declaration of Friendship early through the Discuss menu (or through declaring war/denouncing us), and since then, our Opinion of them has not improved to -70 or below (Friend), which would have cleared this penalty.
    
    And this condition is not true:
    - The player is currently a vassal of someone.
    
    If this player is an untrustworthy friend:
    - 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 an untrustworthy friend *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...
    
    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.
    
    
    9. 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, and they previously broke or ignored a promise to stop attacking a City-State under our protection:
    - 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.
    
    
    10. 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.
    
    * this penalty is cleared if you go to war, and does not apply while at war.
    
    
    11. 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.
    
    
    12. Military Threat
    What is this player's military threat level? (GetMilitaryThreat function)
    
    CRITICAL
    - Add our WAR bias to the WAR approach.
    - Add 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.
    
    
    13. Warmonger Threat
    What is this player's warmonger threat level? (GetWarmongerThreat function)
    
    CRITICAL
    - Add our WAR bias to the WAR approach.
    - Add 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.
    
    
    14. Military Strength Compared To Us
    What is this player's military strength compared to us? (GetPlayerMilitaryStrengthComparedToUs function)
    
    IMMENSE
    - Add 2x 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 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.
    
    
    15. Economic Strength Compared To Us
    What is this player's economic strength compared to us? (GetPlayerEconomicStrengthComparedToUs function)
    
    IMMENSE
    - Add 2x 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 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.
    
    
    16. 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 CoreChanges.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.
    
    
    17. 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 CoreChanges.sql)
    
    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.
    
    
    18. 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.
    
    
    19. 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 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.
    
    
    20. 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.
    
    
    21. Earlygame Border Dispute Increase
    If we're currently in the Ancient or Classical Era and our land dispute level with them is STRONG or FIERCE, then:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    22. We're Close to Victory
    If we're close to winning a Domination Victory:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If we own at least one other major civ's original capital, and we haven't lost our own original capital:
    - Add our WAR bias plus the number of major civ original capitals we control to the WAR approach.
    - Add our HOSTILE bias plus the number of major civ original capitals we control to the HOSTILE approach.
    
    If we're close to winning a Science Victory:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If we're close to winning a Diplomatic Victory:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    If we're close to winning a Culture Victory:
    
    If this is the player we have the lowest Influence on, and their military strength compared to us is below average:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    Otherwise:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    23. They're Close To Victory
    
    If they're close to a Domination Victory:
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    (Note: These next steps are skipped if victory competition is disabled in CoreChanges.sql)
    
    If they're close to a Science Victory:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If they're close to a Diplomatic Victory:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    If they're close to a Culture Victory:
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    
    24. Extra Victory Weight
    (Note: This step is skipped if victory competition is disabled in CoreChanges.sql)
    
    If we're close to ANY victory condition and they're also 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 close to ANY victory condition, they're not close to ANY victory condition, and we're not close to a Domination Victory, then a second check is done for victory dispute and block levels, with different weights added.
    
    [Victory Dispute Level]
    
    FIERCE COMPETITION
    Opinion Indicator: "They know you are competing with them, and they hate it!"
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG COMPETITION
    Opinion Indicator: "They suspect you are competing with them."
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    WEAK COMPETITION
    Opinion Indicator: "They fear you are competing with them."
    - Add our FRIENDLY bias to the FRIENDLY 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.
    
    [Victory Block Level]
    
    FIERCE DESIRE
    Opinion Indicator: "Your behavior infuriates them."
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    STRONG COMPETITION
    Opinion Indicator: "Your behavior angers them."
    - Add our WAR bias to the WAR approach.
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    
    WEAK COMPETITION
    Opinion Indicator: "Your behavior worries them."
    - Add our FRIENDLY bias to the FRIENDLY 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.
    
    
    25. 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.
    
    
    26. We're Cramped (Surrounded/Can't Expand)
    - Add our WAR bias to the WAR approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    
    27. 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.
    
    
    28. 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.
    
    They have nukes and we don't, and their probability of nuking us is greater than 50%
    - Add 2x our AFRAID bias to the AFRAID approach.
    - Add 2x our GUARDED bias to the GUARDED approach.
    
    We both have nukes, and their probability of nuking us is greater than 25%
    - Add 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.
    
    
    29. 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.
    
    
    30. 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.
    
    30A. 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.
    
    
    30B. 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.
    
    
    30C. 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.
    
    
    30D. 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.
    
    
    31. 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.
    If the total is greater than 0:
    - Add the total to the FRIENDLY approach.
    
    
    32. Bankrupt
    If our current Gold is 0 and our current GPT is less than or equal to 0:
    - 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.
    
    
    33. 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.
    
    
    34. 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:
    - 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.
    
    
    35. 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 our AFRAID bias to the AFRAID approach.
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    36. 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.
    
    
    37. 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.
    
    
    38. 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 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.
    
    
    39. Religion
    If we have a majority religion (pantheons do not count):
    
    If they have a penalty for converting our cities (unless they made a promise to stop, and kept it):
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias 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 to the FRIENDLY approach, and also;
    
      If this religion is the World Religion, and we're the controller of its Holy City, then:
      - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    40. Ideology
    If we have the same ideology:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Subtract our WAR bias from the WAR approach.
    - Subtract our HOSTILE bias from the HOSTILE approach.
    - Subtract our GUARDED bias from the GUARDED approach.
    
    If we both have ideologies, and theirs is different from ours:
    - Subtract our FRIENDLY bias from the FRIENDLY approach.
    - Add our WAR bias to the WAR approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    
    41. 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.
    
    
    42. 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.
    
    
    43. Their Approach Towards Us
    What is our guess as to this player's approach towards us? (GetTrueApproachTowardsUsGuess function)
    
    NOTE: For humans, this is based entirely on the player's actions. For AI players, it's based on a combination of their actions and that AI player's visible approach.
    
    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.
    
    DECEPTIVE
    - Add our DECEPTIVE bias to the DECEPTIVE approach.
    - Add our GUARDED bias to the GUARDED approach.
    
    AFRAID (only for AI, since we have no way of guessing if humans are AFRAID)
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our HOSTILE bias to the HOSTILE approach.
    
    NEUTRAL (only for AI, since we have no way of guessing if humans are NEUTRAL)
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    FRIENDLY
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    NO GUESS (we just met them)
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    44. Duel
    If there's only two major civilizations alive:
    
    Victory competition has not been disabled in CoreChanges.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.
    
    
    45. Defensive Pact
    If we currently have a Defensive Pact with this player:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    
    
    46. Can we declare war?
    If we can:
    - Add our WAR bias to the WAR approach.
    
    
    47. 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.
    
    
    48. 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.
    
    If they're an easy target *and* we currently have a Declaration of Friendship with them:
    - Add our FRIENDLY bias to the FRIENDLY approach.
    - Add our NEUTRAL bias to the NEUTRAL approach.
    
    
    49. 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'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.
    
    If we have a UU active and are 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 we have a UU active and they're an easy target:
    - Add our WAR bias to the WAR approach.
    
    
    50. 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 not a major competitor of ours:
    - Add 2x our FRIENDLY bias to the FRIENDLY approach.
    - Add 2x our NEUTRAL bias to the NEUTRAL 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.
    
    
    51. 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) and we have 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, 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.
    
    
    52. 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 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.
    - Add our GUARDED bias to the GUARDED approach.
    
    If we can make trade routes to this player (same ideology):
    - 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.
    - Subtract our GUARDED bias from the GUARDED approach.
    
    
    53. 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.
    
    
    54. 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%.
    
    
    55. 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)
    - Increase our WAR approach score by 25%.
    - Decrease our HOSTILE approach score by 25%.
    
    
    56. Negative Approach Weights
    At this point in the function, if any approach weight is negative, set it to 0 instead.
    
    
    57. 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.
    
    
    58. 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.
    
    
    59. 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.
    
    
    60. 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).
    
    
    61. 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.
    
    
    62. We're a Vassal
    If we're a vassal and this other player isn't our master:
    
    If they're not a backstabber ("untrustworthy friend") and they haven't nuked us:
    - Set our HOSTILE approach score to 0.
    
    
    63. 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.
    
    
    64. War Disallowed
    If war against this player has been disabled in CoreChanges.sql:
    - Set our WAR approach score to 0.
    
    
    65. 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.
    
    
    66. 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.
    
    
    67. Teammates
    If we're on the same team:
    - Set our FRIENDLY approach score to 100 and all others to 0.
    
    
    68. 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 CoreChanges.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.
    
    
    69. 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.
    
    
    70. 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 #72 to GUARDED.
    - Otherwise, change our approach for step #72 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.
    
    
    71. Log Approach Change
    If logging is enabled, approach values and changes will be logged at this time.
    
    
    72. Decide what Approach to show to the player
    The AI picks its highest approach and uses that towards you (unless changed in step #70). 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 #69 and #70).
    
    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.
    
    Note that while typing this up I noticed a few (mostly minor) bugs and improvements within the function that could be made, so I've added those to my pull request for the next version.
     
    Last edited: Nov 28, 2019
    Yaviel, Omen of Peace, cerk and 5 others like this.
  11. danymatrix

    danymatrix Chieftain

    Joined:
    Jun 30, 2012
    Messages:
    47
    [QUOTE = "HeathcliffWarriors, publicación: 15607479, miembro: 307324"] Se redujo el spam paracaidista en esta versión beta.

    Próximos cambios de diplomacia para la próxima versión:
    [CÓDIGO]
    - Se corrigieron algunos errores, se simplificó el código
    [/CÓDIGO]


    Puede discutir la diplomacia en el hilo dedicado: https://forums.civfanatics.com/threads/vox-populi-diplomacy-feedback.652134/ [/ QUOTE]

    great. When will the version come out with these improvements? thanks
     
  12. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    You'd have to ask the Lord of the Community Patch, Gazebo. :)

    Edit: Make that...right now! https://forums.civfanatics.com/threads/new-beta-version-december-1st-12-1.652322/
     
  13. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    6,071
    So in a 11/25 game. The Ethiopia AI had my vassal Siam dead to rights. My military is spent, he literally is walking ramshot over me. And yet he sues for peace....I was stunned....he was literally one turn from finishing Siam....and his forces were much stronger than mine (at least double the units you see here, surrounding Siam.

    upload_2019-12-2_13-11-42.png
     
  14. Coffee Monopoly

    Coffee Monopoly Warlord

    Joined:
    Nov 10, 2019
    Messages:
    101
    Gender:
    Male
    I've also noticed that the AI often offers peace in situations where they're just about to win big time.
     
  15. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    It's been a problem with the civ AI since the early games. :)

    I'll look at the logic and see if some improvements can be made.

    Edit: Changed the logic for peace willingness; AI should be less willing to make peace when they're winning and have a large advantage and/or are going for Domination Victory (unless they're losing other wars or very unhappy).
     
    Last edited: Dec 3, 2019
  16. azum4roll

    azum4roll Prince

    Joined:
    Jul 17, 2018
    Messages:
    542
    Gender:
    Male
    Instead of "Impossible" maybe they should offer a peace deal at a higher price instead? Of course, if the losing civ can't afford it the winning side shouldn't offer it.
     
  17. usadefcon1

    usadefcon1 Warlord

    Joined:
    Sep 24, 2016
    Messages:
    104
    I understand that bribing the AI to goto war could be exploitable, but it seems like it's always Impossible, no matter how much it makes sense for them.
     
  18. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    Currently, they only accept bribes against their major competitors.
     
  19. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    970
    Gender:
    Male
    Location:
    Canada
    There's currently no logic for "if the peace deal we want isn't affordable, don't offer peace" - this is because peace treaty value is based on a percentage function, ie they will want x% of your Gold and/or Cities.
     
  20. Zuizgond

    Zuizgond Prince

    Joined:
    Oct 24, 2016
    Messages:
    464
    "Plundering a trade route when not at war counts as stealing twice from the owner, and stealing once from the destination civilization."

    How does it work? In my game I was at war with A but not B. A had a trade route with B. I plundered that trade route and B was angry about it (-20 relation penalty). So in order to have no relation penalty from plundering trade routes, you need to be at war with both civilizations?

    And sometimes your units auto-plunder trade route when they are on the same tile as an enemy caravan. So if you don't want the relation penalty with the civilization you are not at war with, is there a way to remove auto-plundering?


    Besides that, love the new diplomacy so far :)
     

Share This Page