Announcement

Collapse
No announcement yet.

The key to AI greatness

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

  • The key to AI greatness

    Ever wonder why AI England is always laughable, while AI Egypt often dominates? Why Zululand rarely gets past the Middle Ages? Well, it’s more than just traits and UU. Ever wonder why the AI sometimes doesn’t have a marketplace in the industrial era, or why it doesn’t have factories well into the modern era? The answer is the build strategy that the AI follows in its cities.

    Each civilization has a “build-often” and a “build-never” list. You can find this list under the civilizations tab in the editor. The build-never list is always empty, but the build-often list is as follows:

    Code:
    Civilization  Off Def Arty Setl Work Nav Air Grth Prod Hap Sci Wlth Trad Expl Cult
    ----------------------------------------------------------------------------------
    Rome (4)       X   X                          X    X
    Egypt (3)                                     X    X                           X
    Greece (3)                            X                     X        X         X
    Babylon (4)                                                 X                  X
    Germany (5)    X                                            X                  X
    Russia (4)                                X   X             X
    China (2)                                     X    X        X
    America (3)                               X   X    X                           X
    Japan (4)      X                      X                 X
    France (1)                                              X            X         X
    India (1)                                     X                 X    X         X
    Persia (4)     X                                                X    X
    Aztecs (4)     X                                        X
    Zulu (5)       X
    Iroquois (2)                                  X         X                 X
    England (3)                           X                         X    X         X
    
    Off: Offensive Units
    Def: Defensive Units
    Arty: Ground Artillery
    Setl: Settlers
    Work: Workers
    Nav: Naval Units
    Air: Air Units
    Grth: Growth Improvements
    Prod: Production Improvements
    Hap: Happiness Improvements
    Sci: Science Improvements
    Wlth: Wealth!
    Trad: Trade Improvements
    Expl: Exploration Units
    Cult: Culture Improvements
    
    X = build often
    
    The number in brackets after the civilization name is its aggression level.
    Looking at this list, it’s easy to explain why each AI behaves the way it does in the game. For example, England not only has bad traits and UU, but it also has Wealth and Naval Units in its build-often list. Every human player knows that a Navy is not really worth building on most maps, and that you should never build Wealth, even when you have nothing else to build! (It’s much more efficient to build a unit in a core city and disband it in a corrupt city than having the core city produce Wealth and rush-building in the corrupt city). Another example: Rome and Zululand produce units like crazy, at the expense of any kind of cultural improvements. They sometimes do well at the beginning of the game, but never last. Also, why don’t expansionist AI build scouts? Well, none of them except the Iroquois have the Explore Units in their build-often list. Why does France outperform their traits and UU? They are one of the few AI to have trade (marketplaces!) on their list, and don’t waste time building extra units.

    Keep in mind that this list doesn’t mean that the AI doesn’t build other things. It builds other things, just at a lower priority.

    I think the game could present a better challenge if the AI had build priorities closer to what we humans have found optimal. These build priorities are, of course, trait-dependent. Here’s a list of build priorities and aggression levels that I propose to make the AI better:

    Code:
    Civilization  Off Def Arty Setl Work Nav Air Grth Prod Hap Sci Wlth Trad Expl Cult
    ----------------------------------------------------------------------------------
    Rome (4)       X                                   X            O    X         X
    Egypt (3)                                      X   X    X       O    X         
    Greece (2)                                         X        X   O    X         X
    Babylon (1)                                    X   X    X   X   O    X         
    Germany (5)    X                                   X        X   O    X         X
    Russia (3)                                         X        X   O    X    X    
    China (4)      X                               X   X            O    X         X
    America (3)                               X    X   X            O    X    X    X
    Japan (4)      X                                   X    X       O    X         
    France (1)                                     X   X            O    X         X
    India (1)                                      X   X    X       O    X         
    Persia (4)     X                               X   X        X   O    X         
    Aztecs (4)     X                                   X    X       O    X         
    Zulu (5)       X                                   X            O    X    X    X
    Iroquois (4)   X                                   X    X       O    X    X    
    England (2)                           X            X            O    X    X    X
    
    X = build often
    O = build never
    These are the build priorities and aggression that I would choose if I were playing those civs. I am not the best civ3 player in the world, so feel free to make suggestions on how to change these.

    My philosophy was:
    • Trade is a top priority for everyone. Everyone should build marketplaces ASAP.
    • Some form of cultural build is a priority for everyone. Scientific civs get scientific buildings, Religious get happiness buildings, and everyone else gets generic the cultural flag checked.
    • Nobody ever builds wealth.
    • Production (factories) is a top priority for everyone. Subsequent builds go faster after factories.
    • Industrious and builder civs get growth (granaries) as a priority.
    • Militaristic and good offensive UU civs (Persia, Iroquois) get offensive units as a priority, and have higher aggression.
    • Builder civs have lower aggression.
    • Expansionist civs make exploration units a priority.


    [Edit: removed useless bic file]
    Last edited by alexman; July 29, 2002, 15:45.

  • #2
    Alexman, I don't know if I agree. Sure, sometimes I too find it annoying that certain civs do not produce well, don't trade well, or build loads of navy when there is no sea around. But, that also gives a wider spread in the game... the English will be better on archipelago maps then the zulu will, because they build more navy. In other maps the Zulu will be better, as they can take out large parts of the world before the others have a chance of bracing themselves.

    Maybe making production a must build for all is a good idea if you look at it from one point of view, but in a mixed AI-map, having the difference will mean that certain civs will get a much bigger boost, and therefore will get more advantage then others. Just by destroying ancient civs (like the Romans or Zulu) they grow big, and menacing. If each civ would have the same production tastes, it would mean that all would be relatively equal in power, and therefore all keep about the same size. I think that in order to get better AI resistance, certain civs should not be given late game traits like trade or production.

    Even the wealth option has some advantage: it will mean that certain civs will have more cash, cash they can spend on upgrades(!), techs, or making deals. Because this will always coincide with more trade buildings, it can become very powerful in comparison to other AIs. Putting all wealth to 'never build' seems a very poor decision IMHO, sometimes I use it too (never to rush buildings in corrupt cities, that is always done with spare cash floating around). I'm sure the AI will find some use for it as well.

    No thanks, I appreciate the effort, but I think that having such diverse AIs will make it more enjoyable than the blendness you are proposing. Certainly if this means that certain AIs will belong to certain eras (the Zulu are ancient not industrial, while the Americans are exactly the opposite). I think better results will come from chosing the AIs carefully when playing, and so far the scenarios I've seen do that excellently: modern wars mean industrial civs, ancient wars mean ancient civs.

    DeepO

    [edited: too many typos]

    Comment


    • #3
      Re: The key to AI greatness

      Originally posted by alexman
      Every human player knows that a Navy is not really worth building on most maps, and that you should never build Wealth, even when you have nothing else to build! (It’s much more efficient to build a unit in a core city and disband it in a corrupt city than having the core city produce Wealth and rush-building in the corrupt city).
      I'm fairly sure that the AI's (who LOVE to keep their obsolete units around) don't use the 'build unit and disband it elsewhere' strategy. So 'building' wealth sometimes may be a good idea for them.

      Otherwise, your changes sound pretty interesting.
      "As far as general advice on mod-making: Go slow as far as adding new things to the game until you have the basic game all smoothed out ... Make sure the things you change are really imbalances and not just something that doesn't fit with your particular style of play." - WesW

      Comment


      • #4
        Very good work. Explains a lot. And the proposal might just represent a material improvement, although you have to think this is so fundamental that it could require lots of effort to balance it right. Thanks
        Illegitimi Non Carborundum

        Comment


        • #5
          No... looking at it again, the only improvement I see you are proposing is giving the Persians a scientific need, instead of the Chinese. And even that is debatable: the Persians were, irl, not very scientific minded, while the Chinese were.

          Maybe some shifting between the Culture things can happen, but I guess this was also thought out with respect to culturally linked starting positions. And the defense of the romans is most likely to get them to build even more legions, removing that would probably mean less attacks (how strange it might sound).

          No, going over the list again, I don't see any need for changes. What should be changed (but I heard this was in the 1.29f patch) that all civs would like building improvements a bit more, which means that civs with production flagged would only build even more then that. I don't know how much of this is true, I have yet to play a 1.29 game into the industrial age...

          DeepO

          Comment


          • #6
            A couple notes:

            Trade = harbors/marketplaces/airports
            Wealth = marketplaces/banks/workers, not just "Wealth"

            Secondly, I would recommend rarely using the Never flags. If you test it a lot and it seems to work, maybe, but otherwise be careful...
            - What's that?
            - It's a cannon fuse.
            - What's it for?
            - It's for my cannon.

            Comment


            • #7
              Thanks for the explanation, Soren. Did the general tendency for building factories went up in the latest patch, or did I dream that on up?

              DeepO

              Comment


              • #8
                Originally posted by Soren Johnson Firaxis
                A couple notes:

                Trade = harbors/marketplaces/airports
                Wealth = marketplaces/banks/workers, not just "Wealth"

                Secondly, I would recommend rarely using the Never flags. If you test it a lot and it seems to work, maybe, but otherwise be careful...
                Thanks for that ... maybe we should put all AI Civs on 'build often' for both Trade AND Wealth then. That should ensure they always have a lot of money, which will hopefully make them stronger.

                We have to be careful not to put too many things on 'build often', though, because it would make very little difference then.
                If I'm posting here then Counterglow must be down.

                Comment


                • #9
                  A question to Soren:

                  In korn's blitz mod, some improvements were added that yielded only culture. The AI's actually chose to build some of them. How did they decide on that? Does every improvement that yields culture fall in the 'culture' category?
                  "As far as general advice on mod-making: Go slow as far as adding new things to the game until you have the basic game all smoothed out ... Make sure the things you change are really imbalances and not just something that doesn't fit with your particular style of play." - WesW

                  Comment


                  • #10
                    Soren, thanks for the clarification. It changes things a lot.

                    DeepO, good comments. I agree that this change is not for everyone.

                    If you like to see the AI build weird things just to give each civ a different flavor and to mirror their historical path, then definitely this change is not for you.

                    But if you prefer that the AI plays more like a human, and thus creates a greater challenge to the human, I think these changes would get you closer to that.

                    On top of that, I would argue that geography is the single largest factor in creating weak and powerful civs. It is very rare to get equal starting positions, so you will always get smaller civs eaten up by larger ones, with the larger ones becoming more powerful. But what if the large powerful civ has dumb build priorities? The answer is that he will be no challenge for the human. Builder and warmonger alike.

                    Making the Zulus start attacking everyone without any infrastructure is cute, but it is also suicide for them. They are like advanced barbarians. They hurt themselves as well as any neighboring, more balanced civs. Eventually the more balanced civ will win and will grow, but the real winner is the human player that stayed out of this mess.

                    As for wealth, you're right (especially after reading Soren's comments). It shouldn't be a build-never item, but it certainly shouldn't be a build-often item either.

                    Comment


                    • #11
                      Make them stronger? But I'm having so much fun beating them up.
                      Don't drink and drive, smoke and fly.
                      Anti-bush and anti-Bush.
                      "Who's your Daddy? You know who your Daddy is, huh?? It's me! Yeah.. I'm your Daddy! Uh-huh! How come I'm your Daddy! 'Coz I did this to your Mama? Yeah, your Mama! Yeah this your Mama! Your Mama! You suck man, but your Mama's sweet! You suck, but your Mama, ohhh... Uh-huh, your Mama! Far out man, you do suck, but not as good as your Mama! So what's it gonna be? Spit or swallow, sissy boy?" - Superfly, joecartoon

                      Comment


                      • #12
                        Interesting ideas, but as Soren shows, setting Wealth to never will ruin the AI even more. But really, I've noticed that I just outproduce the AI after Industrialization, because it doesn't have much factories - very interesting ideas to mess with.
                        Solver, WePlayCiv Co-Administrator
                        Contact: solver-at-weplayciv-dot-com
                        I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                        Comment


                        • #13
                          I agree that geographical reasons have a large impact on how a certain Civ turns out, but my intuition tells me that in order to get killer AIs you will need the diversity on top of a good starting position. Sure, in certain games these two will be countering each other, but I fear that in those games were for instance the Germans get a good starting position, the original .bic will make sure it becomes a killer AI, while your changes will negate it in large as others are able to catch up.

                          This is my biggest concern, not the historical correctness. However, as you said, the Zulus are cute, as you'd expect them to be advanced barbarians There is probably only one chance they have at becoming a late superpower, and that is to be so aggresive in the early game that they outpower the closest neighbours many times. They do build culture and factories, just not as often as the Germans.

                          Certainly, as I don't know the specifics, I can only guess at this... it is a gut feeling at best

                          DeepO

                          Comment


                          • #14
                            Originally posted by lockstep
                            A question to Soren:

                            In korn's blitz mod, some improvements were added that yielded only culture. The AI's actually chose to build some of them. How did they decide on that? Does every improvement that yields culture fall in the 'culture' category?
                            At the beginning of the game, the AI preprocesses every unit/building to put them into multiple categories, such as trade, wealth, and culture. Thus, a cultural bank would be listed as both a cultural and a wealth building.

                            btw, these difference were meant to give the AI's personality... adding to the fun, not the difficulty of the game. If you want to build a killer AI, messing with these figures is probably the best place to start.

                            oh, and the AI does place a higher priority on shield-increasing building (known as factories and power plants to human...)
                            - What's that?
                            - It's a cannon fuse.
                            - What's it for?
                            - It's for my cannon.

                            Comment


                            • #15
                              Thanks Soren

                              DeepO

                              Comment

                              Working...
                              X