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

Diplomacy AI Development

Discussion in 'Community Patch Project' started by Recursive, Feb 14, 2020.

  1. Recursive

    Recursive Emperor

    Joined:
    Dec 19, 2017
    Messages:
    1,572
    Gender:
    Male
    Probably isn't intended; I'll check.
     
    Carloshooter likes this.
  2. Omen of Peace

    Omen of Peace Prince

    Joined:
    Mar 22, 2018
    Messages:
    375
    Gender:
    Male
    He's telling you you should trade only with him. That's his thing!!
     
  3. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,188
    Gender:
    Male
    Location:
    Australia
    I like Morocco but I'm not a huge fan of this part of the UA to be honest. It seems like the kit favours a peaceful/trade-focused playstyle but pillaging trade routes because someone won't trade with you is a really passive-agressive thing to do. I do like getting lots of trade routes, and I can see the ability being useful if you want to wage economic warfare on someone (or goad them into attacking you). So it's not all bad. It's just seems odd for a leader like Ahmad al-Manur who seems generally pretty diplomatic and fair to have this petty sort of 'trade with me or trade with nobody' thing in his back pocket.
     
    Carloshooter and Arthur Jama like this.
  4. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,031
    Location:
    Malaga (Spain)
    Hehe, you really don't stand these passive-aggressive types.
    Honestly, I don't like this ability either for playing it myself, but it's quite realistic to find a civ that is playing the jerk if you don't do things the way he likes them. It's interesting to play against. Would you concur and trade just with Morocco for his benefit and your peace of mind, or would you seek confrontation and fight for your freedom of choice against someone who can defend pretty well?
     
    JamesNinelives likes this.
  5. Recursive

    Recursive Emperor

    Joined:
    Dec 19, 2017
    Messages:
    1,572
    Gender:
    Male
    There's definitely code to avoid pillaging certain trade routes based on Approach; if they have a DoF, I think they shouldn't.
     
  6. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,188
    Gender:
    Male
    Location:
    Australia
    This is totally the kind of thing I would declare war over XD. I'm normally a very peaceful player but I dislike being attacked in a way I can't easily defend myself against. It hasn't actually happened to me very often though. Maybe just once or twice and I had other civs I could trade with without going through Morocco's territory so it was only a minor annoyance really.

    I do wonder though when I'm playing Morocco how much of everyone trading with me is getting better yields or trusting me/being friends and how much of it is them knowing I can prevent them from trading with others. That might be irrational though as I've totally seen people send TRs through my territory as Mrco.

    Sometimes I feel bad when I've getting so many TRs compared to when I play other civs. Like, Arabia wishes he had this many trade partners lol. I guess other civs have their own UAs though. Looking back the Shoshone's territory grab on settle seems incredibly powerful. I'm playing Byzantium at the moment and they are fun but don't seem OP in any particular way.
     
    Last edited: Mar 11, 2020
  7. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,031
    Location:
    Malaga (Spain)
    Byzantium? The ultimate religious combo civ? It might not look like it, but take some time trying to figure how to combine founders, enhancers, pantheon and follower beliefs, and add a couple of whatever you want from this list. These beliefs are there always for you, so no chance of ruining your strategy. Add that you receive tons of faith for your extra purchases that in turn produce a respectable religious pressure. Ever wanted to play religious tall and still spread your religion?

    Do you remember that reformation belief that gives tourism to every faith purchased building? How many faith purchased buildings can you have as Byzantium? Five!
    Do you want just extra great people? Fine, save your faith and go to the glory of God, and the several beliefs related to great people are there for you. Do you want to abuse missionaries? Sure thing.
    Surely you will find more strategies, you can test a few and see how strong the synergy can become.
     
    JamesNinelives likes this.
  8. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,188
    Gender:
    Male
    Location:
    Australia
    Hmm. Maybe I just haven't played them enough yet. I guess what I'm missing from other civs I like is the early boost. In the game I played recently I started next to the Maya who founded much earlier and spent a lot of my faith just converting my cities back to my own religion at first (they kept spamming me with missiories). I guess the current bug with inquisitors probably didn't work in my favour. I do enjoy Byzantium though! Being able to choose whatever I want is very nice. The other thing I kind of missed was that I didn't get to use my UU all that much because I wasn't in a very strong position at that point in the game so my resources were mostly devoted to other areas.
     
  9. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,031
    Location:
    Malaga (Spain)
    Yes, it takes a while. Byzantium is a medieval civ after all. Until then you must just survive.
    CrazyG always recommend that you try to found a religion even if you have a guaranteed one. That's one less religion to care about, and the sooner you get to your strengths the better.
     
    JamesNinelives likes this.
  10. CrazyG

    CrazyG Deity

    Joined:
    Oct 14, 2016
    Messages:
    5,098
    Location:
    Beijing
    Something to try, don't take a second follower belief as the bonus. Try taking a second founder or an enhancer instead.
     
    JamesNinelives likes this.
  11. Kim Dong Un

    Kim Dong Un The One & Unly Supporter

    Joined:
    Dec 17, 2017
    Messages:
    668
    Gender:
    Male
    Location:
    Pyongyang
    I'll confirm the reports of AI not being opportunistic enough on the war-front during the first 100+ turns. Here's a situation where Rome (he even befriended me and went authority, though I did basically give him a free lux) and Carthage (I even denounced her after she refused to not settle) could both do some damage, but they left me be - I even purposefully left cities with no garrison and walls for a while to entice them.
    Spoiler :
    Screenshot (197).png Screenshot (196).png

    War picked up mid-game though, in another session; Rome, Dido, and Babylon all went at it, while the former took Maya right out of the game.
    Spoiler :
    Screenshot (154).png
     
    Recursive likes this.
  12. LifeOfBrian

    LifeOfBrian Warlord

    Joined:
    Aug 21, 2019
    Messages:
    207
    In my current Byzantium game, the first DoW happened on turn 58 or 59 by Sweden against Egypt. So still fairly early.
     
    Recursive and JamesNinelives like this.
  13. LifeOfBrian

    LifeOfBrian Warlord

    Joined:
    Aug 21, 2019
    Messages:
    207
    An interesting situation in my current game. Around turn 200, a few turns before a WC session, I tried to sell my votes to Siam. The resolutions proposed were Sanction Siam, ban a luxury (not Siam's) and open doors on a CS. I didn't propose any of these. What's interesting is that when I offered to vote "no" on Sanction Siam, the trade value was "Impossible" (understandably, it was the same with to vote "yes" on that). Also interesting is that when I checked what I'd get for the luxury ban vote, Siam wanted to pay me either way (trade value around 375 to vote yes, trade value around 250 to vote no).

    I don't quite understand why (unless in the rarest of circumstances, mostly late in the game) buying "no" votes on proposed sanctions against itself isn't top priority for the AI. I'm also not sure I understand why the AI would pay for both yes and no votes on the same resolution.

    So that's perhaps something that could be looked at when improving the AI.
     
  14. Recursive

    Recursive Emperor

    Joined:
    Dec 19, 2017
    Messages:
    1,572
    Gender:
    Male
    AI Morocco should no longer plunder TRs of players they're AFRAID of or have a friendly relationship with. They will still plunder all other TRs not connected to their cities.

    Hmm, let me know how it is next version, I've made AI adjustments.

    A very good point. Deal AI logic is something I'll be looking at throughout this year.
     
  15. Carloshooter

    Carloshooter Chieftain

    Joined:
    Apr 5, 2015
    Messages:
    29
    Location:
    Portugal
    Sorry to bother you again but what do you mean by friendly behaviour? ahah
    When a Civ is Friendly towards you? Does "fake Friendly" Marrocco plunders?
     
    JamesNinelives and vyyt like this.
  16. Recursive

    Recursive Emperor

    Joined:
    Dec 19, 2017
    Messages:
    1,572
    Gender:
    Male
    You aren't bothering me, feel free to ask away. :)

    Ignore = Do not plunder the trade route
    Our = AI Morocco
    Them = Other player

    1 - If we have a DoF with them, ignore
    2 - If our approach towards them is AFRAID, ignore
    3 - If our approach towards them is FRIENDLY (real or fake), ignore - otherwise you could tell when they're faking it
    4 - If our visible approach towards them is not HOSTILE or GUARDED and our Opinion of them is at least Favorable, then ignore
    5 - If they're our master and we're Content with their treatment of us, ignore

    Otherwise, don't ignore.
     
    Carloshooter, vyyt and JamesNinelives like this.
  17. Omen of Peace

    Omen of Peace Prince

    Joined:
    Mar 22, 2018
    Messages:
    375
    Gender:
    Male
    I like the idea, but it runs into balance concerns: won't that lead them to under-use their ability?
    I'm questioning 4 in particular, but perhaps even 3. Ideally there would be a cost/benefit analysis before plundering, but I realize this straddles other AI.

    Separately, I want to say thank you for the amazing job you've done! The last beta is the best ever in terms of diplomacy.
     
  18. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,188
    Gender:
    Male
    Location:
    Australia
    Seems reasonable to me. If I understand correctly, it means they will pillage trade routes belonging to people they are HOSTILE or GUARDED towards and people they are NEUTRAL towards if their opinion is less than Favourable (I'm guessing there's an opinion like 'Neutral'?).
    But not trade routes belonging to people they are FRIENDLY or AFRAID towards, people they are NEUTRAL towards and have a Favourable opinion of or better, or people they have a DoF with.

    I agree on that count, diplo has been great recently :).
     
    Last edited: Mar 14, 2020
    Recursive likes this.
  19. CrazyG

    CrazyG Deity

    Joined:
    Oct 14, 2016
    Messages:
    5,098
    Location:
    Beijing
    So in my most recent 10 or so games, the only way I've ever upset an AI significantly before the Renaissance is by planting too many cities.

    Denouncing, competing for wonders, religious differences, territorial disputes, buying land near him, settling cities near him, and ignoring all requests to stop, taken together, are not enough. I tried just going through the diplomatic screen and offending Rome in every way possible, he just takes it. Then he taunts me, and I insult him, he backs down (I have less than half his military score). This happens multiple times.

    For comparison, if you build 5 settlers before turn 65, there's a pretty good chance that multiple civs will declare war instantly. The AI are willing to break friendship, getting the backstabber penalty to do so.
     
    Recursive likes this.
  20. Recursive

    Recursive Emperor

    Joined:
    Dec 19, 2017
    Messages:
    1,572
    Gender:
    Male
    Minus the new exceptions for DoF and content vassals, this actually causes them to use their ability more often than they did previously. The old check was "if visible approach is AFRAID or FRIENDLY or Opinion is Neutral+, ignore". It's also only one part of their UA.

    I'm considering having DECEPTIVE and WAR AIs posing as FRIENDLY/NEUTRAL pillage the trade route anyway if they could do so undetected (if done while out of sight by Morocco specifically, the notification indicates it was plundered by "filthy Barbarians" and they get no diplo penalty).

    Mostly correct. It uses the visible approach, so a fake FRIENDLY/NEUTRAL AI will act the same as they would if they weren't lying. They also won't plunder your TRs if they're your vassal and they're Content with how you're treating them, as an incentive for treating them properly.

    If you're interested, here's the code:
    Code:
               if (m_pPlayer->GetPlayerTraits()->IsCanPlunderWithoutWar())
               {
                   if (pConnection->m_eDestOwner == m_pPlayer->GetID())
                       bIgnore = true;
                   else if (!m_pPlayer->isHuman())
                   {
                       MajorCivApproachTypes eApproach = m_pPlayer->GetDiplomacyAI()->GetMajorCivApproach(pConnection->m_eOriginOwner, /*bHideTrueFeelings*/ true);
                       MajorCivOpinionTypes eOpinion = m_pPlayer->GetDiplomacyAI()->GetMajorCivOpinion(pConnection->m_eOriginOwner);
                   
                       if (m_pPlayer->GetDiplomacyAI()->IsDoFAccepted(pConnection->m_eOriginOwner))
                           bIgnore = true;
                       else if (eApproach == MAJOR_CIV_APPROACH_AFRAID || eApproach == MAJOR_CIV_APPROACH_FRIENDLY)
                           bIgnore = true;
                       else if (eApproach != MAJOR_CIV_APPROACH_HOSTILE && eApproach != MAJOR_CIV_APPROACH_GUARDED && eOpinion >= MAJOR_CIV_OPINION_FAVORABLE)
                           bIgnore = true;
    #if defined(MOD_DIPLOMACY_CIV4_FEATURES)
                       else if (MOD_DIPLOMACY_CIV4_FEATURES && GET_TEAM(m_pPlayer->getTeam()).GetMaster() == GET_PLAYER(pConnection->m_eOriginOwner).getTeam())
                       {
                           if (m_pPlayer->GetDiplomacyAI()->GetVassalTreatmentLevel(pConnection->m_eOriginOwner) == VASSAL_TREATMENT_CONTENT)
                               bIgnore = true;
                       }
    #endif
                   }
               }
    
    I think you should see more aggression in the next version. I'd offer a replacement DLL to test it but I don't want to mess with Gazebo and ilteroi's CTD fixes and tactical changes. :)

    re: Backstabbing penalties, AI have had some trouble respecting this fairly consistently. I'll investigate the issue. Are the backstabs from denouncements or DoWs?
     
    Last edited: Mar 14, 2020

Share This Page