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

Mod to make AI attack me, the human player

Discussion in 'Civ5 - Creation & Customization' started by Trigan Emperor, Sep 19, 2017.

  1. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I am more of a Wonder/culture builder than world conqueror in Civ V. A recurring issue I have with this game is that, after around the Medieval era, the AI rulers stop attacking me. This is a bit boring and not how it should be and I'd like to try and fix it in my game.

    I play BNW and also have the Aggressive and Expansive AI mod installed. I can't remember how it was without this mod, but in my games the AI rulers fight amongst themselves and conquer each other a lot. They just ignore me, the human player.

    There are a couple of mods that might be useful to work with: the aforementioned Aggressive and Expansive AI mod (Steam link: https://steamcommunity.com/sharedfiles/filedetails/?id=239794296 ), and also the Super Warmongering AI mod (Steam link: https://steamcommunity.com/sharedfiles/filedetails/?id=330726645 ). There's also another useful-looking thread here: https://forums.civfanatics.com/threads/mod-that-makes-civ-v-ai-very-aggressive.545346/

    Here's the relevant code from these two mods. First, Aggressive and Expansive AI mod:
    Code:
    UPDATE [leaders] SET [WonderCompetitiveness] = [WonderCompetitiveness] + 2;
    UPDATE [leaders] SET [MinorCivCompetitiveness] = [MinorCivCompetitiveness] + 2;
    UPDATE [leaders] SET [VictoryCompetitiveness] = [VictoryCompetitiveness] + 4;
    UPDATE [leaders] SET [Boldness] = [Boldness] + 2;
    
    UPDATE [Leader_MajorCivApproachBiases] SET [Bias] = [Bias] + 2 WHERE MajorCivApproachType = 'MAJOR_CIV_APPROACH_WAR';
    UPDATE [Leader_MajorCivApproachBiases] SET [Bias] = [Bias] + 1 WHERE MajorCivApproachType = 'MAJOR_CIV_APPROACH_HOSTILE';
    
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 3 WHERE [FlavorType] = 'FLAVOR_OFFENSE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 2 WHERE [FlavorType] = 'FLAVOR_DEFENSE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 2 WHERE [FlavorType] = 'FLAVOR_RANGED';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 2 WHERE [FlavorType] = 'FLAVOR_MOBILE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 2 WHERE [FlavorType] = 'FLAVOR_EXPANSION';
    
    UPDATE HandicapInfos SET AIDeclareWarProb = 100 WHERE Type = 'HANDICAP_WARLORD';
    UPDATE HandicapInfos SET AIDeclareWarProb = 110 WHERE Type = 'HANDICAP_PRINCE';
    UPDATE HandicapInfos SET AIDeclareWarProb = 120 WHERE Type = 'HANDICAP_KING';
    UPDATE HandicapInfos SET AIDeclareWarProb = 130 WHERE Type = 'HANDICAP_EMPEROR';
    UPDATE HandicapInfos SET AIDeclareWarProb = 140 WHERE Type = 'HANDICAP_IMMORTAL';
    UPDATE HandicapInfos SET AIDeclareWarProb = 150 WHERE Type = 'HANDICAP_DEITY';
    
    And Super Warmongering AI mod:
    Code:
    UPDATE [Leader_MajorCivApproachBiases] SET [Bias] = [Bias] + 16 WHERE MajorCivApproachType = 'MAJOR_CIV_APPROACH_WAR';
    UPDATE [Leader_MajorCivApproachBiases] SET [Bias] = [Bias] + 8 WHERE MajorCivApproachType = 'MAJOR_CIV_APPROACH_HOSTILE';
    
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 12 WHERE [FlavorType] = 'FLAVOR_OFFENSE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 8 WHERE [FlavorType] = 'FLAVOR_DEFENSE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 8 WHERE [FlavorType] = 'FLAVOR_RANGED';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 8 WHERE [FlavorType] = 'FLAVOR_MOBILE';
    UPDATE [Leader_Flavors] SET [Flavor] = [Flavor] + 10 WHERE [FlavorType] = 'FLAVOR_EXPANSION';
    
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE TYPE = 'HANDICAP_SETTLER';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_CHIEFTAIN';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_WARLORD';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_PRINCE';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_KING';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_EMPEROR';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_IMMORTAL';
    UPDATE HandicapInfos SET AIDeclareWarProb = 800 WHERE Type = 'HANDICAP_DEITY';
    So, now to try and understand what this means...

    Firstly, leaders stuff. From the wiki on leaders:
    Secondly, "MajorCivApproachType". I don't know exactly what this is, but I'm guessing that it's the likelihood of these things happening. There are two types described in the mods - War, Hostile - and a third in the other thread - Conquest. I wonder if the Conquest setting affects the chance of an invasion attack with an enemy army at one's border?

    Thirdly, the Leader_Flavors: Offense, Defense, Ranged, Mobile, Expansion. I'm not sure what these are. Are they weighted bias for choice of technology research? So boosting these settings makes the AI leaders more likely to research military techs?

    Finally, there's the AIDeclareWarProb. This is self-explanatory, I guess. A key question is, is this related to AI declaring war against the human player, or against everyone?

    As I wrote earlier, the key issue is AI declaring war against the human player. Certainly with the Aggressive and Expansive AI mod, there are a lot of wars going on on the map, but they are the AI fighting amongst each other, rather than against the player. So a key issue is to try and understand whether the MajorCivApproachType and AIDeclareWarProb values relate to AI vs human or AI vs everybody.

    My current thinking is that I might try keeping the Aggressive and Expansive AI mod, with the following changes:

    i) Use the MajorCivApproachType (War/Hostile) values from the Super Warmongering AI mod, possibly reducing them slightly.

    ii) Add a MajorCivApproachType Conquest value, as suggested in the other thread.

    iii) Use the AIDeclareWarProb values from the Super Warmongering AI mod, possibly reducing them slightly.

    EDIT: Looking again, the MajorCivApproachType Conquest appears to relate to Minor Civs. I don't play with city-states any more. One of the reasons for this is that I didn't think the AI players conquered them enough. If AI rulers conquered city-states like they would other cities, then I'd be more tempted to use them.
     
    Last edited: Sep 20, 2017
  2. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I've been googling around, and have found a couple of interesting quotes:

    "How the AI's likelihood to declare war (against another AI or a human) is actually calculated (ctrl+f MAJOR_CIV_APPROACH_WAR)"

    ( https://www.reddit.com/r/civ/comments/2emp1n/how_do_you_get_the_ai_to_attack_people_for_you/ )

    "AIDeclareWarProb: Affects how likely the AI is to declare war on human."

    ( https://forums.civfanatics.com/threads/we-need-help-deciphering-the-handicapinfos-xml.449651/ )

    So, if this is correct, then the setting that probably most needs changing to affect the likelihood of the AI declaring war against the human player is the AIDeclareWarProb value. I don't know how this works or where to balance it. The Super Warmongering AI has this value as 800% of the vanilla game default value. So I don't know whether this might be too high.

    The MAJOR_CIV_APPROACH_WAR settings I might use from the Aggressive and Expansive AI mod since there are a lot of wars in my games. The Super Warmongering AI increases this value a lot, and I'd be concerned that it would just lead to all civs being perpetually at war.
     
  3. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I was wondering if there's some way of globally modifying AI Leader opinion values against the human player? I'm generally at Friendly status with most AI civs most of the time, with maybe a couple of Neutral, and rarely are any of them Guarded or Hostile towards me.

    Another idea I've had is to enact a house rule that I must Denounce one AI civ at the start of each Era. That should hopefully be a way of stirring things up a bit.
     
  4. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I've had another idea, perhaps a better one. When an AI leader complains to me, I always choose the "Very Well" option. If I instead always chose the "You'll pay for this in time" option, that should build up AI leader negative opinion modifiers towards me, right?
     
  5. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I've read that the "You'll pay for this in time" option has no game consequences, except in the case of city-states. So my new plan is this: every time I see "You'll pay for this in time", I have to click on it and then immediately Denounce that AI leader. Each AI leader is generally denouncing a few other leaders at any given time anyway, so that should hopefully mean that as a human player I'm operating on a similar level to them. Hopefully, this should mean the AI will not ignore me when it comes to decide who to invade.

    It should also help stop me from maintaining a small army (because I don't get attacked). With a small army the AI will send messages commenting on it's puny size. With this rule, I'll have to denounce AI rulers that do this, hopefully annoying them and provoking them into attacking me.
     
    Last edited: Oct 5, 2017
  6. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    435
    Gender:
    Male
    I've been following your thread with interest but don't really have anything useful to contribute regarding the xml changes or house rules.

    Can I ask, what difficulty do you play at and how easily/frequently do you win, and typically on what turn? My experience is that I either lose/give up pretty early or win fairly comfortably (playing mostly at emperor or immortal). There is often a time when I'm vulnerable but rarely seem to get attacked then, so I was hoping to learn something from this thread to spice up my games.
     
  7. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    Currently, I am playing on a custom difficulty between King and Emperor. I play with 22 civs and no city-states on large maps. At King level I always win and Emperor always lose (except when I played the Terra map as Elizabeth, but the AI doesn't know how to play that map). I am somebody that quits a game when the challenge is gone, either because I'm too far ahead or too far behind, so I rarely technically finish games.

    It's possible that since I don't use city-states that that removes a layer of intrigue that causes bad relations with AI rulers.

    Anyway, I'm excited by my Denouncing idea as it seems like an easy and workable solution that could finally lead to some more interesting games in terms of AI threat in the post-medieval era. I'll report back as to how it went after my next game.
     
  8. Trigan Emperor

    Trigan Emperor Prince

    Joined:
    Apr 11, 2015
    Messages:
    436
    I'm in the Medieval age in my current game and I haven't had an opportunity to use my "You will pay for this in time" denouncement rule. As usual, I am beloved by all AI civs.

    I've also been looking through the XML for things that might be possible to mod, but I'm not sure if anything that specifically relates to AI vs human rather than general AI behaviour.

    I think denouncements are the key to this. If everything else is equal, then if the human player doesn't denounce as often as the AI rulers do, then over time the human player will inevitably get higher opinion ratings with the AI than they do with each other. Perhaps this means that the human player then becomes bottom on the list of Civs AI rulers want to declare war against.

    I'm not sure if there's a way to mod this. What's that event that happens quite rarely, when another ruler will ask a favor that you denounce another AI ruler, and if you refuse they denounce you?

    I'm considering playing with a nemesis rule, that as soon as the first AI player denounces another player, then at all times for the rest of the game I must be in a state of denouncing at least one other player.
     
  9. _ViKinG_

    _ViKinG_ BERSERKER

    Joined:
    Mar 15, 2013
    Messages:
    305
    So any one know what AIDECLAREWARPROB value is best to use in the late game to make the ai declare war on human player? With best i mean that they actually declare war, but not go all crazy that every civ goes to war on me :p so some balanced.
     

Share This Page