Announcement

Collapse
No announcement yet.

The AI cheats (but please think like a programmer)

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

  • The AI cheats (but please think like a programmer)

    The thread on relocating capitals is becoming an "AI" cheats thread. I'd like to get my favorite opinion in about the AI cheats:

    Unless Microprose creates an open interface so that hundreds of developers can try to improve the AI in their spare time, the AI cannot get much smarter. (Even these efforts may not be worth much.)

    Try to think like a programmer:

    You've been given two months to do some work to make the AI act smarter. Most of the things you might want to do involve collecting a lot of info, doing very complex calculations over time, and then require intense complex testing to see if they really make the AI better or worse. Wouldn't it be simpler to do something that's easy to test, like this:

    If the AI is x far behind, and the human being destroys the last defender of a city, then quick build another defender whether we can afford it or not.

    And now imagine that after a round of product testing, the general opinion is that the AI needs to get just a bit stronger in warfare, playing at deity level. You've got one day to make a testable fix. Well, why not cange the software so that in certain situatios, all AI units get an extra 5% advantage in all combat rounds?

    A lot of time and effort is needed to do good AI, and given the doubtfulness of any payoff, the vendors can't afford it. Only the kind of people who brought us Linux and GNU can afford to do it, if it is possible at all.

    - toby


    ------------------
    toby robison
    criticalpaths@mindspring.com
    toby robison
    criticalpaths@mindspring.com

  • #2
    Your Chevy Nova Explodes when Rear-Ended (but please think like an auto designer)

    The guys who put those gas tanks there had deadlines too... A poorly designed product is a poorly designed product, regardless of deadlines.

    Nope, sorry, I'm going to think like a consumer. A consumer who won't buy the game if, as is likely, the AI is so pathetic the game isn't Fun.

    But you are right about the likely origin of a civ game with good AI, because the regular game companies are making enough money sticking to the same ol' formula. I'd much rather play a game than make a game, its a Lot of work. But the industry has driven me to this sorry state... (not Michigan, making a game )

    ------------------
    Mark Everson
    Project lead for The Clash of Civilizations
    (That means I do the things nobody else wants to do ;-) )
    This Radically different civ game needs your suggestions and/or criticism of our design.
    Check our our Web Site & Forum right here at Apolyton...
    Project Lead for The Clash of Civilizations
    A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
    Check it out at the Clash Web Site and Forum right here at Apolyton!

    Comment


    • #3
      I'll be the first to admit that i'm not a programmer, but isn't there a way to get the AI to learn from the player it's playing against? I know it sounds far out, but let me try and explain...

      Is it not possible for the AI to analyse how it loses? In such a way that it concludes "I lost, why? Outnumbered. Why? i built banks & uni's when he built knights. solution, build improvements later." It can then remember why it lost and write it's own education file, and consult it if it encounters a similar situation?? ok, so maybe that's a little too complex, i don't know!!

      but, it makes me think. Surely the AI is set with parameters for what/when and how to build things right? Such as don't build banks until tax income is 6 or greater, city location analyis? that kind of stuff should be there all ready?!?! So why not get some good players to write a definitive set of parameters for the AI??

      And also, if they can make chess games really hard to beat, why not civ? and in chess the AI doesn't cheat at all!!! I've got chess on my gameboy, and i can't even win on level 3, and there are about 16 settings!??! i know the AI isn't thinking, but it's got a lot of info to work with and civ isn't that complicated is it? there are more diverse areas in civ, but they're still just variables...

      Ok, now i've waffled on a bit, but i've given by two pence's worth!!
      "There are not more than 5 musical notes..." - Sun Tzu
      ...and we build an Academy for this guy... :confused:

      Comment


      • #4
        quote:

        Originally posted by Oldman on 07-21-2000 07:02 AM

        Is it not possible for the AI to analyse how it loses? In such a way that it concludes "I lost, why? Outnumbered. Why? i built banks & uni's when he built knights. solution, build improvements later." It can then remember why it lost and write it's own education file, and consult it if it encounters a similar situation??
        ......
        And also, if they can make chess games really hard to beat, why not civ? and in chess the AI doesn't cheat at all!!! I've got chess on my gameboy, and i can't even win on level 3, and there are about 16 settings!??! i know the AI isn't thinking, but it's got a lot of info to work with and civ isn't that complicated is it? there are more diverse areas in civ, but they're still just variables...



        It sounds so simple....

        Although chess seems much more complex game than Civ, one smart guy developed a nice relatively simple algorithm which allows the computer to play a VERY good chess game.
        Civ is MUCH more complex.
        In chess the main problem is what unit to move and where to move it, together with some long range planning.
        In Civ you can move more than one unit per turn, because of this the computer doesn't need to choose what unit move is better, but here the advantage of Civ ends.
        In Civ you have bigger map, MUCH more complex long range planning (if it exists in the current version beyond the few turn limit), a LOT more possible moves and options which can be done by many different unique units.
        Only the picking of the tech to research is complex no less than a chess games.
        Yes, in civ the computer cheats, but as Tobyr said,"think like a programmer".

        IMHO, there is an algorithm to play a perfect civ game, but it design is extremely difficult, and even if he will be designed, i don't believe that you PC will be able to deal with it.

        BuilderR

        Comment


        • #5
          The chess "problem" is a good one to bring up because it shows how it is still truly difficult to get computers to "think" like humans - which is what we want them to do for AI.

          Modern chess programs are so strong because they can see many many moves into the future. They can still get beat, however, by the top top players under tournament conditions (I am under no illusions that this will remain the case) because they still cannot master elementary plans. Given a position they cannot understand they will shuffle aimlessly.

          Now compare the number of squares on a chessboard and a number of pieces to Civ. Pretty small, huh?

          Now of course the AI doesn't have to actually think - it just needs to look like it does. How should that be done? By programming in elementary tips like "don't attack a well defended site round after round" and so on. For a while this will make things much better but eventually people will find, "Hey - here's something it can't do" and suddenly we'll be waiting for Civ 4 to fix that "stupid AI".

          Comment


          • #6
            Agree.

            BuilderR

            Comment


            • #7
              Chess programs actully use relatively little AI. The program that matched Kasparov uses a neural netowrk to analyze openings and decide what lines to play (to some extent), and the program's "handlers" do not fully understand its opening "theory". But when analyzing positions, the progrsm uses brute force to consider a very large number of future positions and assign scores to these positions. (The scores are not very sophisticated as chess evaluation goes). To play well, the program must analyze forward three to fifteen moves.

              As Builder said, the number of possible moves in one civ turn is much, much, much larger than in chess. In addition, probability has to be considered for a great many of the alternatives. There is no way for a civ2 game to analyze ahead 21 turns (a pitiful three turns by each of seven tribes) to decide what moves might work best, in a reasonable amount of time. One such turn analyzis might take a year on a very fast computer.

              Because so many decisions are involved in each turn, there is also no reasoanable way for an AI to analyze its play and decide what it did wrong, IN GENERAL. So we are stuck with a pretty dumb AI.

              There is, however, a way to try to train the AI to be a little smarter. Suppose that:
              (1) The AI kept track, more or less, of the moves it had made recently.
              (2) A player had the ability to select an AI unit and click the "what a dumb move" button.

              The AI might be able to recognize the same mistake after several repetitions and avoid, say, making the same dumb attack over and over. (But in such a case, a human would be 100 times better than the AI at realizing when the situation ahd changed and the same move was no longer dumb.) And unfortunately, the desire to cheat by telling the AI that a GOOD move was dumb would tempt us, wouldn't it?

              - toby


              ------------------
              toby robison
              criticalpaths@mindspring.com
              toby robison
              criticalpaths@mindspring.com

              Comment


              • #8
                Mark_Everson, you reinforced one of my main points. One patch was released for ToT to correct severe bugs. Similarly, any car that might explode from a rear end collision ought to be "patched". But car manufacturers do not release "patches" to make cars more interesting, becuase the costs of testing, distribution and sales do not justify such upgrades.

                My "think like a programmer" phrase was really unfair, by the way. Any decent programmer in the fix I described would GREATLY desire to add some real AI, but would probably be forced to do otherwise, and really hate not to be able to do better.

                - toby


                ------------------
                toby robison
                criticalpaths@mindspring.com
                toby robison
                criticalpaths@mindspring.com

                Comment


                • #9
                  Tobyr -

                  what about a "recall" on a car? Isn't that basically a patch?

                  ------------------
                  SandMonkey

                  "Shut up brain or I'll stab you with a qtip"
                  -Homer Simpson

                  "Ecky ecky ecky!"
                  "It's just a flesh wound!"
                  - Monty Python and the Holy Grail

                  Check out my 1602 A.D. site

                  Comment


                  • #10
                    I think sometimes people tend to be a little too hard on how bad the AI is in this game. The majority of the people who buy this game probably aren't romping all over the AI at deity level. Most of the people in these discussion groups who are able to easily defeat the AI on deity have probably put a large number of hours into the game. It's pretty difficult to imagine that the programmers could come up with something that could withstand a group of dedicated individuals spending hundreds of hours scrutinizing ways to beat it (just look at how much effort people put in to cheating on their taxes resulting in a more and more complicated tax code - people can be pretty darn resourceful). All things considered I think they did a reasonable job. Yes, the AI does a lot of things that are incredibly stupid. Yes, they should make an effort to improve it. But the fact remains that by the time you've gotten to the level where deity is no longer very interesting, and the scenarios are boring and even the challenges posted here seem simple, you've gotten a hell of a lot of fun out of playing a game that now retails for somewhere around 20 bucks....
                    Novi Nomad

                    Comment


                    • #11
                      AI cheats? I always thought he'd play with honor...

                      I'll go and ask him.

                      Richard!! May I have a word with you?

                      Comment


                      • #12
                        Novi Nomad is right. The AI isn't all that bad. Granted, it is no match for an experienced player. But if you compare it with AI's in other similair games, it is rather competent. I've played plenty of strategy games with dumber AI's.

                        One of the main reasons why it is so difficult to write a competitive AI for a strategy game like Civ, is that the AI must compete against the human player using the same set of rules as the human. In a simulation game like Caesar, the AI merely has to make the job of the human player difficult, by posing some witty obstacles to the human who must then find a way to overcome these. By contrast, in Civ, the AI is cast in the role of a human. It must emulate six humans who perform the same tasks as the human player. Given that it has taken 25 years to write an AI that can beat the best players in chess, a game of far less complexity and for which there has been written a huge literature of strategic theory, I wouldn't put my hopes up on seeing an AI that can compete with experienced human civvers anywhere in the foreseeable future.

                        So, when considering the difficulties of making a good AI that must compete with humans at the very same task that those humans are performing, I'm not against making the life of the AI easier by allowing it to cheat on the rules a bit. And that is from a consumer's point of view.

                        ------------------
                        Hasdrubal's Home.
                        Ceterum censeo Romam esse delendam.
                        Hasdrubal's Home.
                        Ceterum censeo Romam esse delendam.

                        Comment


                        • #13
                          One thing that would help would be if there was more variation from game to game.

                          If I recall correctly a rifleman has 5 attack points and 4 defense points and it is the same every game. This means the human player immediately knows the capabilities of a rifleman and, more importantly, will know how to use one effectively.

                          Suppose at the beginning of the game the computer picked a random number for the attack strength of every rifleman and another random number for the attack strength of every rifleman. Suppose also the human player did not know these numbers. To make up an example suppose the attack number could vary between 4 and 6 while the defense number could vary between 3 and 5. Now the human player has to make a big decision is one rifleman enough to defend a walled city. (This is against the AI) If the defense number is 5, probably; if the defense number is 3, probably not. Until the human player has experience with THIS GAME'S riflemen that player has no way of being sure. On the other hand, the AI players could be given this kind of information.

                          AI attacks are incredibly piecemeal. Why can't you create something like a temporary general? If somehow the AI gets, say, six units out in the field in the same small area then this temporary general controls the units movements. The movements could be coordinated so that you don't end up with stupid things like a stack of units next to a cannon. If the AI wants to move three units next to a cannon put them on three different squares, risk losing one, but then wipe out the cannon on the next move.
                          If you can not think of a good reason to build something other than a caravan, build a caravan!

                          Comment


                          • #14
                            "And unfortunately, the desire to cheat by telling the AI that a GOOD move was dumb would tempt us, wouldn't it?"

                            Don't we have that option already? We can change what the computer wants to research to "0" in the .txt files and watch it never progress beyong the stone age. People who want a challenge will seek them.

                            And I like jpk's solution (not a complete solution, but...). I don't know if a 3 pt. variable is what I want...use a "2" pt. variable and Maniac's x10 system.
                            You can also credit the before-combat knowledge of players given to them, especially in SMAC. Since who would win was not always readily apparent in conflicts (or the degree of victory) disallow odds-generating and the strengths of enemy units/stacks unless successful scouting has been performed- at least make it an option. Also throw in RCE's-Random Combat Events- which may affect any battle by a few % pts. either way.
                            I'm consitently stupid- Japher
                            I think that opinion in the United States is decidedly different from the rest of the world because we have a free press -- by free, I mean a virgorously presented right wing point of view on the air and available to all.- Ned

                            Comment


                            • #15
                              I'm sorry... I have to disagree. The AI is a total idiot. If they at least let it judge the odds before wasting units for centuries attacking a mountain fortress, then maybe it would be ok The AI doesn't do any element of the game well except to cheat
                              Keep on Civin'
                              RIP rah, Tony Bogey & Baron O

                              Comment

                              Working...
                              X