Announcement

Collapse
No announcement yet.

Ai

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

  • Ai

    I've played a lot of computer games.....I mean a LOT of computer games.

    One of the very BEST wargame AI's I've ever come across was in an old SSI title "The Battle of Gettysburg." (CGA graphics, if that tells you anything of the overall LOOK of the game). It was....uncanny. I swear it *learned* my playing style. I felt it much the way the hairs on the back of your neck stand on end when you feel like you're being watched.

    The first few games were easy to beat. I really didn't know what I was doing as the dauntless Confeds....only that I wanted the high ground Lee should have had his generals beeline for on day one.

    Those first games were horribly bloody affairs, with me stoically defending the high ground, and the AI sending mass waves of blue-clad bodies to try and break me down.

    Later, I got sneaky.

    I still made for the high ground, sure, BUT I started setting brigades up with limited artillery support on nearby ridgelines with an eye toward ambushing the Union soldiers as they advanced toward the main portion of the battle, and then executing a series of fighting withdraws back to my main, heavily fortified positions.

    That's when the AI started ambushing me back.

    The first time I stumbled into one, I swear my jaw hit the table.

    Using its numerical superiority, the AI from this piddly, OLD computer program from years ago had the good sense to outflank my force that was doing the fighting withdrawl, and set up an ambush *just like it had seen me do*

    Soon, the game degenerated into a series of cat and mouse ploys, where the hunter very often became the hunted as my forces tried to thread their way back to my main battlegroup.

    And the AI continued to learn from me. Every time I would try something new and different....EVERY time it worked, the AI would soon adopt the behavior.

    It was one of the best war games I've ever played because of that.

    My thinking is, KNOWING that it's possible....having played that, and other games where the AI could adopt winning strategies "on the fly" ....I'm wondering what the problem is?

    Soren's AI kicks a$$! Witness the number of people, GOOD Civ2 and SMAC players who started out on Monarch and reported that ummm...they had to tone it down to Regent or Chieftan for the first couple of games.

    But it's not adaptave. It doesn't learn by watching, or from its own mistakes. Of course, we're a long way from *actually* making a learning AI....I know that. But there have been some damn fine attempts made at simulating that....almost spooky attempts, actually.

    I've also played a handful of games where the AI action was controlled by a series of script files, such that it could be Modded by the fans. Someone would create a ruthless KILLER AI routine, and the players would all be scrambling to meet the new threat.

    Eventually, of course, some weakness...some means of handling the new AI would be found, but with the fan base constantly making new configurations available, there was always some new threat on the horizon.

    Why can't we do that here? (I mean, why was this not built into Civ3? If the plan is to make a highly moddable game, surely one of the hallmarks of infinite replayability is an AI that can be tweaked, edited, and sometimes radically changed, yes?)

    Moddable AI. In the hands of the fan base. What an adventure that would make a game like civ3....

    -=Vel=-
    The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

  • #2
    It's difficult to know what you actually experienced through this mediate epistemology, but my WAG at this point is a series of coincidences. No one has yet figured out a way to make computers see "over the horizon". What they cannot evaluate by means of some predefined coda, they cannot do. In fact, they cannot even consider. Because they don't "know" it's there.

    It is possible to emulate learning in a primitive sense by abstracting the code as much as possible, and then relying on dynamic data objects to dump appropriate values at appropriate times, causing a shift in branching. BUT, computers are notoriously weak at going the other way around (the way humans learn), i.e., by recognizing patterns in concrete behavior and then extrapolating analytical abstractions.

    They just don't know what patterns mean.

    True learning requires a context — or frame of reference — from which meaningful inferences can be drawn. The computer's only frame of reference is its program. And its program is a static entity.

    I once toyed with the idea of writing a dynamic language; i.e., one that modifies its own instruction set in accordance with its own experience. It had my interest for a while, but then life happened and I had to move on to other things. I still think that that's the way to go for simulation of learning because it simulates experience, the sole context by which learning can manifest.
    "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

    Comment


    • #3
      You could define different sets of strategies and have to computer record the results of each one. Then after a significant number of games or sessions the computer could start picking strategies off the "top of the list". This is not a true learning AI but can produce semi-realistic results. It is also not adaptive but more branching.

      The problem with making a learning AI that responds to human players is that it has no way to account for the most human of traits, unpredictability. Humans would quickly learn that this is their best way to win.
      Sorry....nothing to say!

      Comment


      • #4
        More Questions....

        'k....let's say we're starting from the ground floor.

        Let's say (hypothetically, of course!) that I decide...."What the Hell?" and start up a little bootstrap company intent on designing computer games....flying in the face of all logic and standing shoulder to shoulder with the Goliaths of the Industry.

        The first thing I'd be interested in is AI code.

        And, starting from the ground up, no limits but our collective imaginations, here's the beginnings of what I envision:

        1) Create an AI that "sees itself" as a virus. It has two basic functions. Spread. Survive.

        2) Introduce and describe the game world in terms of the two above functions. Every element (in Civ terms, this would be units, other civs, terrain tiles, government types, technology, culture, etc.) is seen as either a help, hinder, or be "neutral" to the AI's spreading and survival (specifically, other AI civs would be seen as "neutral" at game start, while the human player would be seen as a hinderance). Things that are seen as a hinderance make the AI go into aggressive mode, while things that help make the AI go into spread mode (with more elaboration later).

        3) Moddability. The AI should be created such that the priorities places on the different aspects of the game world can be re-organized by players (creating an AI whose primary means of spreading is cultural strength, and whose primary means of survival is rampant growth, coupled with strong defensive units....creating anothe AI model whose only goal is to maximize productive output, standardize growth rates, and make the most lethal collection of military units possible to hunt the nearest rival to extinction....etc).

        4) "Teach" the AI a number of basic battle strategies, and teach it how to assess enemy strength. (this can be done by assigning values to every unit in the game, and having the AI arrive at a sum total....the trick tho, is in determining relative values....how much is a library worth, vs. a swordsmen, in terms of evaluating an enemy's strength?...that sort of thing). Teach the AI how to execute a flanking move. How to ambush. How to overrun (or underrun). Armed with a viable strength assessment forumla, and with basic strats and how to use them, the AI on the battlefield should be decent. (actually, there'd have to be two forumlas in play here....a "top level" formula for determing overall relative strength - taking stuff like libraries into account, and a "warfare only" formula, which focused only on collections of military units for determining the viability of getting into a fight with a rival army)

        So....my question is:
        Would such an AI be possible? (we'll worry about what game it is associated with later....for the moment though, let's take a specific game out of the equation and just focus on the AI's "viral" tendencies....is it a doable thing?

        -=Vel=-
        The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

        Comment


        • #5
          Frankly i think that within the limited scope of a game, a learning AI can be fairly easily implemented. Let it know what to watch the human player do and give it a ranking system to analyse the players action (ranging from "works every time" to "dismal strategy"). Obviously this would need to be fine-tuned considerably but I think its possible.

          Why isn't it implemented in current day games? I think it's mainly because of processing limitations. In order for an AI to analyse a players actions it needs to be constantly doing calculations and monitoring (for eg, is the player actually planning a strategy or is he just goofing around toying with his empire?) which takes up a considerable portion of system resources. This takes away from and degrades all the nice graphics, animations, and sound we expect in current day games, which obviously is a nono since how would a developer pitch a game to a publisher with archaic graphics?

          It would be nice if games came with the option of reducing the amount of graphic detail on the screen in favor of a better AI. That way games would satisy both sides of the gamers spectrum. But that's just wishful thinking

          But there's hope The way the CPU speeds are increasing I'd say we'll probably see smart games emerging in the near future!

          Comment


          • #6
            Would such an AI be possible?
            In essence, yes. So long as you clearly define the two main objectives (spread and survive) in evaluatable terms, you can write a program that will spread and survive in as perfect and efficient a way as is possible. 'Course, that's less like artificial intelligence, and more like artificial instinct. All in all, I'd say it's doable.

            The way the CPU speeds are increasing I'd say we'll probably see smart games emerging in the near future!
            Brute force evaluation is not equivalent to intelligence. No matter how fast the CPU, it still can't see over the horizon.
            "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

            Comment


            • #7
              Vel,

              you might not be the greatest SMAC player ever, but few people probably understand the game as well as you do.

              So in your opinion, what would the chances of winning be under the following conditions?

              Your faction is either Gaians or Cult of Planet. Difficulty is Transcend, the world standard size and set on max fungus. In your opinion would it be possible to not found a base, but instead use your starting troops to capture enough worms to take over a base, then you go on to win a one city zero facility Transcend win?

              If that is the case, then just think how far we have came in terms of AI from SMAC to civ3!

              as to your question

              Would such an AI be possible? (we'll worry about what game it is associated with later....for the moment though, let's take a specific game out of the equation and just focus on the AI's "viral" tendencies....is it a doable thing
              ys i think it would be possible, also i would offer up the following bit of advice

              in civ games, the AI apparently only takes in its overall strength into account (which is usally inflated, they need a better strength formula) and ignores local situations for the most part. This allows a player with a vastly smaller army that has high mobility and firepower than the AI to always achieve local superiority. The Ai should divide the world up into subunits and then compare its relative forces in each region, so it would be harder for the player to always achieve local superiority, and it would allow the AI to maybe even surprise the player once in a while by achieving local superiority itself.

              Comment


              • #8
                We've had some interesting insights on AI with the Civ3 discussions. I think I've learned more about the Civ3 AI with Analyst Redux's deconstruction (his was one of those posts that makes me add a layer of modesty to my thinking...).

                I have NO programming experience but...
                Why can't an AI recognize certain human strategies and have foils for them? Since a great deal of what we humans do is actually predictable, shouldn't programmers think of ways to deal with those issues?

                For instance, shouldn't the computer recognize a military buildup by a neighbor and understand that it ought to be building some forts and some cavalry, etc. But if the considerations so taken become unnecessary, I would want the AI to be able to "stand down" by disbanding units that are counterproductive to its economy, or upgrading, or, starting a war with a power that it can achieve victory against.

                As I read strategies, what comes to mind is that the human goes through phases, knowing how to move from one style of play to another. The styles are remarkably similar, however, from person to person. Can't we incorporate counter-styles into the AI, and, more problematically, can't you design a weighted system by which the computer examines which style the human is engaged in so as to implement the proper foil? In my non-programmer's mind, you would want to have counter-strategies to pursue, and a queue of other counter strategies to prepare for. Maybe the computing power just isn't there yet.

                I think FPS games have come a long way in that regard, the better ones, at least. The coordination of the half-life AI was something to behold, and in the new X-Box game, Halo, I think you really have good evidence that there are a lot of if/then strategy options available to the AI units. Maybe it's tons simpler in a FPS game, though (I would imagine so, less variables in the kill or be killed framework of decision making, and no long-term implications).

                Now, on another note about the AI.
                One of the most disappointing aspects of the Civ3 AI is its lack of understanding of combined arms. To watch the AI waste its navy bombarding coastal land squares is depressing. Moreso with bombers. The computer seems to have no concept of economy of force, force protection, and force multiplication. It cannot take advantage of bombard options - why?

                I always figured that there ought to be a way to program an economic value into fighting decisions so that the computer would recognize attrition consequences. If the computer can recognize probabilities built into the combat calculations, and can recognize cost benefits destroying an infantry unit in a context of the likelihood of success versus the cost detriment of losing a tank, can't it make better decisions.

                If the computer can attack your town with infantry, tanks, howitzers, and bombers, shouldn't the programmer incorporate a prioritization scheme where the computer would bombard first, then decide based on plausibility of victory whether the tank should attack or the entire effort should wait for another turn of bombardment? And if you can do that, can't you also program another level of decision making where, if the tanks fail, but the likelihood of the infantry still taking the city remains likely, it could pursue that or decide to wait again?

                You may say I'm a dreamer
                But I'm not the only one...

                Okay, I swear that's the first time I entered a John Lennon quote, and frankly, I feel a bit dirty for having stolen from him.
                I long to accomplish a great and noble task, but it is my chief duty to accomplish small tasks as if they were great and noble. - Helen Keller

                Comment


                • #9
                  Why can't an AI recognize certain human strategies and have foils for them?
                  It can — so long as those strategies have been predefined for it in such a way that it can evaluate them against a known template. That's what we mean by seeing over the horizon. The computer can't take meaning from events or behavior.

                  Think of it this way: all a computer does is route current through gates. And when it comes to the program itself, only one pulse can go through at a time. That's von Neumann's principle. There's no way around it.

                  That's why, until Big Blue became capable of brute force analysis that outweighed human strategic planning and tactical execution, the first thing grandmasters did was make a non-book move as soon as possible. Instantly, the computers would begin to grind and grind, with the horizon way out of sight.

                  And remember that the definition you give the computer of a human strategy is rendered moot by the slightest variance on the part of the human. Computers are incredibly stupid.

                  That reminds me of my favorite quote about computers by, of all people, Pablo Picasso: "Computers are useless; they give you only answers."
                  "Entia non sunt multiplicanda praeter necessitatum." — William of Ockham

                  Comment


                  • #10
                    The computer can't take meaning from events or behavior.
                    Libertarian, why not? I agree with you that the idea of AI seeing over the horizon for a real world environment is somewhat far-fetched, but for the scope of a game ... its possible?

                    Think of it this way, games have a limited number of variables that are good results and bad results (some game-types more than others, strategy games vs. FPS). If the computer were to look at what the player did every time one of those variables changes and analyses why it changed, it can start to build a library of actions to recognize those events when they happen again. Granted this is cheating since the computer needs to play a few games before it "learns" and adapts to each players strategies, but the goal here is to create a more challenging game not a true AI.

                    This way, the AI always remains a challenge while varying in difficulty from one player to the next based on each one's skill.

                    Comment


                    • #11
                      Artificial Instinct

                      Good name, Lib! I like it! Let's adopt that for purposes of this discussion. From here on then, we're NOT talking about Artificial Intelligence, we're talking about Artificial Instinct....giving the AI the basic tools it needs to survive in a game world with a human player.

                      Further defining and refining the two basic objectives:

                      First, it's not something we can do without bringing in at least *some* game-specific notions, so for the moment, let us say that we're working on a Civ-type game....further, for ease of comparison, we'll say that our "civ-type game" is, in fact, very much like Civ3, with all the essential game elements present and accounted for.

                      That being the case, the AI's definitions of its two prime directives are as follows (each factor is given a value between -200 and +200 (relative importance), tho these factors can be changed by the game editor, allowing players to rearrange them to alter AI strats).

                      1) Spread - Grow. Go out and expand, because if you are bigger, you are correspondingly harder to destroy. Growth may be accomplished in the following ways:
                      a) Excess Food (default value = +150) - Maximize food outputs in increase total population quickly. Use this population advantage to occupy and control more *terrain tiles* (one of the defined world elements mentioned earlier).

                      b) Culture Capture (default value = 0) - Maximize cultural outputs relative to rivals who border you. This relies on a focus on technology, with beelines toward cultural enhancements, in particular (lesser emphasis on techs that further increase research capabilities)

                      c) Military Capture (offense)(default value = +50) - Mix food/shield output to even amounts, allowing for fairly brisk growth, and good production. This places a secondary emphasis on research, per "b" above, with a focus on techs that lead to more effecitve troop types (and a lesser emphasis on wonders that enhance the military (heroic epic, sun tzu, etc). This essentially utilizes the "survival" routines to *accomplish* growth.

                      d) Research: (default value = +100) - A subsidiary growth strategy, not a growth strategy per se (but it ties in with the above, and so deserves its own mention). This essentially is the mod-script that controls how much priority the AI will give to research, compared with the other stuff.

                      e) Defense: (default value +150) - Another subsidiary of the growth strategies, this relies on basic protection to keep territory grown into - also ties in with Research (specifically, researching techs that lead to better defensive builds/units (forts, pikemen, walls, etc).

                      2) Survival - When faced with a hinderance to your survival, you MUST drop into "survive" mode and do all you can do to ensure your continuance. Assess the threat along the following lines:
                      a) Compare the hinderance's sum total attack values to your regional defense values (in the areas within 10 tiles of his units). Build accordingly, mixing attack/defense units to maximize their chances of survival (taking full advantage of terrain)...computers are pretty good at min/maxing, so this part shouldn't be too hard!

                      b) Aggregate production values (yours vs. his). If yours are less, send workers to modify terrain tiles to bring yourself to parity without sacrificing current population.

                      c) Settlers and colonists are given a null priority until the hinderance has left the area ("left the area" to be defined later).

                      d) Reference playbook and decision tree to determine nature and type of operation against the Hinderance (hold, stonewall, overrun, flank, scortched earth retreat, etc). (playbook to be outlined later).

                      e) focus - Make every effort to only deal with one hinderance at a time. If involved in a war with an AI rival, and attacked by a human player, make peace with the AI immediately, to give your full attention and all available resources to surviving vs. the human player (and the AI rival should recognize the human threat to call off the dogs, even if he is winning, UNLESS he is allied TO the human player--which should be VERY difficult to arrange, and take quite a lot of work to maintain).

                      f) cooperation - enlist the aid of friendly AI virii (other civs) to help beat the human menace. (sliding scale, the MORE menacing the human player is percieved to be by the AI's various measures, the easier it'll be for the AI's to "gang up")

                      Other stuff for our conjectural Artificial Instinct?

                      -=Vel=-
                      The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

                      Comment


                      • #12
                        One aspect of computers versus chess masters which does not have to exist with our style of game is that in a chess match, both sides must play with the same set of rules.

                        Obviously, programmers can allow the AI to cheat on rules which the human must follow, and every iteration of Civ we've seen incorporated this design decision at some difficulty level.

                        I'm getting too far away from things that can actually be done to Civ3, but continuing the debate:

                        What if the computer foils incorporated certain rules cheats? For example, if the computer found itself deciding on a a foil preparing to pre-emptively strike a human opponent, you incorporate temporary rules cheats such as "double computer movement values" and "no war discontent" that are temporary.

                        You have to design foils very carefully, and you have to design the architecture of decision making very carefully so that human flexibility and deception techniques can be dealt with by an inflexible construct. Granted, there's only so much you can do, but it should produce a fun result if done properly.

                        In fact, given what I learned in Analyst Redux's post, virtually all of what we see in the AI behavior was accomplished by rules cheats (albeit ones that both human and AI must follow) that made previous decision making architectures more successful.

                        Fascinating stuff.

                        It must be hard to be a game programmer - working so hard to make things challenging, knowing the end-game is that you build something that will be deconstructed, exploited, and defeated.
                        I long to accomplish a great and noble task, but it is my chief duty to accomplish small tasks as if they were great and noble. - Helen Keller

                        Comment


                        • #13
                          Korn - *excellent* question re: Zso's astonishing series of legendary games. IIRC, when the challenge was posed, even for all my understanding of the game, I thought it patently impossible to pull off, but no one was happier to have been proven wrong when he actually did it!

                          Is that possible/would it be possible in Civ3? Doubt it. And you're right....that points to what I'd term a "significant upgrade" in AI capabilities.

                          And by the way, thanks for the SMAC plug! (Oh, I *know* I'm not the best player--not enough killer instinct--but I like to think of the SMAX guide as a mighty good terrain leveller, allowing beginning players to open up a pretty good can of whup a$$ on even seasoned veterans with a bit of study!)

                          -=Vel=-
                          The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

                          Comment


                          • #14
                            Heli - I *really* like the idea of building in foil-specific cheats, rather than general purpose cheats (tho perhaps both!).

                            When the Artificial Instinct recognizes a threat from its "threat database," depending on the nature OF that threat, a certain cheat toggle is activated (if the civ is in Dem, it mobilizes immediately, and gains immunity to war weariness, perhaps gets 2-3 free (no unhappiness) draft rounds as well...good, goooood call, and it would give the AI advantages that would be an attempt to counter human ingenuity and unpredictability.

                            -=Vel=-
                            The list of published books grows. If you're curious to see what sort of stories I weave out, head to Amazon.com and do an author search for "Christopher Hartpence." Help support Candle'Bre, a game created by gamers FOR gamers. All proceeds from my published works go directly to the project.

                            Comment


                            • #15
                              All of you interested in AI

                              Vel et al,

                              if you are serious about making a better AI then I highly recommend checking out the following Alt Civ site.

                              Civ Evolution

                              it is a Civ2 clone, but the interesting thing about it is that AI development is one of the centerpieces of the project. The following is from the site

                              Implement your own Artifical Intelligence module, an absolute focus of this project. The AI development manual comes with the game package. Good luck!

                              The Game Core does neither contain any AI algorithms nor any surface code. In fact, each nation is controlled by a separate module, which can be a user interface or an AI algorithm - or even a mixture of both, usually called "macro management". The module may also be a network connection to a remote player. To create such a module you'll need a compiler that is capable of generating Windows DLL files. (And you'll need to know how to use it, of course.) For more information see the AI development manual included in the game package.

                              This section will become more important after some really good AIs have been written. I think there'll be some competition, strength rating or similar things. For now, visit the Files section to find out what alternative AI modules are already available
                              there are already a couple of user created AIs floating around out there, and the developers could maybe help get you started

                              Comment

                              Working...
                              X