Announcement

Collapse
No announcement yet.

Understanding Firaxis's programmers.

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

  • Understanding Firaxis's programmers.

    Posted by Nathan on another forum and I re-used it to make a point

    As a programmer who has taken a couple classes in artificial intelligence (although my real work is in other areas), I can sympathize with Firaxis's AI design problems. Civ 3 is a complex game. How complex? Compare it with chess, which itself was a tough nut for AI design teams to crack.

    In chess, there are 64 spaces on the board. In Civ 3, there can be thousands. In chess, there are six different types of pieces. In Civ 3, there are dozens of different types of units. In chess, each side makes one move at a time. In Civ 3, there can be a dozen or even several dozen choices in a given turn. In chess, the position after each move can be known in advance. In Civ 3, each individual attack has two possible winners and several possibilities for how badly damaged the winning unit will be. And in chess, players can see the whole board at once. In Civ 3, at least in the rules the human player is bound by, much remains hidden.

    Further, a game like Civ 3 has a huge "rock, scissors, paper" element in which a strategy that works great against an opponent who plays one way can be awful if the other side makes different choices. I've fought wars where practically my entire army was on the front lines, sometimes leaving virtually nothing on my home island or continent. If the AI played that way and I figured it out, I could take advantage with a naval invasion before an AI knew what hit it while one AI's troops were away fighting another. We as human beings can figure out the AI’s strategies and adapt, but the AI has to stick largely to strategies that will work reasonably well against a wide range of possible opponents.

    Someone (I'm not sure whether it was here or somewhere else) brought up the idea of using something along the lines of genetic algorithms to help the AI adapt. But while genetic algorithms might be useful in refining basic strategies, they lack the "big picture" analysis capability of the human mind. Someone has to come up with the root strategies, and has to code those strategies in such a way that the AI can make use of them (probably losing something in the translation).

    Here's a challenge for anyone who wants to call Firaxis's AI designers less than competent. Come up with a rule set that defines your strategy, and try playing a few games where you're only allowed to do things that follow that rule set. NO EXCEPTIONS, EVER. Make sure your rule set can handle both good and bad starting positions on a variety of map types. And if you succeed at that, look for ways you could beat your strategy if an AI adopted it.

    And if you succeed at that, ask yourself whether human players would get mad at the game if the AI followed your strategy. If you have to engage in dirty tricks that lots of human players would object to having AIs use against them, you don't have a viable core for an AI design. After all, the ultimate goal is to sell games, not to have the AI win them. (On Deity, AIs could mop the floor with a human player just by engaging in an all-out war early on, but how many players would put up with the AI using its advantages that way?)

    If you can get past that last test too, you probably ought to ask Firaxis for a job. Otherwise, you're asking Firaxis to do something you have no particular reason to believe is possible.

    I do think subtlety is important in designing an AI's advantages. The AI's advantages need to feel "honest" to the player rather than like "cheating" - sort of like when my father used to spot me a piece in chess when I was a kid to make our games relatively even. The real problems seem to come when the AI's "cheating" digs into the realism too much - ridiculously lopsided valuing of potential trades, or getting techs ridiculously quickly, for example. But the idea of an AI trying to take on a top human player without significant advantages is all but unthinkable.

    One last thing: more powerful computers can only do so much. Double the power of the computer and you won't even have the computer able to look one turn farther ahead unless it dismisses an awful lot of possibilities without even considering them. (In practice, the computer will look more than one turn farther ahead along the paths it considers important while not looking any farther ahead at all along paths it considers less unimportant.) In a game as complex as Civ 3, AIs HAVE to rely first and foremost on core strategies provided by human beings and only secondarily on lookahead-based analyses that can be improved (if not necessarily a whole lot) by adding processing power.

    I very much hope Firaxis keeps working to improve the Civ 3 AI. But anyone who expects an AI that can even stay within shouting distance of a top human player in a game as complex as Civ 3 without a lot of advantages is being unrealistic.

    Nathan
    -Never argue with an idiot; He will bring you down to his level and beat you with experience.

  • #2
    int main()
    {

    //Insert Civ stuff here

    return (1/0); //We want to crash the program
    }



    Hehe, actualy I agree. It hard enough trying to make a pathfinding AI. So far, the only AI i've seen in detail is the AI used in AL|ENS v. Predator. Lots of Structs and #define statements.
    I drink to one other, and may that other be he, to drink to another, and may that other be me!

    Comment


    • #3
      Originally posted by Thrawn05
      int main()
      {

      //Insert Civ stuff here

      return (1/0); //We want to crash the program
      }


      Spec.
      -Never argue with an idiot; He will bring you down to his level and beat you with experience.

      Comment


      • #4
        A good point and a valid argument against those who keep bashing how the AI plays without bothering to give any concrete examples of what they'd do better. They've put out a very good product here and programming AI is a tough thing to do, especially if you want to have a complex game that handles a variety of instances.

        On a side note, I'd like to add that the AI sucks and the people at Firaxis can't program worth a damn.
        petey

        -When in doubt attack. When not in doubt, attack anyways - it's more fun

        Comment


        • #5
          it appears as if firaxis adopted this diety code:

          int main()
          {

          char outcome[20];

          moverandomly();

          outcome = talktohuman();

          if (outcome == "war")
          {
          cheat();
          attack();
          }
          else
          {
          cheat();
          moveunits(humanterritory);
          attackanyway();
          }
          return(0);
          }
          "I've lived too long with pain. I won't know who I am without it. We have to leave this place, I am almost happy here."
          - Ender, from Ender's Game by Orson Scott Card

          Comment


          • #6
            Great post. However, this is exactly why everyone wants Multi-player!
            Brother Locus of the Peacekeepers

            Comment


            • #7
              exactly.

              any AI short of the matrix will fall before a good human contender... and perhaps even that would crumble.
              "I've lived too long with pain. I won't know who I am without it. We have to leave this place, I am almost happy here."
              - Ender, from Ender's Game by Orson Scott Card

              Comment


              • #8
                Originally posted by Locus
                Great post. However, this is exactly why everyone wants Multi-player!

                int main()
                {
                unsigned short Players[16];
                PlayerTurn();
                if (PlayerTurn(True))
                {
                LagCode();
                }
                else
                {
                MoreLagCode();
                }

                If(Player == Ming)
                {
                GodCode();
                }
                else
                {
                TankKillerSpearmen();
                }

                return 0;
                }
                I drink to one other, and may that other be he, to drink to another, and may that other be me!

                Comment


                • #9
                  Imagine marathon weekend Civ tournaments with 16 players on a huge map!!!
                  Brother Locus of the Peacekeepers

                  Comment


                  • #10
                    The AI seems to be better than Civ 2, but I'm not so sure. It's been discussed before how the game rules were altered in dozens of ways to make the AI appear smarter. If they couldn't figure out how to make the AI play smartly by the rules, they just changed the rules. Please note that this will diminish the MP experience, if MP is ever finished. I like how they don't automatically gang up on you if you're ahead or behind, but that's about the only nice thing I can say.

                    There are some very silly things the AI does that really makes it look dumber than it actually is. The AI will build a Forbidden Palace in its capital city. It will start building a wonder in a city that is under seige. It will send 30 workers to mine a mountain that is in its cultural borders but not in any of its city borders in the same turn. I've seen these things happen. I'm not a coder, but I imagine such checks would be fairly trivial to implement.

                    Comment


                    • #11
                      The hell with Firaxis' programmers.

                      Everyone knows that Civ 2's AI made more sense than the AI of Civ 3. And we've all played both games enough to know that.

                      It should not take a genius programmer to know that when your civ is being seriously invaded you do NOT start a Happiness Wonder. Nor when you are at war and one of your cities was razed by the invader do you send a settler/pikeman combo wandering towards the open tiles right past twenty enemy knights. And so much more that shows me nothing other than SLOPPY RUSHED PROGRAMMING.

                      Comment


                      • #12
                        Originally posted by Locus
                        Great post. However, this is exactly why everyone wants Multi-player!
                        I don't want multiplayer. I'll let you know when I want to proxy my opinions to be included with "everyone" so as to make that an accurate statement.

                        Comment


                        • #13
                          Originally posted by Coracle
                          The hell with Firaxis' programmers.

                          Everyone knows that Civ 2's AI made more sense than the AI of Civ 3. And we've all played both games enough to know that.

                          It should not take a genius programmer to know that when your civ is being seriously invaded you do NOT start a Happiness Wonder. Nor when you are at war and one of your cities was razed by the invader do you send a settler/pikeman combo wandering towards the open tiles right past twenty enemy knights. And so much more that shows me nothing other than SLOPPY RUSHED PROGRAMMING.
                          I agree with you that the AI can do some strange things at inopportune times.

                          Perhaps I played a Civ2 that was different than the one you played. In the Civ2 that I played, I found that, among other things, the AI could not use caravans or spies effectively, at least no where near what a human could, would send slow streams of units that I could take apart piece by piece, never seriously threatening me and I could go on and on.

                          Sure, the AI in civ3 does some odd things, but really, I can't begin to compare the abiliity of the AI to that of Civ2. The challenge is much greater for me now. No more invincible howitzer rushes at the end, thank god.

                          If you have such a problem with Civ3 maybe you should just get over it, its been out over 5 months now. I have felt disappointed in games before, myself, but really, let it go man, let it go, enjoy life.

                          Comment


                          • #14
                            Originally posted by Coracle
                            And we've all played both games enough to know that.
                            All? I got my start in Civ games with the original Call to Power shortly after it came out. I bought the "Test of Time" edition of Civ 2 but never got around to installing it because the idea of having to worry about mess like which unit is supported by which town seemed like it would be more hassle than I was in a mood for. Maybe someday I'll get around to trying it out, but it's hard to imagine giving up the things that were done RIGHT in Civ 3.

                            Nathan

                            Comment


                            • #15
                              Originally posted by nbarclay


                              All? I got my start in Civ games with the original Call to Power shortly after it came out. I bought the "Test of Time" edition of Civ 2 but never got around to installing it because the idea of having to worry about mess like which unit is supported by which town seemed like it would be more hassle than I was in a mood for. Maybe someday I'll get around to trying it out, but it's hard to imagine giving up the things that were done RIGHT in Civ 3.

                              Nathan
                              Hey Nathan, I hope you dont mind I used your post from Civgame, I thought it was really good and that I could use it here to make my point.

                              Again thanks.

                              Spec.
                              -Never argue with an idiot; He will bring you down to his level and beat you with experience.

                              Comment

                              Working...
                              X