Announcement

Collapse
No announcement yet.

The key to AI greatness, Part II

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

  • The key to AI greatness, Part II

    To quote from alexman's original thread:

    "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. "

    Well, we're still trying to figure build preferences out, but we totally MISSED another important set of options, the AI Civilization Governor, which can effect food, shield, and trade productivity.

    (BTW, note the name "Civilization Governor" and not City Governor. Could that mean something?)

    This is important for several reasons.

    First, we've all noticed what a crap job the AI civs do of irrigating, mining, and clearing their land.

    Second, even so, they generally waaaay over-irrigate, and end up with towns / cities with significant excess food production at 6 and 12 pop, or let population get out ahead of happiness and end up with too many entertainers.

    Third, as related to the above, they clearly aren't optimizing shield production, and thus their build capabilities.

    Here's what we've got so far, starting with the info from Editor Help:
    ________________________________

    Settings (Civilization Governor)

    Selects which aspects of the selected civilization that the AI will proactively manage. Default is to manage citizens and production. The available options and their effects are listed below:

    Manage citizens: The AI will monitor the moods of citizens in a city and attempt to keep its people content

    Manage production: The AI will manage all production in its cities

    Emphasize food: The AI will attempt to maximize food production in all of its cities

    Emphasize shields: The AI will attempt to maximize shield production in all of its cities

    Emphasize trade: The AI will attempt to maximize trade output in all of its cities

    No Wonders: The AI will never build Wonders in any of its cities

    No Small Wonders: The AI will never build Small Wonders in any of its cities

    Be aware that altering these settings can dramatically affect the way that computer-controlled players behave in the game. Unchecking "manage production", for example, will cause computer-controlled civilizations never to produce anything in any of its cities.
    ______________________________

    Note: In stock Civ3, all AI civs are set to manage citizens and production, and nothing else is checked.
    ______________________________

    Next, Killerdaffy ran a quick test:

    In my test scenario (very simple set up, one city for each civ, three settlers, all industrious, all grassland) I got the following results:

    Egypt (Emphasize food) 11, 7, 20 (irrigation, mine, road)
    China (Emph. shields) 9, 9, 19
    America (Emph. trade) 10, 9, 22
    France (baseline) 12, 6, 21

    That's not too compelling so far. The little differences might simply be due to the movement sequence...

    Somebody needs to check this out more thoroughly, I really don't feel like doing this 10 times over right now.
    ______________________________

    Next, I posted a question about this on CFC, and here are some thoughts from Bamspeedy:

    "I don't know how the AI reacts if you select 'emphasize food', or shields for them, but I would imagine it works the same as the governor works for you. But I do know if you don't have 'manage production' for the AI marked, they will never build ANYTHING . And you could check off 'No Wonders' for every civ, and the AI will never build wonders, so you can build every single one of them whenever you feel like it.

    I dont' think selecting 'emphasize food' or production or commerce would directly affect what they build, but probably indirectly, because this may affect how fast they can build stuff or how fast they grow and that may cause other unknown situations (flags) that tells the AI what to build. Kind of hard to explain what I mean, but for example, if a city is growing faster, they will reach size 6 sooner, so the AI may have to build an aqueduct sooner than it normally would, maybe even before a temple."

    And also, in response to this question: "Any thoughts on whether the city governor has any impact on how tiles are 'worked'?"

    "Yes, I'm sure it does. Maybe that is why when the workers are on regular automation they keep changing irrigation to mines and mines to irrigation.

    And could be why AI cities are always way over-irrigated. (too much food, too little shields). Choosing 'emphasize production' might help this out, I'm not sure. Someone would have to test this out."
    ______________________________

    OK, so, the question is how do we test for the best settings to help the AI civs? Should we just set them all to emphasize production?

    Also, how does this vary by civ? Should commercial civs emphasize trade? What about industrious civs? Are there any civs that should specifically be left alone?

    Thoughts?
    The greatest delight for man is to inflict defeat on his enemies, to drive them before him, to see those dear to them with their faces bathed in tears, to bestride their horses, to crush in his arms their daughters and wives.

    Duas uncias in puncta mortalis est.

  • #2
    And, on a separate note (which I'm posting here because the AU Mod thread has been TAKEN OVER by unit and building discussions!), here are some of Bamspeedy's comments on AI build preferences:

    "Build preferences I've noticed a few things. If you have culture marked as build often, they seem to priotize the highest culture buildings available first. I say this because in the mod I'm playing, both the Aztecs and Iroquios (both religious) are building libraries and colleseums (3 cp) before any other buildings that are cheaper to build, but provide less culture. If you set 'build often' for workers, the AI does a little better, because the AI is so incompetent at worker tasks that just having more workers available helps make up for some of this. Setting 'production improvements' as build often seems to have no effect. So they still take forever to build those factories . If you don't select anything at all as 'build often', I have heard the AI produces massive armies, yet little infrastructure. And 'massive armies' I mean HUGE, as in a warmonger's dream."

    Interesting... what does this mean for the settings we currently have in the AU Mod? Any changes re cultural buildings? And should we try a couple of AI civs with only one or two preferences checked?
    The greatest delight for man is to inflict defeat on his enemies, to drive them before him, to see those dear to them with their faces bathed in tears, to bestride their horses, to crush in his arms their daughters and wives.

    Duas uncias in puncta mortalis est.

    Comment


    • #3
      Originally posted by Theseus
      OK, so, the question is how do we test for the best settings to help the AI civs? Should we just set them all to emphasize production?
      Either set them all to emphasize production, or both production AND trade. Since food is over-emphasized anyway, maybe selecting everything EXCEPT food will have a greater effect. OTOH, maybe not!

      Also, how does this vary by civ? Should commercial civs emphasize trade? What about industrious civs? Are there any civs that should specifically be left alone?
      I don't see any reason to give different priorities to different civs except to add personality. Commercial civs have less corruption which affects both shields and trade. Industrious civs just do everything faster: both roads and mines.

      the AU Mod thread has been TAKEN OVER by unit and building discussions!


      what does this mean for the settings we currently have in the AU Mod? Any changes re cultural buildings? And should we try a couple of AI civs with only one or two preferences checked?
      From my experience, the build preferences do not dramatically affect the way the AI behaves. Cost is still the biggest factor (that's why the AI builds factories late).

      I would not remove any non-military build preferences from the AI. It will just allow them to build even more units instead, like the Zulu and the Romans do in the stock version. But that's just IMO. I would love it if someone had time to actually do a systematic test.

      Comment


      • #4
        Or if we could get a little help here!!

        SOOORRREN... OH SOOORRREN??!!
        The greatest delight for man is to inflict defeat on his enemies, to drive them before him, to see those dear to them with their faces bathed in tears, to bestride their horses, to crush in his arms their daughters and wives.

        Duas uncias in puncta mortalis est.

        Comment


        • #5
          I've just run a simple test to check out if "Emphasize Production" affects Worker tile improvement. I believe the answer is yes.

          I put France and Egypt on a Grassland map covered with Rivers. France was unchanged but Egypt had "Emphasize Production" on. By the time all the tiles around the city were worked, Egypt always had more Mines that Irrigation. In fact, in 5 trials the AI Workers always produced the same pattern around the city.

          I'm not sure if this should affect the results, but the civs were "neutered" with respects to building: the only thing they could build was Wealth.


          Dominae
          And her eyes have all the seeming of a demon's that is dreaming...

          Comment


          • #6
            I tried nearly the same thing, alternately with 4 civs and with four of my cities (governor set to emph. production or food). Unfortunately I could not reproduce the results I got the first time when accounting for bonus grasslands (on only normal grassland the governor refused to irrigate at all?!?). It gets even more confused once you add other terrain types / resources.

            Comment


            • #7
              I think it's going to be a no-brainer to turn on emphasize production for all AI civs, although our first experiments should probably have a control group.

              I'd like to at least TRY emphasize production on a weak commercial civ... how about England and / or Rome?

              As to the build preference thing, I'm really intrigued by Bamspeedy's comments about *reducing* the number of build preferences to get a larger AI military. Let me ask this: Are there any AI civs that typically do well in terms of expansion and building, but are usually woefully weak? We'd have to address the AI's flaws at upgrading too... Who does NOT send in SoDs?
              The greatest delight for man is to inflict defeat on his enemies, to drive them before him, to see those dear to them with their faces bathed in tears, to bestride their horses, to crush in his arms their daughters and wives.

              Duas uncias in puncta mortalis est.

              Comment


              • #8
                Killerdaffy, I read the post where you described your test. I was trying to do a simpler version of the same thing. I eliminated all bonus grassland tiles from around the starting positions; all they could improve was plain Grassland. With this setup, the maximize production civ always built 2 more Mines than the control civ. I don't know if this has to do with the total number of Shields the Governor wants to be producing, or is simply a "build" Worker script (both are obviously related). So, it would seem setting all the civs to maximize production would be a good thing, since they don't appear to do anything stupid like stop growing at size 4 or build no roads.

                Theseus, in my games Greece and America are usually pretty weak militarily early on. Also, I think we should focus on the Zulus for the upgrade problem, since they always stay in the Dark ages when it comes to troops.


                Dominae
                And her eyes have all the seeming of a demon's that is dreaming...

                Comment


                • #9
                  I do have one possible concern about having the AI maximize production: How will that affect expansion in the early game? Normally, the ideal pattern is to focus on food early while you're trying to build new cities and then grow existing ones, and then shift the focus to production once cities are as big as you want them. So it's going to be important to make sure that production-oriented settings don't slow down the AI's start too much. Still, even if my concerns have some validity, settings that are better for production as the game goes on might make up for a slower start. (Then again, a slower start might get the AI stomped by a nearby human before it gets a chance to make use of its long-term advantages.)

                  Nathan

                  Comment


                  • #10
                    Dominae, you make a good point... early versus midgame military strength. Early: I wouldn't worry about Greece to much, due to Hoplites. America definitely needs help. Mid: Zulu have an gold / upgrade problem. I'll think about the rest.

                    Nathan, I've got a gut response here... I think that no matter how much we try to increase AI shield production, the core algorithims will *mostly* still provide for enough food (more than enough), especially in the early game. I also question the entire premise of early expansion (REXing) that is at the heart of the AI strategy, not to mention that of most human players; more to come on that as I develop the theory...

                    (I'm dying for Soren et al to jump in here, but I want to reiterate my TOTAL admiration for Firaxis' accomplishments; yeah, we are trying to create tougher AI opponents, but given the complexity, all the factors that have to be balanced... WOW!)

                    (And to any Coraclites that might want to attack... yeah, no doubt, the programming is not as good as a human, but I'm still wildly impressed)

                    Last parenthetical:

                    (The above was not meant to overly compliment anyone from Firaxis... I really mean it... but if in a blush of authorly satisfaction you deign to reach down and CLARIFY some things... uh, er, we'd appreciate it)
                    The greatest delight for man is to inflict defeat on his enemies, to drive them before him, to see those dear to them with their faces bathed in tears, to bestride their horses, to crush in his arms their daughters and wives.

                    Duas uncias in puncta mortalis est.

                    Comment


                    • #11
                      Originally posted by Theseus
                      I've got a gut response here... I think that no matter how much we try to increase AI shield production, the core algorithims will *mostly* still provide for enough food (more than enough), especially in the early game.
                      I think this is correct. It's probably something like: "I need to get at least x Food and y Shields. Anything else I'll try to optimize according to what my priorities are (they default at none). If I'm told to focus on production, I'll (on average) build more Mines that I usually would, but not overly so".

                      (And no, I don't think AIs think to themselves in this way... )


                      Dominae
                      And her eyes have all the seeming of a demon's that is dreaming...

                      Comment


                      • #12
                        I've been doing some fiddling along these lines too... my main interest was trying to get the AI to use artillery properly, but regrettably, the final result seemed to be that somewhere in the AI procedures there's a big flag that says DO NOT EVER CONSIDER ACTUALLY BOMBARDING LAND UNITS, EVER, EVEN IF THE FATE OF THE ENTIRE UNIVERSE SHOULD DEPEND ON SUCCESSFUL APPLICATION OF ARTILLERY FOR LAND WARFARE. But I digress.

                        Anyways, any thoughts on Wealth? On the one hand, the AI often runs into financial difficulties on its own and thus can really use all the money it can get. On the other hand, maybe it wouldn't have money difficulty if it actually built useful stuff to begin with.

                        Comment


                        • #13
                          Originally posted by Theseus
                          I also question the entire premise of early expansion (REXing) that is at the heart of the AI strategy, not to mention that of most human players; more to come on that as I develop the theory...
                          I'll be interested to see your theory, but I'm skeptical. The reason I regard early expansion as very important is that there's lots of stuff to build in each city and only so much they can build each turn. The later a city gets started, the later it can start building all its improvements, and the fewer improvements it will have at any given time. (That's also why I hate diverting production for military purposes early in the game.) Of course I will grant that the AI tends to go overboard in trying to grab any conceivable piece of territory even when corruption makes it essentially worthless, but the fact that REXing can be overdone doesn't mean it isn't important.

                          Nathan

                          Comment


                          • #14
                            Originally posted by nbarclay
                            I'll be interested to see your theory, but I'm skeptical. The reason I regard early expansion as very important is that there's lots of stuff to build in each city and only so much they can build each turn. The later a city gets started, the later it can start building all its improvements, and the fewer improvements it will have at any given time. (That's also why I hate diverting production for military purposes early in the game.) Of course I will grant that the AI tends to go overboard in trying to grab any conceivable piece of territory even when corruption makes it essentially worthless, but the fact that REXing can be overdone doesn't mean it isn't important.
                            Nathan
                            The fact that in my tests (25-tile islands) the AI still built settlers despite being literally millenia from any ship technology leads me to suspect that REXing is very deeply ingrained in the AI core. Also, at least on the higher difficulty levels (i.e. Deity) all the human player can do is watch and wait for his time, since the early AI REX in INSANE (ok, they start out with two settlers). It would be a welcome change if the game was harder later on, instead of making every effort to build you into the ground by 2000BC.

                            Comment


                            • #15
                              Nathan,

                              Theseus (and I) came to a realization, as warmongers, that it benifits the human to stop REXing after building a productive core of cities and start building units. The AI will remain in REX mode while you build a massive army. The attack you unleash will capture some cities, raze others, and cripple the opposition. You can backfill later.

                              -Arrian
                              grog want tank...Grog Want Tank... GROG WANT TANK!

                              The trick isn't to break some eggs to make an omelette, it's convincing the eggs to break themselves in order to aspire to omelettehood.

                              Comment

                              Working...
                              X