Announcement

Collapse
No announcement yet.

Arguments why its nearly impossible to program an "almost human" AI.

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

  • #31
    Quite an excellent thread. I have a few (well maybe more than a few) thoughts.

    1) As has been stated before, these Civ style games are many orders of magnitude more complex than chess. Any chess like approach to analysis is doomed to failure, even for a computer as powerful as Deep Blue. Consider:

    Chess: 64 squares, 1 terrain type.
    Civ etc.: Thousands of Squares, numerous terrain types.

    Chess: I move, you move.
    Civ: I move possibly 100 (or more) units, you move your numerous units.

    Chess: I move and attack with 100% probability of success.
    Civ: I sometimes have a fractional movement point, and all combat has some chance of failure. Therefore numerous sub-analysis paths must be calculated.

    Chess: Same simple map every game, with only one opponent.
    Civ: Possibly different maps every game, with several opponents.

    And these are only the some of the problems with only one aspect of the game. (Movement and combat)

    Now consider that as simple as chess is, it took a dedicated team of expert programmers years to train a supercomputer to reliably beat an expert chess player.

    This is a problem that not only won't go away, but will get more difficult as player demands for more complexity outpace advances in computers and programming techniques.

    The solution lies in thinking outside of the box. As stated above, the game complexity for the AI must be drastically reduced if it is going to be able to produce a quality opponent for a human. Fortunately, this doesn't have to be as painful as one might imagine. Consider exactly what is being simulated by these 'god' type games:

    An immortal being manages an empire at all levels for all time. Not all that realistic, but loads of fun.

    In reality, President Roosevelt probably had more power in his hands than any human being ever had in history previously. He had speed of light communication, and vast armies armed with the latest weapons. Yet he never had so much power as to be able to dictate even operational details to his commanders. He had to kowtow to MacArthur's strategic vision in the Pacific in order to safeguard his political grip on power. Now imagine the limitations forced upon ancient emporers with shaky internal power structures and speed of horse communications. Or even worse, Monarchs in the middle ages, with numerous scheming and often rebellious 'subordinates'. A vast majority of his time would be spent trying to hold on to his Kingdom, with very little left to improve the infrastructure of his people or for wars outside his borders.

    Thus I suggest that a new model would seek to be more of a simulation and less of a 'god' level excersize. This would simplify the game by turning such things as tactical considerations over to a player's AI generals, while the player himself would be kept busy managing the internal and external political situation. With both the AI and the player at the mercy of the same AI generalship, a huge amount of player advantage would melt away, with no need to endlessly tinker with the AI tactics in order to keep them one level above embarrassing. I for one take very little pleasure in playing a bad wargame against a bad opponent, and would not miss Civ's tactical units on a strategic map style of combat.

    With this major portion of the game now 'hidden' from player control, a much more realistic (and at least for me fun) game can be produced. Realistic movement and supply considerations can be economically introduced with no fear of human abuse. Simultaneous movement can become a reality (not a bad idea in a game where the minimum turn length is a year), and will reduce the enormous advantage given to the attacker when all of his units can expend a year's worth of combat power before the defender can react.

    These reductions in the need for extensive AI programming will enable the design team to concentrate more on the building and management side of the game, which is easier to do, since it is basically the human vs. the management model, rather than the exceedingly complex human generalship vs. AI generalship. Limitations on the size and scope of the player's power are also a good idea. I would use political settings and speed of communication to judge just how large an empire could be and still remain whole over time. Thus an ancient empire with post roads and an efficient bureacracy could become quite large, but could break apart due to external or internal pressures (as stated above) much as Rome etc. did. To sum it up, I would like to do more on the management screen, and less micromanagement on the map.

    Finally, it has been suggested that a record of the game be kept so that the AI can 'learn' from history and improve over time. This is a good idea, but not practical due to the immense complexity of the game as currently configured, and the very limited amount of processing power and memory currently available to the PC. Perhaps it would be wiser to contemplate a larger centralized database (with an appropriately larger computer) to continuously improve the AI. Players could sign up to upload their game data to the host, and in return (perhaps for a small fee) receive the latest version of the AI algorithm. This might well keep the game fresh, and in return would give the designers a reason to continue to support the game.
    [This message has been edited by Sikander (edited July 01, 2000).]
    He's got the Midas touch.
    But he touched it too much!
    Hey Goldmember, Hey Goldmember!

    Comment


    • #32
      I left two weeks for a vacation (far from any PC) and what I find when I come back? Some old "friends":
      1) Downloadable AI pattern
      2) Simultaneous turns

      Thanks!

      I programmed for some years, but only business things, not AI at all, so I don't know exactly how actually AI development works.

      I find very interesting most of the posts here, mainly those about "different approach" to AI behaviour, and I agree that Firaxis should:

      Put "AI templates" in a form that can be imported into CIV III to keep the challenge high.

      Let the game, or an external server (good idea I red here), able to store game history, analyze to a simple level the winning tactics, then export a new "AI template" to share with others players.
      As in some computer chess tournament, putting a good server into crunching some thousand of game confronting different "AI pattern" will help a lot into selecting the "best of breed" to put on Internet, free to download.

      I bet after two/three months of hard core fan games we can get some interesting path to victory to use tuning "AI templates".
      What a "long term game value"!

      Instead, I'm not sure about the idea of put some human game control back to AI: it will level the playfield a bit, but it will raise the frustration of players. I tried SMAC governors in a game, then I was very happy to put the option off: if I was forced to use a bunch of idiot as my governor I probably should have put the whole game in the bin.

      But Simultaneous turns alone is a VERY GOOD leveller: it force the human player to cope with a variable situation, where he/she can't know exactly how the enemy will act THAT SAME turn.

      It's not so bad for an already limited AI player, because a pattern is only a general frame, and the AI navigation/attack decisions are short-sighted and limited by actual game AI development.

      It left the control into the hands of the player, but introducing a bit of "uncertain".

      But Simultaneous turn doesn't gain the attention it deserves (take a look to the EC3 poll), so I know we haven't any chance to see a CIV (put your number here) using it.

      ------------------
      Admiral Naismith AKA mcostant
      "We are reducing all the complexity of billions of people over 6000 years into a Civ box. Let me say: That's not only a PkZip effort....it's a real 'picture to Jpeg heavy loss in translation' kind of thing."
      - Admiral Naismith

      Comment


      • #33
        It is necessarily to store the map as the AI know it between turns. There are two advantages:

        1. If properly programmed this should reduce time required to evaluate a situation. Of course there are many unknowns, that's why this past "experience," stored as a database, is imperative. That's precisely how human would do when facing a new situation: reach back into his memory and pull out similar ones. Now, it is necessarily that such resemblances are fuzzy, not exact. But it beats starting from a blank slate. Having a degree of fuzziness also produces surprise moves on the AI's part, since moves become probablistic and not deterministic.

        2. Again, this prior knowledge helps the AI to make better moves, since it can look deeper, by discarding "hopeless" moves using a pruning algorithm. Certainly this is not perfect and some bad moves are actually brilliant, but we make such mistakes too. It certainly lets the AI to know what combination moves are good, and wastes no time in making them.

        I agree what Brian and company did programming the AI is, well, silly.

        1. They don't know if what they do is the best move for that particular situation.

        2. The AI becomes just a huge IF...THEN loop looking for a set of predetermined moves.

        3. The AI never learns; makes the same mistakes over and over again.
        (\__/) 07/07/1937 - Never forget
        (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
        (")_(") "Starting the fire from within."

        Comment


        • #34
          After taking some time off, I mulled over the issue of AI in civilization-based games. I don't have anything profound to say except I think most of you are setting yourselves up for a significant let-down when Civ3 comes out. Here are some thoughts.

          The AI in complex games such as Civ will NEVER, EVER be as good as an expert human player. The idea of letting the AI take over micromanagement tasks from humans is preposterous. IMO, Civ2 does not involve that much micromanagement as compared to other strategy titles, so why give some of that up when you will likely ALWAYS do a better job (e.g., autosettler, city locations, pathfinding, etc.)? No, I'm expecting that there will be some level 0 changes we can make in order to handicap ourselves when playing against the AI.

          Civ3 will appeal to the masses (in order to sell 500,000+ units) and not just to hard-core strategy gamers who expect Big Blue-type AI. The AI will be programmed (like now) to play at the King level so to give inexperienced players a chance. It will not give Deity players much competition unless there are handicaps. If you want Deity-level competition, play against humans or play a challenging scenario.

          Comment


          • #35
            OK, many of you would probably wouldn't like this cheap suggestion. How about creating a few maps and then telling the AI how to play on it. So the AI has been rigged, really, to know where to build, all the other starting locations, and where to expand to. The script of what to do would be in a accompanying text file, and could apply to any user-designed map. Obviously this system wouldn't work for a random map, and yes I kn ow, playing on the same maps all the time isn't very fun. But heh, I say it was a cheap suggetion...

            ------------------
            No, in Australia we don't live with kangaroos and koalas in our backyards...
            No, in Australia we don't live with kangaroos and koalas in our backyards... Despite any stupid advertisments you may see to the contrary... (And no, koalas don't usually speak!)

            Comment


            • #36
              Actually, for set maps such as Earth, I think that anytime you attack another civ on HIS homeland, he should (in addition to having excellent build orders for his map) get significant combat bonuses reflecting his familiarity with the terrain. Would make for a much more challenging game all around.
              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


              • #37
                Steve Clark,

                That's not a problem. It's not hard to have several levels of AI strength built-in. The selection of AI strength can be tied directly to the difficulty level.
                (\__/) 07/07/1937 - Never forget
                (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                (")_(") "Starting the fire from within."

                Comment


                • #38
                  Quick note RE: Unit Shuffle.

                  To solve the symptom: Unit 'remembers' the squares it's stepped on this move, and will not step on one it's already been in.
                  Note that this can be handled different ways

                  1) If you step on your trail, back up until you can avoid doing so. (classic maze-solving method)

                  2) If you step on your trail, 'snip off' the loop, and continue moving.

                  Both of these have the same potential problems - your unit may just make some huge long wandering pointless dance.

                  The real problem is that it wants to get somewhere it doesn't know how to get to. Pathfinding has always been a problem in games of this ilk, but obviously it's a solvable problem. The 'don't hit the same spot twice' rule can help with this, as it can give the unit a clearer idea of where NOT to go, at least.

                  Basically, a quick "If I end up my turn here, would I be better off (closer to my goal) than I was before?" check would at least inform the unit to just sit tight if it wouldn't be.

                  Still, it's kind of funny to watch them do that anxious little "I wanna get there!" dance. Like a horse running up and down the fenceline.

                  --Stormdancer
                  Graduate of the Origin Training Academy.

                  Comment


                  • #39
                    Interesting Thread,

                    I think it is a good guess to assume That Civ III will have a better AI then Civ II, marginally better.

                    I say that if only 5% (probably 2%) of the efforts that went into programming chess in the last 40 years were put into Civilization we would have an AI that would play at the level of a good human player.

                    Chess is very different compared to a Civilization Game. Chess is above all a tactical game, E. Lasker a former world chanpion use to say that chess is 95% tactics. By tactic we understand the calculation of moves and then counter moves and so on. That's why computers are so strong, the best programs like Deep Blue contain only a fraction of the Strategies that a good amateur player knows but when they play together all that strategy is not of much use if the human player makes only 1, that's right only 1 tactical error. If you were to change the chessboard and make it 16x16 instead of 8x8 and add pieces then Deep Blue would go back to the level of a very mediocre human player and would stay ther until the hardware gets speed up many thousands of times in many years.

                    I would say on the other hand that Civilization is 97% Strategic and only 3% Tactic (my estimate). Probably because unlike chess you are not allowed to play only 1 move but you can play as many as you wish. Think about it, in you're Civ game how much time do you spend managing and how much do you spend on tactic. Even when it comes to tactic if i want to make an invasion with 15 units the terrain is rarely such that i am limiting to moving my units from A to B in 1 specific way and that any other way is catastrophe.

                    On a final note does of you that spent time looking up at CTP'S AI (the fuzzy system is wide open) probably were stunt by one thing: not the limitation of a fuzzy engine use in a game such as CTP but the very ill conceived rules that were feeded to the fuzzy engine by CTP's AI programmers. To their defense they probably didn't do it this way because they were stupid but because doing it this way was simple and they were sure to finish on time for the game's release.

                    What i mean by this way is simply things like poping up the next wonder or improvment to build from a list with little reguard to the game situation, same thing when deciding what to research next, etc. etc. And i am sure Civ II or SMAC isn't better.

                    Sometime in the next couple of years you will see the emergence of a strong AI in a Civ game but it won't come from a commercial cie. it will come from a group of Civs enthousiast.

                    Comment


                    • #40
                      Frappier quote: "I would say on the other hand that Civilization is 97% Strategic and only 3% Tactic (my estimate). Probably because unlike chess you are not allowed to play only 1 move but you can play as many as you wish. Think about it, in you're Civ game how much time do you spend managing and how much do you spend on tactic. Even when it comes to tactic if i want to make an invasion with 15 units the terrain is rarely such that i am limiting to moving my units from A to B in 1 specific way and that any other way is catastrophe".

                      Exactly! my additional comment: I have never won a game over the AI only as a result of clever tactical unit maneuverings. Unlike chess, i doesnt matter that much in Civ if the AI (or the human player) makes some tactically wrong moves with their units. They can always repair such mistakes in the long run (or just reloading a saved game - pathetic and spineless i now, but many of us (including me ) do just that.

                      I have ALWAYS won the games over the AI as a direct result of better logistics (= better resource management plus more effective unit-improvement and city-improvement strategies). Strengthening the AI:s ability to handle the overall strategy LOGISTICS are the key to a better Civ AI.
                      To summarize it: A great AI-civ "should march on its belly" (Napoleon semi-quote)

                      Because only a few procent of the overall game-outcome depends on proper tactical unit-maneuverings, it such a waste of time to continue to post suggestions about more and different units, and how they shall mimic the human player. Civ is a 97% strategic/3% tactical game, so lets concentrate our suggestions how to improve the overall strategic AI-logistics shall we!
                      [This message has been edited by Ralf (edited September 01, 2000).]

                      Comment


                      • #41
                        However, there are ways to supplement real AI programming that w/ scripts which can yield more effective game play from the computer. Certain parameters can trigger the execution of scripts (It appears clear that CTP and CTP2 utilize this to some extent). These scripts are preset procedures for accomplishing specific tasks which take precendence over other AI activities. Such scripts could be used to load up and land full invasion forces, or settle and expand in new territory (one way to program the computer to use ICS). However, the scripts need to be created by experienced, high level players. The problem with most game programmers is that they are to busy programming to be really good players.
                        “It is no use trying to 'see through' first principles. If you see through everything, then everything is transparent. But a wholly transparent world is an invisible world. To 'see through' all things is the same as not to see.”

                        ― C.S. Lewis, The Abolition of Man

                        Comment


                        • #42
                          I basically agree with what you saying in your post, Pchang.

                          However, heres an idea that could help Firaxis get around the whole AI-settler path-finding problem. Im not 100% sure if its doable in practice, but It would be absolutely great if it was.

                          Never mind the title - this post quickly turns into something else further down: http://apolyton.net/forums/Forum6/HTML/002067.html

                          Any comments?
                          [This message has been edited by Ralf (edited January 10, 2001).]

                          Comment


                          • #43
                            My idea for optimal city placement is the following:

                            Default method:
                            Each terrain square has a point value based on its resources.
                            Squares already in a city radius have a value of 0.
                            The city placement value comes from the sum of all the squares in a potential city radius.
                            Computer places city on square with the maximum value.

                            Script method:
                            Some trigger activates a specific script. Examples -
                            survival mode - activates ICS-like settler creation and city creation
                            bottleneck mode - activates city creation on geographical bottleneck for defense
                            etc.
                            “It is no use trying to 'see through' first principles. If you see through everything, then everything is transparent. But a wholly transparent world is an invisible world. To 'see through' all things is the same as not to see.”

                            ― C.S. Lewis, The Abolition of Man

                            Comment


                            • #44
                              If Civ 3 is going to use the same type of units as Civ 1&2 and SMAC, I think one necessary improvement would be to code the AI to use those units to accomplish goals rather than just having them follow their own algorithms.

                              For instance, when trying to conquer a city, the AI should first run a check to see which units are availible for attacking that city. Then the AI should see which one attacker will have the highest power compared to the best defender (after taking movement into account). Then compare the second highest powered unit to the next defender, and so on, until the city is empty and ripe for conquest by the last military unit within reach (preferably a wounded or defensive unit). If the AI units loose too many battles for the AI to be able to conquer the city, it's time to retreat.

                              If the AI doesn't have enough units, or if the present units are too weak to stand a chance, those units should move to a tile with a better defense bonus while waiting for reinforcements. In order to keep units from dancing back and forth (half of the army is heading for the hills to wait for reinforcements while the reinforcements are in the hills), it might be necessary for the AI to take two turns of its own movement into account when determining which units to move to which tile.

                              One pretty smart thing that the AI is already capable of is to have a weak unit taking cover behind a strong unit, such as the barbarian leaders who always hide behind their troops. This is how strong offense/weak defense-units should behave; catapults and cannons should hide behind phalanxs and musketeers. The AI should only allow a unit to move within strike distance of an enemy unit if the enemy won't have enough power to win reliably should it attack. The only exception to this rule would be if the AI had so many units that it can afford to take such losses during an assault on a city, but then the AI should count those units as dead before calculating the final chances of a successful conquest.

                              If the AI isn't building or sending reinforcements, the army should either pillage until destroyed, or retreat if there's a city close enough to make it worth the trip, comparing the loss of upkeep to the value the number of shields the units would give when being recycled.

                              If the army doesn't stand a chance due to city walls or other defense improvements, the AI should send diplomats or spies to sabotage those improvements. In fact, if the AI knows that it has to conquer a city with walls, it should always include enough diplomat units to make it likely that those walls will fall before the army attacks. Because I do that, and usually it's the only way to take a city.

                              The same idea should be used when the AI tries to create a beachhead for an invading army; there's only a point in doing this if the AI can muster enough units to take a city in one turn. Preferably the AI should search for easy targets once the fleet is getting close to the enemy coast, and if none can be found; land the units on terrain with good defense bonus and have them wait for reinforcements. Not to mention that the invasion army should contain enough defensive units to defend a city once it's been taken.

                              Huge armies should also bring settlers/engineers that can build fortresses where the army can defend itself. The AI would be able to tell how long it will take for reinforcements to arrive, and how long it'll take to build a fortress; if there is enough time to build it, it's worth the effort. The AI should never build fortresses in its own territory though, unless it's needed for AI units who are fortified to defend from invaders. In such cases fortresses should be torn down by that unit as it leaves for more important duties. Or, as an alternative, have it automatically torn down a set number of turns after its last defender has left.

                              RGE - if only I found programming to be fun
                              I'm a slacker, hear me snore...

                              Comment


                              • #45
                                Ralf,

                                Eh, I don't think the problem with settlers is the pathfinding. Pathfinding is actually pretty good in Smac, probably a basic A* algorithm. The problem with settling in Civ is that it's done basically at random. The problem with settling Smac is that it isn't. The AI sends pods 30 or 40 tiles to build on a landmark, which is kinda dumb, even with it's native-life combat bonus. And it's entirely the fault of dumb programming, not fundamental AI limitations.

                                Mostly, what needs to be done in CivIII is to fix bone-headed decisions like the above, which are made simply because the programmers are not terribly great strategy gamers.
                                "Wise men make proverbs, but fools repeat them."
                                - Samuel Palmer

                                Comment

                                Working...
                                X