Announcement

Collapse
No announcement yet.

Why does the AI commit suicide?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why does the AI commit suicide?

    After playing about 10 or so civ games to complelete, I have noticed (especially on harder difficulty levels and post-patch) that the computer sometimes declares war irrationally, often in situations which would lead to its destruction. At first I thought this was based on standing relations, but most of these incidents are occuring when the leader was 'polite', with no history of war.

    First, a few examples,

    Once, when I was the Persions and occupied about 80% of a continent, the much weaker French decided one day to launch a sneak attack on a small, poorly defended detached city. Logistically, I couldn't take the city back without a sea invasion or the total invasion of France. However, I had around 30 calvery divisions and quite literally destroyed France in a matter of 3 or 4 turns.

    In the same game, I gave the germans an ultimitam to remove their troops - and they declared war! I out numbered them 10 to 1, but they declared war, and were promptly and effortlessly destroyed...

    In yet another game, a total sneak attack by the French (agian), very well planned, a small sea invasion with carriers etc, France was as big as me - except I had MPP with nealry every country.


    Anyway, I have had other scenarios latley as well. Countries that I had good relations with suddenly declaring war, even though I am stronger then they are!

    So, as far as I can tell (maybe others can confirm) the computer seams to wage war if:

    1) There is a city, somewhat detached that it feels it can take. (short term objectives)

    2) You are at war with numerous other enemies.

    3) In the modern era, sometimes just randomly.

    It does not seam to take into account:

    1) Global strength - i.e. what can I do to them if they take that one city?

    2) Decent relations, i.e. no history of conflict.


    Its just really bizarre, the computer doesn't seam to have any concept of the possible risks that could be incured by fighting a war. Also, it seams that certain leaders are more prone to treachery then others. I odn't have a complete list, but it seams that France, Russia and Germany are quite aggressive, while India and Greece are typically pretty level-headed. Has anyone else observed this?

  • #2
    yes

    The game doesnt see quality of units, just quantity, it thinks that the umpteen billion warriors it builds will be enough to kill you. It also doesnt think of how it can really carry out the war, IE having an ocean is the best defensive fortification you could possibly be lucky enough to have. Though, and this is really wierd, on deity the ai is really really nice for whatever reason, they dont even mind scouts running through their territory.

    Comment


    • #3
      Yes, I have observed this. It falls in line with a 'brute force' approach to AI programming. You will see the same thing with settlers: The AI simply sprays them willy-nilly all over the map, even to one patch of tundra that will never yield anything of value. At some point, this also clearly inhibits what could have been a great deal of resources spent on internal investment.

      On the other hand, the AI is fairly consistently going to have a good number of cities to work with from early on. In fact, if the AI had been programmed to be more conservative in this regard, good players would likely find it too easy to hem in the computer players and strip them of most or all the good land early on.

      War is the same way. Even though you rightly point out the weakness in the AI's not seeing a larger picture, more often than not, even suicidal AIs ... especially in groups ... will present the player at least some degree of challenge. Of course, as you become a better and better player, the operative word switches from 'challenge' to 'annoyance.'

      My personal hope is that Soren simply got the brute force AI out the door to give us something to chew on while he is as we speak busy coding up something far more refined.
      I've been on these boards for a long time and I still don't know what to think when it comes to you -- FrantzX, December 21, 2001

      "Yin": Your friendly, neighborhood negative cosmic force.

      Comment


      • #4
        Yin, you're amazing. Nine times out of ten, you're a complete *******. Yet, sometimes you say(err... type) something insightful enough to prove again your worth to the community. I've been on these boards for a long time and I still don't know what to think when it comes to you.

        Comment


        • #5
          FrantzX: You managed to rewrite my long-standing signature in a single post. Congratulations! Actually, the above post is more along the lines of how I would discuss these issues if you and I were just sitting down having some beers.

          So I think the lesson here is: We should all be drinking beers here when we post. Anyway, your post captured a certain 'something,' so I have encapsulated it. Thanks again...I think. LOL!
          I've been on these boards for a long time and I still don't know what to think when it comes to you -- FrantzX, December 21, 2001

          "Yin": Your friendly, neighborhood negative cosmic force.

          Comment


          • #6
            As far as I'm concerned this AI is fantastic. Compare it to the AI of civ 1 where civs would often just hunker down in their capital and NEVER do ANYTHING. or civ 2 where lizzy the restarted civ in austrailia would sneak attack the indian empire ecompasing all of india, africa, and europe
            By working faithfully eight hours a day, you may get to be a boss and work twelve hours a day.

            Comment


            • #7
              Actually, I've started to somewhat understand the AI after reading Soren Johnson's interview. And then I've experimented a bit.

              Basically the way it seems to go is: once it has accumulated a bunch of troops (and yes, warriors will do), those start looking for a target. I build a new undefended city. Hey, I have a bunch of money, so I'll rush-build barracks and musketmen in three consecutive turns. But for two turns in a row, that city looks like easy picking. And I _instantly_ start seeing everyone's warriors and spearmen converging towards that city, like sharks towards a drop of blood. Yes, even my allies are rushing their troops to my city. If they can reach it while it still looks reasonably easy to take, they'll declare war and attack. (E.g., if I just built a warrior there and the AI has brought warriors, too.)

              The fun part begins if I finish rush-building those musketmen. You can actually see them changing direction. Some will go back home, some will start homing in on another city. E.g., I wait until they're nearly upon a city where (my mistake) I still have two spearmen inside. I upgrade those to musketmen and grin widely. Yep, you can see those little sharks changing direction again, towards another city. One upgrade later, they give up and go attack a new Zulu city instead.

              Don't get me wrong. I'll aggree that it's brute force AI and that it doesn't see the big picture. All it sees is a bunch of separated cities, and whether one would be a reasonably easy target. It has no idea what will happen next, or what will it do with it. Most often that city is almost worthless to start with, and so far away that corruption would make it TOTALLY worthless. It's like dogs chasing a car, even though they couldn't drive it anyway.

              It doesn't even see the 8 knights stationed around that city, and which will make mincemeat out of his attacking force. If you want to have some pointless fun, you can create a maze of tanks or other troops with ZOC, and watch his troops march through that maze towards the city, and reaching it with 1 hp each.

              However, it DOES see troop quality. It's just that as it gets more and more troops, its definition of a target it could take starts shifting too. It seems to go "oh, I have 10 warriors, that city has two riflemen, guess I can go for it." But again, it has no idea of what next. He's taken a city or two, but he's lost his whole offense force. What NOW?

              Comment


              • #8
                In fairness to Soren, AIs that can "see over the horizon" have never been successfully produced. Brute force is about the best that Boolean logic gates can do.
                "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

                Comment


                • #9
                  I think most of the problem boils down to the AI not being able to value your military properly.

                  In most games, i have a small (comparatively) but modern group of fighting units, artillery and such, whereas the AI has some modern units but mostly composed of ancient units. It considers itself more powerful than me despite its complete lack of ability to do me harm. If i built 100 workers and 1 warrior, an enemy with 25 modern armour would feel inferior to my 'army'...

                  And an AI in that situation will declare war, thinking its top-dog.
                  I'm building a wagon! On some other part of the internets, obviously (but not that other site).

                  Comment


                  • #10
                    Well, I'll aggree that it can't possibly play as well as a human player, but then that's why the AI was given a bunch of advantages. E.g., it can definitely see that I have a city with no defenders, even though he doesn't have anyone near it. (Nor the money to keep investigating my cities every turn.)

                    It might have been useful to factor in some more things, though. Such as the number of my knights stationed in that area alone, even if I keep them outside the cities. (I keep ALL my offensive troops fortified out in the open, not inside cities, so I can easily find them when I need them. Which also has the nasty side effect that an AI who only looks as disparate cities, will wrongly see them as poorly defended.) Or to have a look at the combined might of my armies, versus the pitiful might of his. Does he REALLY want to be on the receiving end of my few dozen knights? Because it doesn't take a genius player to figure out that it IS what's going to happen when he declares war.

                    Or is it really worth taking a city, when it has no resources and at that distance corruption will make it worthless? I figure the AI should have no problem asking the game engine "hey, how much corruption would I get in that city?" (Well, not like that. I know it would be a function call instead, but you get the idea.)

                    Comment


                    • #11
                      Oh, I agree that the AI could be improved significantly. I'm just trying to discourage those (not you, but others) who might unrealistically expect a Star Trek fantasy AI that isn't possible when you have nothing more than embellishments upon A and Not A.

                      The funny thing about development is that you really don't know what you're dealing with until it's finished. Then, it's too late to implement easily things that seem obvious now but were fuzzy during initial coding. The degree to which you can successfully upgrade code is directly proportional to how well you encapsulated and abstracted the original code.

                      And few do it well.
                      "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

                      Comment


                      • #12
                        Well, alot of what you have said here I have already noticed:

                        The AI knows strengths of all your cities - he likes to launch his attacks on your weekest points. There does seam to be some notion of reinforcement ability. AI's prefer detached -hard to reinforce cities.

                        The AI definitly has a good idea how strong you are militarily, in fact, having a week military is a sure way to get into wars.

                        The AI does NOT seam to have any real notion of global consequances of an action. I.E. 1) Activation of Mutual defense treaties 2)Counter attack on its own cities. It doesn't appear that even the simplist crude estimates are made. AI programming is hard, but it would be failry easy to evaulate strenght of enemy forces which can launch an invasion.

                        The AI has a notion of a potential opponents liability. That is, if definitly likes to go to war with a nation that is already loosing a war. This does have the ammusing affect of watching all the computer players gang-up and rip a country appart. Just make sure it isn't you!

                        What I don't know:

                        Does the personality of the leader have an effect? It seams to me that Greece and India (for example) don't typically do these kinds of things, and Germany and Russia ALWAYS do. It looks like there are about three types of personalities - Aggresive (Germany, Russia), Manipulative (England, America), and Peaceful (Greece, India). Maybe this is just my imagination, I haven't played enough games through to know.

                        What in the world does the computer factor in making peace? I've seen the most stuborn peace negotions when a country was on the verge of desctruction. Clearly, every thing in the game has a monetary 'price' tag and the computer computes how valuable something is to you. It also knows how valuable something is to it. Apparantly, peace to avoid destruction isn't that high on the list.

                        Does a computer factor in Civil Unrest and potential needs for goverment collapse when fighting a war?

                        Comment


                        • #13
                          My largest gripe about the AI is its failure to really recognize unit quality. Number of units alone is only part of a civilization's military strength. In my current game I am alone on my continent with the Romans. They have been the black sheep the entire game, always lagging behind in tech and culture. Suddenly in the late middle ages they started cranking out massive amounts of legionaries after they finally generated the culture necessary to secure an iron deposit just two squares away from a city in the middle of their empire. At this point I had 3 large armies with cannon, musketmen, and cavalry positioned near our shared border. After about twenty turns of legionary breeding, Rome's power on the histograph nearly tripled. Now they had a large army of legionaries compared to the small army of archers and spearmen from before. My military advisor warns me that our military is much weaker than the Roman's. Finally, a couple huge stacks of troops shows up outside one of my cities on the border and when I ask them to leave the Romans declare war. They manage to raze this one city. Then for about 15-20 turns my armies decimated stack after stack after stack of legionaries that came pouring over the border. I must admit, they managed to keep me on the defense for quite awhile, but I lost only about ten units total and these were cavalry I was using to hunt them down. The point to my story...the AI should focus more on the quality of its troops not quantity because after fileting the first 2-3 waves of legionaries this war deteriorated into a boring massacre.
                          Last edited by Golgo13; December 21, 2001, 11:37.

                          Comment


                          • #14
                            Originally posted by Moraelin
                            Don't get me wrong. I'll aggree that it's brute force AI and that it doesn't see the big picture. All it sees is a bunch of separated cities, and whether one would be a reasonably easy target. It has no idea what will happen next, or what will it do with it. Most often that city is almost worthless to start with, and so far away that corruption would make it TOTALLY worthless. It's like dogs chasing a car, even though they couldn't drive it anyway.
                            Good post.

                            I'm hoping to see the military AI behaviours patched heavily over the next few months. It's as though certain things were well implemented (evaluation of unit strengths within a given city) and others not even included (total military might). Part of this might be the military evaluation algorithm.

                            I've noticed in the military advisor screen that some civ's force's will be reported as Average next to mine, huh? I'll have 45 tanks to his 25. I'll have 100 mech infantry to his 65 infantry. I'll have 30 artillery next to his 15. The only place it will outclass me is in naval strength because I don't put a premium at keeping up with the joneses with my navy. Then there will be the obligatory horde of inferior units the AI hasn't bothered to upgrade. Somehow, though, the AI evaluates a clearly superior military to only be on par with his. I'm guessing that what is going on for evaluating global might is that shield value is what is used for determining total strength (I observed in the "Is combat screwed up?" thread that unit costs do not scale appreciably with the increase in unit strengths - 4 longbowmen are "worth more" than a tank). As such, on a global scale, the hordes of inferior units still pan out to being evaluated the same or greater strength to our lean, mean militaries and the AI happily goes to war with us.

                            A more workable approach is to assign a total damage potential value for each unit based upon attack strength, movement, number of attacks allowed per turn, unit experience, etc. Additionally, assign a total damage resistance potential for each unit based upon their defense values and unit experience. Then, when weighing military strengths you devise some forumula taking number of units into account that looks at one military's potential to do damage versus another. In this case, a ballpark guestimate is that it would take something on the order of 100 or more warriors to equal a single tank for equality of miltary strength.

                            Once you have a workable military strength evaluation in place, it becomes reasonably trivial to weigh the desirability of starting a war or joining an alliance against some other strength in terms of liklihood of success.
                            Last edited by Code Monkey; December 21, 2001, 12:06.

                            Comment


                            • #15
                              IMO, most of these problems could be solved by taking a two-pronged approach:

                              1) Remove REALLY outdated units from the build queue. When you can and should be building tanks, having the option to build swordsmen only confuses the AI. Take it out, and he'll build tanks, cos that's the only choice given (well, tanks, mech inf, you get the idea). Modern stuff.

                              2) Have the AI Calculate its military strength/position as the sum of it's total attack value (the attack values of all its units) vs. the total defense value of all yours. Likewise, when preparing an attack, have the AI compare it's total defense value to your total attack value and plan accordingly.

                              The Mod we're working on can't do anything about the AI, but one thing we ARE doing is making zero-resource units available in every age....these will replace the hordes of outdated swordsmen/longbow that the AI seems overly attached to, and should help solve at least that part of the equation....

                              -=Vel=-
                              The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

                              Comment

                              Working...
                              X