Announcement

Collapse
No announcement yet.

Civ III AI - This explains everything (at least to me)

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

  • #31
    Seeing the Civ 3 AI as a good one, I bow to Soren for coding somewhat like that alone... what if they really had a few more months and another AI programmer or two? I guess it would then be even better.

    Good work !
    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


    • #32
      Exactly.

      Let's just hope that they give Soren some help with IV. Just imagine how that game will be. We might be horrified and delighted at the same time seeing paratroopers landing behind our lines taking cities, while marines land from the coast, as we cry to our mommies!

      Comment


      • #33
        Originally posted by Coracle
        The reality is that never in Civ 2 did so many people complain about the cheating AI.
        Hmmm, let's see who complains about the cheating AI. There's Coracle, Coracle and Coracle... who else?

        PS: I forgot Coracle.

        Comment


        • #34
          Trip, I like the notice of being horrified and delighted at the same time ! When I had a small army and saw many many many units come across the border I was very terrified, and very plaesed .
          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


          • #35
            Originally posted by monkeyman
            What I want to know is whether it is possible to use genetic alogorithms to select and adapt the ai to get a better fit to what happens in the course of a game or series of games? That way, if you start playing in a rut, some variability in the ai might crop up and force you to change your play style. This is in effect what Soren is doing iteratively with each patch, but Soren's manual approach is (somewhat) more predictable in its effectiveness (but not necessarily ala communist collapse of ai in 1.17f). I guess this is also what the CTP mod community is doing. Again, could this approach work out of the box?
            I believe it is possible, however, NO WAY IN FOUR MONTHS!!!!

            One process for an adaptive AI is to allow fans to write scripts. The Darwinism that takes place on boards like this would lead to a better AI. Poor scripts would be discarded within hours. Good scripts would be learned from and built upon. Each person's script might have a different "personality." With a rich scripting language and a random selector, you get close to a multiplayer environment in single player. That said, writing a script engine is a huge, big project that might require five times the resources devoted to the Civ III AI, plus a major boost in ongoing support costs.

            A similar methodology is to have a program that generate scripts or make changes in a data file that have a big effect on the AI. Again, this is probably not feasible with the approach taken and the time and budget given. However, if implemented, have a tournament or ranking system with AI's only. This weeds out the weak AI's.

            Again, let me say that Mr. Johnson deserves a big thumbs up for what he has delivered with FOUR MONTHS to code the project and minimal help. My estimate before reading the article, was that he had a year or so to do the coding. (That four months probably felt like a year )

            Comment


            • #36
              Originally posted by BillChin
              One process for an adaptive AI is to allow fans to write scripts. The Darwinism that takes place on boards like this would lead to a better AI. Poor scripts would be discarded within hours. Good scripts would be learned from and built upon. Each person's script might have a different "personality." With a rich scripting language and a random selector, you get close to a multiplayer environment in single player. That said, writing a script engine is a huge, big project that might require five times the resources devoted to the Civ III AI, plus a major boost in ongoing support costs.
              This is an interesting ideat that I had not thought of. The problem, as you mentioned, is designing a scripting language that is powerful enough (yet simple enough, of course) to accomodate all player's creations. This is a monumental task (orders of magnitude more difficult that actually designing the Civ3 AI in the first place). Also, selecting various scripts/personalities at random would in some ways simulate multiplayer, but would not in some ways as well. Humans can adapt to different situations "on the fly". So any scripted AI would suffer from the same problem as the current Civ3 AI: no opportunity for innovation. Finally, considering that Soren is probably a "pretty good" AI programmer, I'm confident that most of the script AI's created by the Civ3 community would have their fair share of weaknesses/stupidities.

              Originally posted by BillChin
              A similar methodology is to have a program that generate scripts or make changes in a data file that have a big effect on the AI. Again, this is probably not feasible with the approach taken and the time and budget given. However, if implemented, have a tournament or ranking system with AI's only. This weeds out the weak AI's.
              "Generating scripts" is no trivial matter. There is a constant trade-off in genetic algorithms with the size of the changes in offspring and the time required to achieve good results: generate "big" changes in the AI, and the system will find some optimal players pretty fast, but they won't be particularly good; generate "small" changes, and the system will find great players in about 2-3 years (or more).


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

              Comment


              • #37
                I for one think the AI in Civ3 is the best i've seen yet, it continues to suprise me and present a challenge. Though it has done some odd things i'll admit, like nuking a size 1 city 8 times, but maybe they just really didn't like the guys in there. The attacks planned by the AI are usually pretty good, just the other day when I dropped 16 units of tanks onto another civs coast and declared war, they used there railroads to destroy every last tank I had, without me even getting to attack one of there citys.

                As for thos who think its "inadaquete", why? Is it because the AI has a few cheats to make it better. None of these cheats are large advantages, and certainly not enough to ruin your fun. Is it because some of the AI behavior can be preditced, and you in turn can exploit it? If thats a problem, why are you whining about the AI cheating when you are too? Really, its easy not to exploit the AI, if you do exploit it your just cheating. And if the AI is so dumb, why do you need to cheat against it to win?
                "Every good communist should know political power grows out of the barrel of a gun." - Mao tse-Tung

                Comment


                • #38
                  Originally posted by Dominae


                  "Generating scripts" is no trivial matter. There is a constant trade-off in genetic algorithms with the size of the changes in offspring and the time required to achieve good results: generate "big" changes in the AI, and the system will find some optimal players pretty fast, but they won't be particularly good; generate "small" changes, and the system will find great players in about 2-3 years (or more).


                  Dominae
                  Dominae, thanks for the answer,

                  So, the question is, is it possible to define AI behaviour effectively as an "energy" landscape? Are the global minima sufficiently different from the local minima to be able to differentiate between the two? If they are different then the random walk process might work...

                  The other process, generating AI scripts and trading them, becomes almost a game in and of itself. Who can build the best AI? So far, only Soren is playing

                  It would be interesting to have a set of 8bit sliders (i.e. 0-255) setting priorities on a gradient for each of the AI levels accessible in the editor. With about 20 different priorities, one would have the opportunity to generate some variable behaviour, probably mostly bad, but who knows?

                  -mm
                  If Bush bought America, why shouldn't he sell Iraq?

                  Comment


                  • #39
                    monkeyman, I think the problem with the entire random walk process, as applied to Civ3, is that the state space (rather, "energy" space) is immense. Just describing the space would be horribly complicated ; searching through the space would be a nightmare. I'm not expert, but I know enough about this (as I'm sure you do too) that Civ3 is too complext a domain to (at present) be profitably applied to Civ3 (here, I use "profitably" in many senses).

                    However, I do like your 8-bit slider idea. The process would basically select the best "priorities" in the editor in order to create the optimal AI configuration. Unfortunately, it would not generate any new behaviour, which is what a lot of people are looking for. You could simulate innovative behaviours by having Soren to code a bunch of different options, and let the process choose the best ones. Not knowing which ones the AI will select would (hopefully) keep us on our toes.

                    Again, you're definitely on to something here.


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

                    Comment


                    • #40
                      It would be interesting to have a set of 8bit sliders (i.e. 0-255) setting priorities on a gradient for each of the AI levels accessible in the editor. With about 20 different priorities, one would have the opportunity to generate some variable behaviour, probably mostly bad, but who knows?
                      -mm
                      I like this idea a lot. This would be a great way to allow players some control without the huge project of a scripting language. There are already some things in the editor like this such as Aggressiveness, and type of units built. With some interesting sliders and a bit of creativeness, this could add a lot to a game.

                      For random behavior, one slider might be a chance that the AI builds more cities. The current AI always expands to available space and many human strategies take advantage of this predictability. By having a slider labeled something like Expansion desire, and also a random setting, a human faces more uncertainty.

                      Another idea for a slider is chance to change other sliders. This could create a play style shift during the game, again making for more uncertainty. For example, an AI slider might indicate Expand to six cities and then slow down greatly, but after 100 turns, the switch flips and they become very aggressive at building settlers and claiming land. In this example, the human may see that the AI only has a few cities and says okay, I'll out build them. Then a few turns later there is a flood of AI settlers and the sure fire human strategy must change.

                      So maybe for each of twenty of so sliders, have a secondary slider of chance to change that slider . Forty sliders isn't bad at all, and would not add much code, and give players a chance to have more fun (which is the whole point of any game).

                      Comment


                      • #41
                        Originally posted by BillChin


                        I like this idea a lot. This would be a great way to allow players some control without the huge project of a scripting language. There are already some things in the editor like this such as Aggressiveness, and type of units built. With some interesting sliders and a bit of creativeness, this could add a lot to a game.

                        For random behavior, one slider might be a chance that the AI builds more cities. The current AI always expands to available space and many human strategies take advantage of this predictability. By having a slider labeled something like Expansion desire, and also a random setting, a human faces more uncertainty.

                        Another idea for a slider is chance to change other sliders. This could create a play style shift during the game, again making for more uncertainty. For example, an AI slider might indicate Expand to six cities and then slow down greatly, but after 100 turns, the switch flips and they become very aggressive at building settlers and claiming land. In this example, the human may see that the AI only has a few cities and says okay, I'll out build them. Then a few turns later there is a flood of AI settlers and the sure fire human strategy must change.

                        So maybe for each of twenty of so sliders, have a secondary slider of chance to change that slider . Forty sliders isn't bad at all, and would not add much code, and give players a chance to have more fun (which is the whole point of any game).
                        Well, I haven't played around with the build orders in the editor much nor the aggressiveness sliders, although I imagine that this alone would produce some variability, unless they are the dropbox type of the "Often, sometimes, never" variety. Even 1..10 would be better than that...IIRC the agressiveness is a 1..5 scale?

                        I for one would like the governor to stop asking to build Privateers and I have seen far too many of those built by the ai...

                        But variability is the spice of gaming when you're talking about AI. And sometimes some really stupid extreme strategy will work if you are in the right place at the right time. Of course variability is more suited to a game with 16 civs than to one with 2. With fewer civs, the more moderate strategies are prob more successful on average game to game.

                        --mm
                        If Bush bought America, why shouldn't he sell Iraq?

                        Comment


                        • #42
                          Originally posted by monkeyman
                          I for one would like the governor to stop asking to build Privateers and I have seen far too many of those built by the ai...
                          It is truly amazing the variety of experience that different players have! I have NEVER seen an AI Privateer.

                          JB

                          Comment


                          • #43
                            Originally posted by BillChin
                            One process for an adaptive AI is to allow fans to write scripts. The Darwinism that takes place on boards like this would lead to a better AI. Poor scripts would be discarded within hours. Good scripts would be learned from and built upon. Each person's script might have a different "personality." With a rich scripting language and a random selector, you get close to a multiplayer environment in single player. That said, writing a script engine is a huge, big project that might require five times the resources devoted to the Civ III AI, plus a major boost in ongoing support costs.
                            I understand this may be asking too much, but can some of you guys who are more familiar with these AI scripts give me an idea of what kinds of things and what the level of detail you would want to see in this scripting language?

                            Comment


                            • #44
                              CTP2 anyone?

                              Comment


                              • #45
                                We've missed you player1.

                                MBD:

                                Here's a start:



                                But you have to check out the other SLIC documents to appreciate it.

                                Comment

                                Working...
                                X