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

AI Aggression levels (please discuss here).

Discussion in 'Civ4 - Better AI' started by Blake, Jan 26, 2007.

  1. Doomed_UK

    Doomed_UK Warlord

    Joined:
    Nov 25, 2005
    Messages:
    253
    True, True.

    But if I am playing with a 'peaceful' AI next to me and deliberately foster good relations I would hope that I could let my guard down a little.
    e.g. I had Roosevelt with me on an island. I had quite a few archers and chariots, shared a religion and was donating a healthy resource. I was around plus 5 or 6 in relations. Then quite soon after he researched Bronze working he went for me.
    eg. in another game Frederick came sailing over from his lonely island. On first contact he must of had a city catch my religion, as he immediately converted to my religion. He also immediately asked for a trade deal which I agreed to. I was only just below him in power at this first contact.
    Next go he declares war! Only thing I can think of was a surplus of troops. I defeat 2 loads of units he lands and he takes peace. He immediately asks for that trade deal again, which I give him. Relations look rosey now. After the 10 turns of peace are up immediate war again!
     
  2. Arlborn

    Arlborn Legendary Noob

    Joined:
    Jul 29, 2006
    Messages:
    1,939

    While this is acceptble for some AIs, its not acceptble IMHO for all the personalities. Like for example Isabella(same religion) or the Indians and some others.

    If a really peacefull AI or trustfull is a friend of you, it shouldent attack you out of nothing, or the game will get boring as all the AIs will do always the same.

     
  3. jkp1187

    jkp1187 Unindicted Co-Conspirator

    Joined:
    Aug 29, 2004
    Messages:
    2,496
    Location:
    Pittsburgh, Pennsylvania

    Is Roosevelt actually a "peaceful" leader?

    I recall seeing a spreadsheet floating around the forum someplace showing how the AI would behave in various circumstances. I recall being surprised at how aggressively coded the American leaders (esp. Washington) were in Warlords.
     
  4. scu98rkr

    scu98rkr Prince

    Joined:
    Nov 2, 2004
    Messages:
    463
    I have to say I have not yet played the latest build with the "aggresive AI" option off.

    The example with Roosevelt seems harsh and I do with think +6 with no negatives Roosevelt should think twice about attacking you, especially if power is similar.

    However in the second example Bismark tends to be a bit of a warmonger if he thought he could take some of your cities why not ?

    I think the only thing is he didn't consider is how difficult sea invasions are.
    (After playing some LAN mulitplayer I've realised its not just the AI which has problems with this, sea invasions are just plain hard.)
     
  5. Quagga

    Quagga Former Dictator

    Joined:
    Aug 31, 2006
    Messages:
    663
    Location:
    Li'l Rhody
    I guess this is the right thread for this. Note, that I'm not complaining. Just reporting. :)

    Playing 07-01-25 build. Stalin has been almost continuously at war since he got horse archers (guessing a bit here). He beats somebody into submission, then declares on somebody else. When it was my turn, he already had two vassals.

    Can't say I've seen this behavior before. It probably has to do with the changes that prevent an AI from sitting on a big, unused military.

    Also, in this game, one of Stalin's victims was Mansa. Also my neighbor, I took the opportunity to join in. His capital was the seat of four religions (all but Buddhism and Hinduism). I captured two cities from him and then he was out. If it had been only one, I would have guessed he was trying for OCC CV! :lol:

    EDIT: Forgot to mention: Not a single shrine!
     
  6. Doomed_UK

    Doomed_UK Warlord

    Joined:
    Nov 25, 2005
    Messages:
    253
    After pondering on this today (rather then doing what I am paid for) I wonder if the fact that I am not using the AI handicap may have some bearing on the matter.
     
  7. Quagga

    Quagga Former Dictator

    Joined:
    Aug 31, 2006
    Messages:
    663
    Location:
    Li'l Rhody
    ^^^ Now that you mention it, I'm sure it matters in these discussions.

    To be on the record: I'm using only the Better AI, no XML changes.
     
  8. cf_nz

    cf_nz Prince

    Joined:
    Mar 17, 2006
    Messages:
    414
    Location:
    New Zealand
    I have the same reservations about AI going against it's personality, but that's a very good point.

    Sounds like that's what Blake is aiming for in terms of balanced play and pursuing 'the right strategy'.
     
  9. jkp1187

    jkp1187 Unindicted Co-Conspirator

    Joined:
    Aug 29, 2004
    Messages:
    2,496
    Location:
    Pittsburgh, Pennsylvania
    I think I am seeing the "guns make us powerful; butter only makes us fat" situation that Uncle Joe (and others) were describing earlier using the 1/25 mod in my current game. It probably helped that all civs started on this large wrap-around continent in the southern hemisphere, making it easier for everyone to get involved in wars with everyone else. Tech has definitely been delayed a bit. Per chipotle, Hannibal and Julius Caesar were both major practitioners of the "dagger" strategy. Ramses has been opting for "peaceful/builder" a lot, but this hasn't stopped him from taking large parts of Japan for himself. I had a horrible starting position, hemmed in by Korea, although I've started to make up for it by colonizing a lot of otherwise empty overseas island-continents.

    This has been an entertaining game so far, and i don't think I'm going to win (unless I can eke out a 21st century spaceship win,) as Ramses is far and ahead #1 in terms of population.

    Not really complaining about this, but I can see how the constant fighting with large (15-20 unit) stacks could get annoying if this is ALL that goes on in a game. FWIW, Noble, 8 civs, small tectonics map, NOT using the new handicaps.
     
  10. Arlborn

    Arlborn Legendary Noob

    Joined:
    Jul 29, 2006
    Messages:
    1,939

    Anyway that is not so bad if he wins, because Ramses is builder, but not extreme.
    If he is going to win, then its a vicotiry of a non-warmonger AI.
    Do he always has a big power in the graph?

    All I want is AIs having chance of winning following their personality(unless its too dumb for a specific situation). After all, I would love to see Alex winning a Conquest victory, but Gandhi? No please.:rolleyes:
     
  11. Wodan

    Wodan Deity

    Joined:
    Jun 3, 2005
    Messages:
    4,867
    Location:
    In transit
    Some of this is moved from the other thread. It seems to belong more properly here.

    Just read Blake's post. The one about the 1/N win chance?

    There are two things being talked about, both by Blake and others. One is simple task implementation (we might call this "tactics" though not in a strict military sense); two is strategy (again, not necessarily in a military sense).

    A task might be the worker algorithms, citizen governor, or military unit actions. We should recall that one of the things BetterAI did was remove the blind "road everything" from the worker algorithms. There are many more changes to this type of routine task that I've seen the BetterAI change. These little things add up to an overall "smarter" AI. So, in this sort of "tactical" sense, the AI is acting much more like humans.

    The strategy is what most people are immediately leaping to here. Talking about Dagger, or turtling/teching, etc. We've been so focused on the military but this is really an overall question... what path does the AI pursue to victory, each time it selects how to govern each specific civ in a game.

    I think it might sound like I'm disagreeing with them, which is why I've tried to be careful to put in some "agree with you" etc.

    I do think that the current BetterAI is not what *I* want, and based on the 1/N post by Blake, is not what he wants either. That said, I don't want to go back to 2.08 either, I think they're making huge progress.

    I guess what it comes down to is that I don't expect miracles, and I expected all along to have some wild swings in the "strategy" behavior. So, now that we're actually seeing some of those wild swings, it doesn't bother me. Oh, it bothers me in the sense that I will continue to give feedback and that we're not quite there yet, but it doesn't bother me in the sense that I think everything since 2.08 (except the bug fixes) is trash and needs to be thrown out. To me, that would be a huge mistake.

    Agreed!

    That makes sense.

    I guess the question then becomes what do you mean by "military emphasis".

    I don't think it's a question of "going down that particular path". All I'm suggesting is to recognize the similarities between the diplomacy modifiers and how humans act in a game such as Diplomacy (or MP Civ).

    You mention backstabbing. Exactly... there is a Civ modifier by "you attacked our friend" as well as one for "we remember what you did to the English" or something like that.

    I'm going to back up a minute, because we lost the quote trail. How does this relate? You originally said
    Maybe I'm overlooking your qualifier "regardless of other circumstance" but to me, if you backstab an AI, then other AIs should have a bigger military on their borders with you. If you have good relations with an AI, then they should have less.

    And, programming the AI to win means that they should recognize when it is a good idea to double team the leader.

    Wait a second... are you saying that you want the ai to recognize when it is a good idea to double-team the leader, or you don't want that?

    That situation probably distills this debate down to its essence. If I'm good to an AI (say, Isabella), adopt her religion, give her stuff, help her fight her enemies, don't backstab anybody (including her of course), then let's give a situation where someone, let's say Catherine, is #1, I'm #2, and Isabella is #3. Let's assume we're all friendly with each other, and Catherine is about to win, with whatever victory condition. Should Isabella be amenable to me getting her to join me in a war on Catherine?

    Personally, I would be disappointed if the AI was programmed to preclude that possibility. I spend all game doing my "builder" strategy or other non-warlike game, which we like as part of Civ. Then, I discover Catherine is about to win. And, I can't do a thing about it?!? How disappointing is that. It makes me say, "I should have converted to a war strategy earlier and wiped her out."

    Yet, it sounds like you're saying that's preferable to the alternative, which is to program the AIs to recognize some human goals, such as ganging up on a leader.

    To me this becomes a question of what is meant by "the direction the mod is heading"... the observed results, or the stated goals of the BetterAI team.

    3) Build enough units for defense. Reserve the capability to rush build in case of attack. (Note that the AI has this option too, and the BetterAI does a pretty good job at this, though it could still be improved.)
    4) Get land via other methods... opportunistic settlers wandering around through the war zone of two neighbors, waiting for cities to be razed (very likely in the early game), isolating large chunks of territory by not having open borders (or by closing them when the AI sends a settler or galley over), etc.

    IMO, teach it to:
    1) know when to quit a war
    2) either upgrade or disband old / worthless units
    3) be better at rush / whip of defender / counter-attack units
    4) better use anti-stack defenses (cats)
    5) better distinguish garrison troops and counter-attack troops
    6) not create so many garrison troops

    This gets back to #1 above... the AI needs to know when to quit.
    -- Part of that is to not overexpand and thereby suffer economic penalties to an empire size that the current economy can't afford.
    -- Part is the ability to recognize when the goals have been met (the goal is not necessarily total victory over the opponent, but simply getting more territory for one's self and/or hamstringing the opponent's growth).
    -- Part is recognizing the "big picture" in terms of victory (in particular the power graph... this gets back to ganging up on the leader... B and C are warring enough that both their power drops to a certain level below A, then a decision has to be made in regard to what is remaining to be gained from continuing the war or suing for peace because A is the real enemy who is threatening to win the game)

    My own personal feeling (from direct observation of my games using the recent builds, as well as from posts by Blake and Iustus) is that the current BetterAI builds and designates too many units as city defenders. Change that, and we've achieved 80-85% of the goals here.

    Wodan
     
  12. jkp1187

    jkp1187 Unindicted Co-Conspirator

    Joined:
    Aug 29, 2004
    Messages:
    2,496
    Location:
    Pittsburgh, Pennsylvania
    Lately he has -- I don't recall if Egypt was always on top with regard to power. If you want to, check the file I uploaded titled "NO DRAFT" under the Bug Report thread. (I couldn't get "draft" to work -- bonus points if you can tell me what's wrong with THAT and/or tell me what I missed....)

    [EDIT: Never mind, Iustus explained what was wrong with the Draft thing, and it was weird. Nothing wrong with better AI, though.]
     
  13. Uncle_Joe

    Uncle_Joe Prince

    Joined:
    Sep 9, 2005
    Messages:
    467
    By that I mean that even if I'm not intending to attack a neighbor, a heavily disproportionate amount of my econ is going towards constantly building and upgrading military units. I would guess that my military expenditures in 1/25 are between 3x and 4x what they would be in a similar 2.08 game (regardless of circumstances).

    The only way to survive in 1/25 (short of luck) is to horde military. You cant neglect it even for a little while or else your military rating falls and its tough to catch back up. So, I end up with stacks and stacks and stacks of military units every game. To me, that is not fun and its not 'decision making'. The decision is already made...build military and more military.

    I'm saying thats its going to be impossible to program an AI to make 'judgement calls'. In some cases, I absolutely think it would be a good idea to double-team the leader. In others I dont. And I certainly wouldnt want to get to a situation where every time you are about to win, 5 AIs pile on because its the 'smart thing to do'.

    Its not really a solvable equation IMO because there isnt even a 'right' answer to be shooting for.

    Both. The observed results are to me, not as much fun when I feel like I must build military as my primary focus game after game. The stated design goal seems to support this because if the AI is going to be 'smart' and 'play like a human' then naturally it should be attacking you if you start to take a lead. In many cases, thats what other humans would do.

    Now, supposedly they intended to temper that with the AIs' 'personalities', but to me that is going to be next to impossible. Are we saying that its 'smart' for the warlike AIs to attack the winner but not smart for the builder to do so?

    On another note, it also makes AI behavior predictable and adds to the 'luck of the draw' factor in the game. If I KNOW that AI 'x' is going to attack me if I'm in the lead, then I'll make sure to take out AI 'x' as a 'pre-emptive strike' since I'm going to be attacked anyways (again, since its 'smart' to do so).

    Its a big complicated ball of wax that I cant see being resolved any time in the near future. My understanding is that the AI team is trying to build towards the 1.0 release. And in that case, I think we are farther from what I consider to be 'fun' than we were a number of weeks back. YMMV.
     
  14. Elandal

    Elandal King

    Joined:
    Oct 24, 2006
    Messages:
    870
    Location:
    Finland
    This is a variation of "go light on defense". To keep a credible defense took 30% of my total commerce (unit maintenance), which means it was already in the spiral of death - I was down to half my research power without having an offensive force. Not to forget the hammers building the defense forces took, albeit with the reduced research power I'm not sure if there had been other good builds available at all..
    So light on defense combined with capability of rushing credible defense WHEN (not IF) the attack comes. Certainly a valid strategy, but the risk of facing overwhelming attack is still too high to not call it a gamble.

    This is something I probably have to work on. I really don't like settling so that I can't secure a culturally owned path to my core, but maybe it's necessary at times.
    I think I noted the backyard backfill in "lucky start" category, although after considering Snaaty's strategy this seems doable without reliance on lucky start that gives the backyard to you: settle forward to create the backyard. Again this is something I probably should try.


    Without quoting more, I do agree with you on many points. Your points regarding what smart warring might mean were definitelly good ones. Indeed if understanding the big picture can be broken down into small steps the AI can take, it'll be closer to the goal of being smart.
     
  15. Uncle_Joe

    Uncle_Joe Prince

    Joined:
    Sep 9, 2005
    Messages:
    467
    And this is exactly what I meant when I've referred to the latest builds reducing decision-making (ie guns or butter). Often tech is progressing much slower (not necessarily a bad thing), but that leads to situations where I'm not making any trade offs....I just spam military until something new comes along to build and then I build those in every appropriate city. So the 'decision' is to always build military, but puncuated with the buildings as soon as they are available.

    In 2.08, there are often lots of buildings available that I may want but I also know that I have to build at least some military to keep up with the Joneses. Even the 2.08 AIs will attack if you are really weak and while they might not 'conquer' you, they can make a nice mess...certainly enough to make it not desirable to be attacked.
     
  16. kettyo

    kettyo Seeker of Reality

    Joined:
    Mar 6, 2002
    Messages:
    662
    Location:
    Budapest, Hungary
    Why don't just spy on your enemy planning a war against you what kind of force they'll send on you and build a proper combination to counter their forces. Also rally units to your border cities. Also can build forts into defensive terrain with some defenders to trick them.
    But let them pull ahead in power to launch that damn attack on you.
    Just be well prepared and slaughter them :D
    Getting into an arms race with your enemy yet decided to attack you is pointless. It will just hurt both of you.
    Let them attack and than wipe them out quickly instead of arms racing :D
     
  17. kettyo

    kettyo Seeker of Reality

    Joined:
    Mar 6, 2002
    Messages:
    662
    Location:
    Budapest, Hungary
    Yes he has very peaceful personality.
    Washington is a bit less but still peaceful too.
     
  18. Blake

    Blake The AI Guy

    Joined:
    Feb 18, 2006
    Messages:
    342
    Location:
    Apolyton
    Joe, you are becoming tiresome.

    I don't think the unit spam even exists anymore. Players are complaining the AI's are defending themselves far too lightly.

    Also AI personalities are a tricky thing. Some AI's are horrible backstabbers - I think for example Asoka and Frederick (although it may be Peter) actually have backstabber personalities, it's just that they wouldn't ever build up enough military to start feeling frisky - one of my few military defeats (pre-Better AI) was to Asoka, who decided to backstab me with a large axeman horde he built for god knows what reason. I can probably try and reduce this tendency by tying in the old aspects of personality with the side effects of reducing aggression - for instance the "Train Unit" probability - those AI's with a high train unit.

    Here are the "Bastard Charts" to show which leaders are the biggest scumbags, according to their probability of training units, their probability of declaring war, their probability of shamelessly dogpiling and finally their probability of declaring war at Pleased - the Total column is basically their "Bastard Rating" - the higher the total, the more likely they'll cause trouble. For all numbers, bigger means badder.
    (A 0% of dogpiling does not mean a 0% of him dogpiling you - it'll just be a total war rather than a dogpile war - however 0% at pleased DOES mean a 0% chance of declaring war - it wont happen unless the AI decided to declare before becoming pleased)



    The winner is Ragnar, being highest or highest equal across the board - except in attacking those he is pleased with (only one is higher).

    There are some anomalies - Mehmed despite having SOME nice personality traits (respects friends) is actually a big warmonger - call him an Honorable Warmonger, Brennus is like his little brother. Don't trust these guys unless they're actually pleased.

    Catherine and Isabella both have fairly low train units - but are also very shameless in declaring war, making them the incompetent backstabbing b*tches we know and love. However Isabella also has her obnoxious personality working against her - making her both more likely to declare war, and more incompetently (catherine is more likely to wait for a position of strength).

    Elizabeth is generally peaceful, but does have a chance of declaring war at peace but more importantly has an incredibly high probability of sliding a knife in your back if you are distracted - Roosevelt has an identical warring personality (good job...), fortunately both these leaders have low unit training probabilities so they may be too timid to attack (which is why they are backstabbers). Asoka is also something of a closet bastard but does respect his friends. And actually many leaders, such as Mansa Musa, will just decide to up and attack people they are pleased with - the dice rolls make it that way. Just because SOME peaceful AI's will do this shameless backstabbing rarely, does not mean that Hatty or Ramsesses will - those two are much more pleasant (not all peacemongers are XML'd equally...).

    What Better AI does is enable all AI's to train up larger armies if they feel the need (rather than the army component being based largely on dice rolls also), this generally increases their chances of declaring war. This will tend to make the closet bastards (like Elizabeth) more likely to come out of the closet...
    Whether this is going against their personality, or just a repressed aspect of their personality, is subject to debate.
    I will be using the "Train Unit" factor in more places to get more diversity in army sizes (the train unit factor wont be respected much when actually in a real war, when desperate they'll all spam units).

    Anyway hopefully this gives some insight into the AI personalities...
     
  19. Uncle_Joe

    Uncle_Joe Prince

    Joined:
    Sep 9, 2005
    Messages:
    467
    Enough said. I've tried (apparently unsuccessfully) to make the point. I cant back it up any further.

    As I've said REPEATEDLY, its your call to make.

    Good luck with itl
     
  20. Arlborn

    Arlborn Legendary Noob

    Joined:
    Jul 29, 2006
    Messages:
    1,939
    @Blake: Is that 'Train Unit' the actual % of the hammers they use in total, used only in units(in Vanilla)?

    And how come your changes changed it if you didnt change that part? You just took off some restrictive codes?

    Im impressed by that list.
     

Share This Page