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. Rekk

    Rekk King

    Joined:
    Dec 9, 2017
    Messages:
    999
    The destination civ reducing relations by -20 is incredibly harsh, especially if it doesn't immediately start going back to neutral. If it has to exist at all, I'd rather it be something like -10, +1 after every turn.

    Trade route destruction is a very temporary effect, and one of the only ways a defensive civ can get a commanding war score in order to end a war without changing the geopolitical landscape long term.

    I'm bothered a little if a trade route to me gets plundered. It's definitely not something that hurts relations with whoever did it. Morocco plundering my trade routes outside of wartime is the only plunder act that truly hurts diplomatic relationships with the AI.
     
  2. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    Are you playing with the 12-1 version? It's -10 for the destination civ in 12-1, not -20, and every 25 turns (standard speed) one plundering is forgotten, which is twice as fast as for several other penalties. I still need to update the wiki with the latest information. :)

    You receive a penalty with the destination civilization if all of these conditions are met:
    - The trade route is external;
    - The destination is not a City-State or Barbarian city;
    - You're not at war with the destination civilization;
    - The destination civilization is not at war with the trade route owner;
    - You're not Morocco, or you are Morocco and the destination civilization has visibility of the plot where the trade route was plundered.

    Opinion is only one modifier in calculating Approach.

    Hmm, there isn't a way to remove auto-plundering as far as I'm aware. I can reduce the penalty further to -5, maybe?
     
    Last edited: Dec 4, 2019
    Zuizgond likes this.
  3. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    5,612
    12/1 - Mongolia has gotten addicted to my open borders. I have been refusing every other turn or so for like the last 20 turns. No means no! :)
     
  4. ASCII Guy

    ASCII Guy Chieftain

    Joined:
    Oct 30, 2019
    Messages:
    60
    Gender:
    Male
    I had the same issue with Brazil trying to get a world congress vote from me. What was funny is he was asking for stuff from ME for a vote that benefits HIM.
     
  5. Zuizgond

    Zuizgond Prince

    Joined:
    Oct 24, 2016
    Messages:
    436
    OK I was playing with the 11-25 version. Glad to hear that it has been toned down to -10 and is not permanent.
    Thanks :)
     
    HeathcliffWarriors likes this.
  6. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    Sounds like anti-spam cooldowns aren't working - will investigate. :)

    It wasn't permanent in 11-25, either, but it took twice as long to be removed, which wasn't proportional to the offense.
     
  7. lunker

    lunker Warlord

    Joined:
    Oct 6, 2016
    Messages:
    262
    I know there's potential for exploitation, but I wish that the player could more actively sign Defensive Pacts. Usually you have to wait for an AI player to suggest one when a DP is valuable to them, but it would be nice if there was a state where the AI would accept DP's if they are compensated.
     
    Kim Dong Un likes this.
  8. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    What is your suggestion? The AI can already sign Defensive Pacts for a price if it's acceptable to them.
     
  9. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    5,612
    Ok, so on 12-1 I have noticed more tech trading options. Its quite expensive, but doable if I'm good friends with the AI. I can work with that!
     
  10. lunker

    lunker Warlord

    Joined:
    Oct 6, 2016
    Messages:
    262
    I usually find that DP's have a deal value of "Impossible" or something like -100 to 300~ when the AI is actually okay with it. I'd like to see more situations where the DP has a value of like, -1500 or rather than just a straight no all the time.
     
    Kim Dong Un and usadefcon1 like this.
  11. usadefcon1

    usadefcon1 Warlord

    Joined:
    Sep 24, 2016
    Messages:
    100
    This sounds good if nobody is at war with the target, it prevents abuse. But if the asking Civ is already at war with the target I think the AI should be willing be bribed into war with Civs they really don't like. Especially if the asking Civ is a friend.
     
    Kim Dong Un likes this.
  12. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    I'll post the logic for Defensive Pacts and third party war here so anyone who wants to can make more informed suggestions. :)

    Edit: The code for DP valuation is extensive, currently parsing through it.
     
    Last edited: Dec 4, 2019
    civplayer33 likes this.
  13. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    Okay, so I found two potential issues affecting Defensive Pacts:
    - The AI's check for warmonger threat is adding DP weight for warmongers, and removing DP weight (by as much as 10) for non-warmongers. Warmongers are much more likely to get DoW'ed on so it should be the inverse. This is probably a typo.
    - The AI has an odd way of checking whether it wants DPs, where it seems to loop through players by player order rather than by most to least valuable Defensive Pacts.

    Will tinker with this for the next version, but I'll post the current code here when I'm done understanding it.
     
    civplayer33 likes this.
  14. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    Code for Defensive Pact valuation:
    Code:
    If we're an AI teammate of a human, return IMPOSSIBLE.
    
    If our army is in place to attack the other player, return IMPOSSIBLE.
    
    If the other player is an AI and IsWantsDefensivePactWithPlayer returns false, return IMPOSSIBLE.
    
    If the other player is a human and IsGoodChoiceForDefensivePact returns false, return IMPOSSIBLE.
    
    To calculate how much a DP with the other player is worth to us, divide 17500 by the DP Value for the other player or 1, whichever is greater.
    
    To calculate how much we value giving a DP to the other player:
    - If Opinion is FAVORABLE+, set the value to 100.
    - Otherwise, multiply 500 by the DP value for the other player and divide by 40.
    
    To calculate the deal value, AI subtracts how much it values giving away a DP to the other player (second calculation) from the worth of the DP to the AI (first calculation).
    
    Code:
    IsWantsDefensivePactWithPlayer:
    - Each turn, AI loops through all players that they've met (by player order) and updates their willingness to make DPs with them.
    - It checks if IsGoodChoiceForDefensivePact is true.
    - If yes, set IsWantsDefensivePactWithPlayer to true.
    - If no, set IsWantsDefensivePactWithPlayer to false.
    - For humans, the AI simply applies the IsGoodChoiceForDefensivePact check directly rather than going through this.
    
    Code:
    If we already have a Defensive Pact with them, return false.
    
    If we're not allowed to make a Defensive Pact with them (don't have the tech/etc) return false.
    
    If there's only two major civilizations alive, return false.
    
    If our approach towards the player is HOSTILE or WAR, return false.
    
    If we consider the player a backstabber, return false.
    
    If we estimate the other player's approach towards us is HOSTILE or WAR, return false.
    
    If we've gone this far, perform the following check:
    
    STEP 1
    - Count the number of major civilizations in the game that we've met. Don't count ourselves or dead players.
    - Get our Loyalty flavor (5 on average).
    - Multiply these two values together and divide by 40.
    - If the result of this calculation is 0 or less, treat it as 1.
    
    STEP 2
    - If we have the Ideology NW that grants World Congress votes based on DPs, multiply again by the number of other civilizations.
    
    STEP 3
    - Add the amount of DPs we already have to the # of DPs we already want to have (based on the IsWantsDefensivePactWithPlayer loop).
    - If the value from steps 1-2 is less than this total, return false.
    
    STEP 4
    - Get the DP value.
    - If this player has the highest DP value of all players (also requires minimum weight of 18), counting our current DPs, add 10 to the value.
    - If this player is the best potential DP, not counting our current DPs, add 3 to the value.
    - If the DP value plus the bonus is greater than or equal to 25, return true.
    - Otherwise, return false.
    
    And finally the DP value calculation:
    Code:
    DP Value Calculation - This is done in DoRelationshipPairing every turn.
    
    For each player, the starting value is equal to the leader's Diplo Balance flavor (average is 5).
    
    Factor in our approach towards the player:
    WAR (-10 value)
    HOSTILE (-7 value)
    GUARDED (-5 value)
    DECEPTIVE (+3 value)
    NEUTRAL (+1 value)
    AFRAID (+5 value)
    FRIENDLY (+5 value)
    
    Factor in our opinion towards the player:
    UNFORGIVABLE (-10 value)
    ENEMY (-5 value)
    COMPETITOR (-3 value)
    NEUTRAL (+1 value)
    FAVORABLE (+3 value)
    FRIEND (+5 value)
    ALLY (+10 value)
    
    Factor in our guess as to the other player's true approach towards us:
    WAR or HOSTILE (-15 value)
    DECEPTIVE (-5 value)
    GUARDED (-1 value)
    AFRAID (-10 value)
    FRIENDLY (+2 value)
    NEUTRAL (+1 value)
    
    Player's military strength compared to us:
    PATHETIC (-5 value)
    WEAK (-3 value)
    POOR (-1 value)
    AVERAGE (+3 value)
    STRONG (+5 value)
    POWERFUL (+7 value)
    IMMENSE (+10 value)
    
    Player's economic strength compared to us:
    PATHETIC (-5 value)
    WEAK (-3 value)
    POOR (-1 value)
    AVERAGE (+3 value)
    STRONG (+5 value)
    POWERFUL (+7 value)
    IMMENSE (+10 value)
    
    Player's proximity to us:
    NEIGHBORS (+5 value)
    CLOSE (+2 value)
    FAR (-1 value)
    DISTANT (-5 value)
    
    We have capital cities on different continents (current, not original): -10 value.
    
    Denouncement in either direction: -10 value.
    
    We consider them a backstabber: -50 value.
    
    We consider them an easy target (note: AIs that want to conquer you will be more likely to see you as an easy target if they aren't at war with anyone else): -10 value.
    
    Military threat we feel from them:
    CRITICAL (+15 value)
    SEVERE (+10 value)
    MAJOR (+5 value)
    MINOR (-5 value)
    NONE (-10 value)
    
    Their warmonger threat level (? - shouldn't this be inverted):
    CRITICAL (+15 value)
    SEVERE (+10 value)
    MAJOR (+5 value)
    MINOR (-5 value)
    NONE (-10 value)
    
    Victory dispute level:
    NONE (+1 value)
    WEAK (-5 value)
    STRONG (-10 value)
    FIERCE (-15 value)
    
    Victory block level:
    NONE (+1 value)
    WEAK (-5 value)
    STRONG (-10 value)
    FIERCE (-15 value)
    
    Land dispute level:
    NONE (+1 value)
    WEAK (-3 value)
    STRONG (-5 value)
    FIERCE (-10 value)
    
    If this is the Ancient or Classical Era and we have a STRONG or FIERCE land dispute level: -5 value.
    
    If we're in the Medieval Era or later and Victory Competition has not been disabled, factor in the victory we're going for.
    
    Domination Victory, check land dispute level again:
    NONE (+3 value)
    WEAK (-5 value)
    STRONG (-10 value)
    FIERCE (-15 value)
    
    Science Victory, check what their current era is compared to us:
    - They're more advanced: -5 value.
    - We're in the same era, and their military strength compared to us is AVERAGE or greater: +5 value.
    - We're more advanced, and their military strength compared to us is AVERAGE or greater: +10 value.
    
    Culture Victory, check Wonder Dispute Level:
    NONE (+3 value)
    WEAK (-3 value)
    STRONG (-5 value)
    FIERCE (-10 value)
    
    Diplomatic Victory, check Minor Civ Dispute Level:
    NONE (+5 value)
    WEAK (-1 value)
    STRONG (-5 value)
    FIERCE (-10 value)
    
    We already have a DP with them: +10 value.
    
    They're close to winning the game, and Victory Competition hasn't been disabled:
    - Enemy Mod = AIDeclareWarProb (based on difficulty level) multiplied by 15 and then divided by 100, rounded down.
    
    - For each victory condition they're close to (Domination/Science/Diplo/Culture):
    If they're a human, subtract Enemy Mod from DP value.
    If they're an AI, subtract 10 from DP value.
    
    Subtract 15 value for each DP we already have.
    
    If the other player is an AI and that AI's biggest competitor is the same as our biggest competitor, +5 value.
    
    If the other player's influence level over us is POPULAR and RISING, subtract 5 value.
    
    Loop through all other (known & alive) players, not counting us:
    
    We have a DoF or DP with the loop player:
    - The player we're looking at is at war with them: -5 value
    - The player we're looking at denounced them: -5 value
    - The player they're looking at was denounced by them: -5 value
    
    The player we're looking at is an AI, and both of us have at least 32 competitor weight towards the loop player: +5 value.
    
    Both of us have a DoF with the loop player: +5 value.
    
    Both of us have a DP with the loop player: +5 value.
    
    If this player and the loop player are at war:
    - If we're also at war with the loop player: +5 value.
    - If we're close to the loop player: +5 value. (think this should be -5)
    - If the loop player is a warmonger: +5 value.
    
    Other player is a vassal of someone: set DP value to 0.
    
     
    Last edited: Dec 5, 2019
    civplayer33 and TranceBlossom like this.
  15. usadefcon1

    usadefcon1 Warlord

    Joined:
    Sep 24, 2016
    Messages:
    100
    Wow, this is a lot to digest.... I'll take a closer look while I'm at work tomorrow :mischief:
     
  16. TranceBlossom

    TranceBlossom Warlord

    Joined:
    Nov 21, 2018
    Messages:
    128
    Gender:
    Male
    Location:
    Tokyo
    You can trade with Barbarian cities?

    I haven't looked at the code itself but I really don't understand what functional difference this has from just returning IsGoodChoiceForDefensivePact directly
     
  17. azum4roll

    azum4roll Prince

    Joined:
    Jul 17, 2018
    Messages:
    422
    Gender:
    Male
    So it's not possible to form a 3-civ defensive pact now?
     
  18. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    17,569
    Gender:
    Male
    Location:
    Little Rock
    Because AI to AI only ask if the bool is set - otherwise you have a ton of code in deal classes that runs for no reason.

    G
     
  19. HeathcliffWarriors

    HeathcliffWarriors King

    Joined:
    Dec 19, 2017
    Messages:
    721
    Gender:
    Male
    Location:
    Canada
    No, this is just in case Barbarians take over a city while a trade route is directed to it. :)

    It returns false if there's 2 major civs left, not 3.
     
  20. azum4roll

    azum4roll Prince

    Joined:
    Jul 17, 2018
    Messages:
    422
    Gender:
    Male
    I mean this part:
    Code:
    If we already have a Defensive Pact, return false.
    This means the AI would refuse any additional DPs right?
     

Share This Page