If one is playing a game of Unreal Tournament and cannot tell if the opponent one is playing against is a human opponent or a ’bot, then one could say that the game passes a limited sion
Trang 1Chapter 9
Artificial Intelligence
“I’d basically watch the game play until I saw the AI do thing stupid, then try to correct that and repeat ad infinitum.Over a long enough period that produced a pretty darn good
some-AI I have always tried to teach the AI the same successful egies that I use in playing a game.”
strat-— Brian Reynolds, talking about the creation of the
artificial intelligence for his games Civilization II and Alpha Centauri
158
Team-Fly®
Trang 2Artificial intelligence can mean a variety of different things in different
con-texts In an academic context, artificial intelligence is sometimes defined as
a system that can reliably pass what is called the Turing test In the Turingtest, a human is presented with a computer terminal into which he can type varioussentences and can then see responses printed on the screen If this user believes thatthe responses are provided by a human, even though they were actually provided bythe computer, then that computer would have passed the Turing test and could besaid to have artificial intelligence
One could apply a similar test to computer games If one is playing a game of
Unreal Tournament and cannot tell if the opponent one is playing against is a
human opponent or a ’bot, then one could say that the game passes a limited sion of the Turing test and therefore possesses some sort of artificial intelligence.However, in actual practice, even if the game had failed that test, people wouldhave said that the game has artificial intelligence, just not really good artificialintelligence When game developers talk about artificial intelligence, they do notmean the computer’s ability to trick the player into thinking he is playing againstactual human opponents Instead, game developers refer to whatever code is used tocontrol the opponents the player battles as artificial intelligence How the gamereacts to the player’s actions is determined by the game’s AI The reactions of thegame may be completely random or completely logical; in either case the codewhich controls those reactions is referred to as the game’s artificial intelligence
ver-Consider a game like Centipede The AI for this game is completely
predict-able, with the various insects moving in predetermined patterns, with a small
Trang 3amount of randomness thrown in Some people would say that the game does notreally have any AI Indeed, the behaviors of the creatures in the game are exceed-ingly simple to implement But at the same time, the game provides a great deal of
challenge for the player The difficult part of creating the AI for a game like pede lies entirely in the design of those creatures’ behaviors, coming up with the
Centi-movement patterns that will provide an interesting challenge for the player The AI
is more design than implementation Tetris, perhaps, is an even more extreme
example The only AI the game could be said to have is the random number
genera-tor that determines which piece will drop into the play-field next Yet Tetris is
designed such that this is the only AI the game needs
The reader may be wondering why I am talking about game AI in a book aboutgame design Surely AI is a programming task, and since this book is not about pro-gramming, the discussion of AI contained in this chapter may seem out of place.But determining what the AI will do and actually programming that behavior aretwo fairly distinct tasks The first primarily involves creativity and the second con-sists of a whole lot of hard work A game’s designer should be intimately concernedwith making sure the game’s AI behavior is as well conceived as possible and per-forms the actions most likely to provide the player with a challenging and
compelling gameplay experience Part of designing a good game is designing good
AI for that game, and a designer who just leaves the creation of the AI up to grammers better hope that they are good AI designers If they are not, the game willlikely not be much fun to play
pro-If a computer game is like improvised theater, where the player gets to be tor of the primary character or group of characters, then all of the other actors in theplay are controlled by the artificial intelligence As the game’s designer, you want
direc-to direct those AI-controlled acdirec-tors direc-to create the most stimulating experience ble for the player These AI agents are not just the opponents the player mightbattle, but also any characters with which the player interacts How will a town full
possi-of people behave? How will they react to the player’s actions? Designing the AI is
a big part of designing a game
Goals of Game AI
Players have different expectations of the AI they find in different types of games
Players do not expect much of the AI in an arcade game like Centipede or a puzzle game like Tetris As I have discussed, these games provide plenty of challenge to
the player while using various simple-minded or outright stupid opponents In a
wargame like Close Combat, however, players expect a lot more from the
intelli-gence of the opposing forces In an RPG, players expect to move into a simulation
of a living world, where characters move around in a town more or less
“realisti-cally.” In a game like The Sims, the AI more or less is the game; with weak AI the
160 Chapter 9: Artificial Intelligence
Trang 4game would simply not be worth playing.
So different games provoke different expectations in the player of how smartthe AI agents in those games need to be However, we can still construct a generallist of goals for any computer game AI, goals which change in importance as thedesign goals for a given game vary
Challenge the Player
Providing a reasonable challenge for the player must be the primary goal for AI inany computer game Without setting up a challenge of some sort, a game becomesunchallenging and therefore too easy to defeat Worse still, a game that provides nochallenge stops being a game entirely and becomes more of an interactive movie
In a classic arcade game like Robotron 2084 or in a first-person shooter like Doom, the challenge mostly comes from the player being overwhelmed by adver-
saries, and by the powerful abilities those adversaries have For instance, in my
oft-used example of Centipede, the bugs can kill the player by touching him, while
the player must shoot the creatures in order to kill them This puts the player atsomething of a disadvantage The fact that there are multiple insects attacking theplayer at once does not help matters As a result, the AI for these creatures can befairly simple and predictable, yet the player is still challenged by them
The same imbalance holds true in Doom, where the player may run out of
ammo but his enemies never do, where the player is much more helpless in the darkwhile the enemies can detect the player just as easily as in the light, and whereoften the enemies, such as flying creatures, can go where the player cannot The
Trang 5fact that the creatures far outnumber the player also tends to compensate for the
reality that none of the creatures is very smart The AI in Doom has to appear more sophisticated than the Centipede insects because the Doom world seems more real than the Centipede world, as I will discuss in a bit The fact remains that primarily
the AI provides a challenge for the player by being more powerful and numerousthan the player
Creating a challenging AI for a real-time strategy game like StarCraft is an
entirely more difficult proposition The expectation in games of this sort is that theplayer is competing with someone equivalent to him in strength In your averagereal-time strategy game, both sides have a large number of troops to manipulate andthe ability to build more as needed Both sides usually need to mine a resource ofsome kind and use that to build more structures or troops Basically, the AI in anRTS has to do everything the player does and seem smart while doing it Often the
AI is given an advantage by being able to see the entire level while the player not, and possibly having a larger number of starting units, an easier method forobtaining more, or a bigger pool of resources from which to draw Nonetheless, cre-ating a challenge for a player in an RTS game is quite difficult since it requires the
can-AI to plan the movement of the units beyond the individual unit level, making theunits appear to work collaboratively, as a player would use them
The difficulties presented in creating a challenging AI for an RTS game are
only magnified in a turn-based strategy game such as Alpha Centauri Here the AI
is supposed to operate just as the player does Of course turn-based strategy gamesare some of the most thought-intensive games available, so that only amplifies theproblem of creating a compelling opponent AI Furthermore, the computer does notget to benefit as much from its extremely fast processing power; since the game is
162 Chapter 9: Artificial Intelligence
Trang 6based, the player has as long to think about a move as he likes Often based strategy AIs create a challenge for the player by cheating in various subtleways, though I would certainly be the last to accuse any particular game of doing so.Regardless of the game type, the AI must present the player with an interestingchallenge Without good AI, a game may become similar to playing chess with your(much) younger brother: somewhat pointless The difference is, when you playchess with your kid brother, you hope to teach him the nuances of the game so thatone day he may become a good player You may also enjoy socializing with him,making an otherwise pointless game of chess worth it Sadly, the computer game AIyou battle has no hope of improving and is woefully inadequate when it comes toproviding companionship In order for a game AI to justify its existence, it mustprovide the player with a challenge.
turn-Not Do Dumb Things
AI for a computer game must not appear overly stupid Players love laughing at AIwhen it does something completely foolhardy Nothing breaks a player’s suspension
of disbelief more than when an AI agent fails to navigate around a small obstaclesuch as a fire hydrant or a tree, or when an agent charges right off a cliff to its doomlike a lemming To the player, it is completely obvious what the AI should do ineach situation But what may look obvious to the player can actually be a fairlycomplex action for the agent to perform or understand Nonetheless, for the game toavoid becoming a laughingstock, the game’s AI must have a solid mastery of whatseems obvious to human players
Trang 7The number of dumb things the AI will be able to get away with has a directrelationship to what sort of intelligence the AI is supposed to represent For
instance, in my first-person shooter Damage Incorporated, the player is supposed
to be almost exclusively battling human opponents In Marathon 2, however, the
player is battling a variety of alien species mixed with some robots The enemies in
Marathon 2 are able to get away with appearing stupid since they are non-human creatures In Damage Incorporated, conversely, since the enemies are all humans they must look much smarter For another example, in Damage Incorporated,
according to the game’s story and the appearance of the levels in the game, theaction is supposed to be transpiring in a real-world environment On the other hand,
Centipede 3D takes place in a whimsical fantasy world that bears only a tangential relationship to the real-world Therefore, while the guards in Damage Incorporated need to appear to be tracking the player like real human soldiers would, in Centi- pede 3D it is less absurd that the centipedes are unable to make a beeline for the
player and instead have to wind back and forth between mushrooms AI stupidity isacceptable relative to the type of world the computer game is supposed to represent
Be Unpredictable
Humans are unpredictable That is part of what makes them good opponents in agame This is one of the primary reasons that people enjoy playing multi-playergames; a skilled person will be challenging to fight in a way a computer never will
A large part of that is the unpredictability of a human opponent The same should betrue of the AI opponents in a computer game When the game gets to the point
164 Chapter 9: Artificial Intelligence
how smart these
enemies will be.
Trang 8where the player feels with certainty that she knows exactly what the enemy forcesare going to do at any given second, the fun of playing the game quickly wanes.Players want the AI to surprise them, to try to defeat them in ways they had notanticipated Certainly multi-player games still have the advantage of including asocial component, which is a major factor in their success, and the AI in your gamewill never be able to be a friend to the player in the same way another human can.But if you cannot provide the social component of multi-player games, you can atleast strive to make the AI agents provide much of the same challenge and unpre-dictability that a human opponent can.
In all art, the viewer wants to see something she had not been able to anticipate,something that challenges her expectations When, within the first ten minutes, youknow the exact ending of a movie, book, or play, a big part of the thrill of experi-encing that work is removed The same is true for computer games Of course,games can surprise players with their predetermined story, or what sort of environ-ment the next level will take place in, or what the big boss robot will look like But
if the AI can also contribute to this unpredictably, the game gains something that noother component of the game can provide: replayability Players will keep playing agame until it no longer provides them with a challenge, until they no longer experi-ence anything new from playing the game And an AI that can keep surprisingthem, and thereby challenging them, will help keep their interest high
Successful unpredictability can take many different forms in games It can be as
simple as the random number that determines what piece will drop next in Tetris.
Surely this is a very simple case, and optimally we would hope many games could
The only AI Tetris
Trang 9provide deeper unpredictability than that But at the same time, one must realize
that for Tetris, it is the perfect amount of unpredictability If players knew what
piece was coming next, the game would lose a lot of its challenge Indeed, with the
“next” feature on (which displays the next piece to drop on the side of the screen)the game becomes significantly easier Pure randomness is often a really good way
to keep the player interested in the AI, to make them wonder, “What’s it trying to
do?” when in fact it is just being random The randomness in Tetris provides the
unpredictability required to keep the player challenged for hours
Sometimes the goals of computer game AI can get confused, and in a quest forthe holy grail of realism a designer or an AI programmer can end up making a verydull opponent for a game Sure, the agent always makes a decision which “makessense” given its current situation; it may even make the decision most likely to winthe current battle But if that logical decision is completely obvious to the player,how much fun is it going to be to fight that AI? If every time you run into a room in
a first-person shooter, the Orc you find there is going to spin around, heave its clubabove its head, and charge at you while swinging wildly, the next time you play thatroom the situation will be much less challenging What if sometimes the Orc is star-tled by the player’s sudden arrival? Then the Orc might flee down the hall or gocower in a corner What if sometimes the Orc decides to hurl his club at the playerinstead of trying to use it as a melee weapon? That would certainly provide enoughspice to keep the player on his toes You must remember that each human being isdifferent and that many humans are known to act irrationally for any number of rea-sons That irrationality keeps life interesting If the player is battling humans orhuman-like monsters/aliens in a computer game, a little irrationality will result inmaking the opponents seem that much more real, believable, and interesting tofight
“Fuzzy logic” is one method AI designers and programmers may try to use tokeep the AI agents unpredictable and interesting Essentially, fuzzy logic takes alogical system and inserts some randomness into it In fuzzy logic, when the AI ispresented with a given situation, it has several worthwhile courses of action tochoose from instead of just one Say the player is at a certain distance with a certainweapon while the AI agent is at a certain health level and is equipped with a certainamount of weaponry There may be three reasonable things for the agent to do inthis case, and they can each have different numerical values or “weights” represent-ing how good a choice each is Say that running up and attacking the player makes
a lot of sense, so it rates a five Doing a threat display in order to frighten the playermakes a bit of sense, so it rates a two And maybe trying to circle around the player
in order to disorient him is also plausible, so it rates a three Using these differentweights, the agent can simply randomly pick a number from 1 to 10 (the total of theweights) If less than or equal to 5, the agent will run up and attack If 6 or 7, theagent will try to frighten the player And if 8 through 10, the agent will do its best
166 Chapter 9: Artificial Intelligence
Trang 10to disorient the player The weights represent the chance that the AI will make agiven decision If the AI has enough different plans at its disposal, the player willnever be able to know exactly what the AI will do, thereby making the AI unpre-dictable In the final analysis, basing AI decisions on randomness makes the agentlook like it is performing complex reasoning when it is not The player will neverknow that the AI in question just picked its action randomly Instead, if the agent’saction does not look too stupid, the player will try to imagine why the AI mighthave chosen to do what it did, and may end up thinking the agent is pretty sly whenreally it is just random.
Of course, the unpredictability of an AI agent in a game must not conflict withthe other AI goals I have listed here If an agent is so busy being unpredictable that
it cannot put together a solid plan of attack against the player, it is not going to bemuch of a threat to the player and he will not be challenged Ideally, unpredictabil-ity enhances the challenge the AI presents, instead of proving a detriment If the AIrandomly chooses to do something completely foolish when what it was doing wasabout to lead to victory, the player cannot help but wonder, “Why would the AI dosuch a stupid thing?” When working on the behaviors of the creatures in a game, it
is always important to keep an eye on the bigger picture of what that AI is trying toaccomplish
Assist Storytelling
Game AI can be used to further a game’s story For example, in an RPG, a playermay travel to a certain town which is home to a number of fearful residents whodread the arrival of outsiders If the player only observes these people, they can beseen to be navigating the town, going to the stores, restaurants, and factories just aspeople in a real town would This sets the scene for the town and makes it seem real
to the player But whenever the player approaches these people, they turn away,fleeing to safe areas to avoid interacting with the player Why is this? What does itsay about the town and the people who live there? Why are they frightened? Theplayer wants to know why, and will start exploring the game’s story as a result Eng-lish teachers are notorious for telling their students that it is better to show than totell This is especially true in a visual medium such as computer games Instead ofjust seeing that the town’s inhabitants are frightened of strangers in a cut-scene, aproperly designed AI can actually show the player this interesting information.Even the adversaries that a player might fight in a battle can be adjusted to aid
in the storytelling process Suppose that in a wargame the player is supposed to befighting a general who is known for being compassionate about the welfare of histroops, perhaps more than is logical in a combat situation The player could send in
a few snipers to pick off several of the opposing force’s troops that are serving asguards along the border between two contested areas If the AI for the enemy
Trang 11general was properly designed, the slow drain of troops in that manner would start
to enrage him Once infuriated, the general would try a foolhardy attack to get back
at the player’s forces, thus putting him at the disadvantage Here again, a bit of thegame’s story has been told through the AI
In my game Damage Incorporated, the player is a U.S Marine Corps sergeant
in charge of a fire-team of four men Together with his men, the player stormsthrough numerous missions against a variety of heavily armed opponents The meneach have different strengths and weaknesses Some are headstrong and will chargebravely into a fight Some of the squad members are more careful about firing theirweapons than others, and as a result are less likely to hit the player or the otherteammates These personality traits are all communicated through the AI that theseteammates use Before each mission, the player gets to choose his team from aselection of thirteen different soldiers, each with a dossier the player can read Thedossiers provide a psychological profile of each of the teammates, which givessome insight into their personalities Furthermore, when actually on a mission, theteammates are constantly speaking, either in response to the player’s orders or just
to comment on a given situation This gives further insight into their personalitiesand how they will behave on the battlefield If the player reads the dossiers andpays attention to the squad members’ personalities carefully, he will notice warn-ings that some of the teammates may not be completely balanced psychologically.For some teammates, if they are taken on too many missions they will “crack” orbecome “shell-shocked” and attempt to run away from the battle Other teammates,
if taken on specific missions that they do not agree with ideologically, will turn
168 Chapter 9: Artificial Intelligence
Trang 12against the player and his men The AI, of course, handles these “shell-shocked”situations, which thereby helps to tell the story of these characters.
One area where AI is often avoided entirely by designers but where it can bequite useful is in dynamic storytelling All too often designers cobble a storyaround a game instead of integrating the story and gameplay together Furthermore,often designers want to tell static stories in which how a given character will react
to the player is entirely predetermined, regardless of the player’s actions in thegame-world or how the player treats that particular character While designers oftenstrive to keep the battles and action sequences as dynamic and unpredictable as pos-sible, they almost always want to keep the stories exactly the same every time theplayer experiences them Why not have the player be able to affect the mood of thedifferent NPCs he encounters? Maybe if the player says all the right things and doesnot ask questions about sensitive subjects, the NPC becomes friendly toward theplayer Maybe the player can only coax crucial information out of a character afterfirst becoming his friend Perhaps the player’s reputation precedes him, where theactions the player has performed elsewhere in the world directly impact how thatNPC will treat the player If the player has done less-than-good actions earlier in thegame, maybe the player has to redeem himself in the eyes of a character before hecan proceed in the game Of course, there is a wide range of different effects thatcan be achieved using the game’s AI to create interesting interpersonal relation-ships Sadly this is something that has been all but unexplored in commercialgames to date Instead of telling static stories, we could be telling ones that, thoughnot entirely procedurally generated, were subtly different depending on how theplayer played the game Using AI to spice up and vary the story from game to gamemay make telling a story much more difficult, but what it can add to the game’snon-linearity and replayability is enormous
Create a Living World
In many games, the AI does more than just provide a threat and a challenge to theplayer A game may even include AI agents that the player does not directly interactwith at all The AI can instead be used to inhabit the living world the game creates
A game-world may be infinitely detailed in terms of the objects it contains and how
it looks and sounds, but players are used to a real-world which also contains livingorganisms that think for themselves and behave in interesting ways Therefore, cre-ating a sterile game-world filled with inanimate objects is not going to be a veryauthentic reality for the player One does not need to go overboard in filling up thegame-world with complex ambient AI agents; a little can go a long way Whetherthis means a few birds that fly around in the sky, insects that crawl around on theground, or humans that go about their daily business, adding ambient life to a worldcan do a lot to make the game-world seem more real to the player And the more
Trang 13real it is, the more likely it is that the player will be able to immerse himself in it.There is a close connection between filling the game with ambient life andusing the AI to tell the game’s story Creating these inhabitants does a lot to estab-lish the setting for your game, and setting is a key part of telling any story Butambient life in a game goes beyond just establishing that setting; it helps make theplayer feel less lonely in the game-world How many times have you played a gamewhere you felt like you were walking around a sterile wasteland, as if an extermina-tor had come through previously to eliminate any signs of life? Players love to seethat the world has ambient life in it, creatures they can just look at rather than kill,and the depth it adds to the world can be invaluable.
The Sloped Playing Field
Often when programmers get together to talk about AI for computer games, theyconcentrate their discussions on how they want their AI agents to be on equal foot-ing with the player This was certainly the case at the AI round tables I haveattended in years past at the Game Developer’s Conference These AI specialistswant their AI systems to know only what the player would know, see what theplayer can see, and so forth This, they suggest, will make the conflict between the
AI and the player more realistic and therefore more interesting
Of course, for years games have been giving the AI agents unfair advantagesover the player They have made the AI have more hit-points than the player Theyhave outnumbered the player a hundred to one They have made the AI agents have
a practically psychic knowledge of every location in the game-world, which allowsthem to know exactly where the player is at any given second, certainly an unfairadvantage Some game AIs have even been known to cheat Surely this is unfair tothe player, the AI programmers will say The AI should be on equal footing with theplayer, they proclaim, and should triumph over the player through its wits alone.But is it really better to put the AI and player on a level playing field? First andforemost, this is quite likely to lead to an AI that fails to provide much of a chal-lenge for the player The fact remains that a shrewd player is going to be able tooutsmart even the most sophisticated game AI without that much difficulty Trying
to put the player and AI on equal terms will create a much larger challenge for your
AI programmers They will need to invest countless more hours in developing an
AI that has even a slight chance of beating the player, time that cannot be spentimproving other parts of the game In the end they will end up with an AI that doesnot provide a captivating gameplay experience In the worst case, the AI is too busybeing “real” to avoid performing blatantly stupid actions
A big part of what drives AI programmers to attempt a level playing field forplayers and AI agents is the programmers’ own egos These programmers pridethemselves on their work and will assert that they can come up with an AI that will
170 Chapter 9: Artificial Intelligence
Trang 14be able to challenge a player without having to resort to superior numbers, greaterstrength, or any sort of cheating The programmers want the bragging rights ofbeing able to say that their AI is as smart as a human Often hours and hours arespent trying to come up with the sophisticated algorithms required for such equalversus equal competition, and in the end something has to be hacked together tomake the game actually function The goal of game AI is to support the game andenhance the player’s experience, not to serve as a test-bed for artificial intelligencetechniques.
Besides, there is something romantic for the player when he manages to defeat
an AI opponent despite the fact that the AI’s forces greatly outnumber his own,were better armed and equipped, and even had the benefit of prescient knowledge
of the map Just as the Hollywood action hero triumphs over countless foes, playerswant to overcome seemingly insurmountable odds for their own victories Tippingthe scales in the AI’s advantage only makes the player’s eventual victory all themore sweet Unless, of course, the design ends up making the game too hard
How Real is Too Real?
Another potential AI programming pitfall is creating an AI which, though it actuallyperforms like a “real” person, ends up detracting from the gameplay as a result Interms of the stories they tell and the settings they employ, games are often contriv-ances, strictly unreal situations that are specifically set up because they are
interesting, not because they are authentic, and the AI must support this
Consider the James Bond movies These films are like many popular games inthat they feature a lot of action and exciting situations with less of a focus on char-acter development or meaningful stories In nearly every film, Bond is captured atsome point and tied down to a particularly hideous execution device This devicedoes not kill Bond instantly, but instead employs some slower method, such as alaser steadily burning a hole down the middle of the table to which James is
strapped Why does the villain not simply shoot Bond? Or simply aim the laserstraight at him? Why does the villain almost always leave before the execution hasactually been completed? And why does the villain reveal to Bond his entire madscheme for world domination before he starts the execution device in motion? None
of it is very smart behavior, but it is fun to watch, and fits with the overall style ofthe movie It entertains the audience, which is the primary goal of the Bond films.Realism is much less of a concern
And so it is with games If the enemy AI is so smart, surely it should realizethat it has no chance against the player, and should lock itself away in a safe
bunker, refusing to open the door for anyone It has, in fact, saved its own life bydoing this, which is the smartest decision possible But what has it done to thegame? Now the player is stuck, since he has no way of getting to the enemy and
Trang 15continuing on with the game Another example might be a cowardly AI that runsfrom the player when sufficiently wounded This is used to great effect in manygames But what if the agent was faster than the player, and better at dodging intosafe locations? When quite wounded, the AI agent will start fleeing from the battle,with the player left with no other option but to chase after it If the AI is speedierand better at navigation, the player will have a hard time catching up with it Whatmay have been a fun action game now becomes a tedious chase with a foregoneconclusion, since the agent is mortally wounded and has no chance of recovering itshealth And what of the deadly serpent boss the player must battle? With its protec-tive armor coating, it is impervious to the player’s attacks, and can only be
damaged by being shot when its mouth is open So the strictly logical choice might
be to always keep its mouth closed whenever the player has any chance of gettingoff a shot This is a decision it can make very easily But now, of course, the playerhas no chance whatsoever of winning the battle Is this fun?
The point again is that the AI must never overshadow the gameplay, and itmust never distract the development team from the true goal of the project: to make
a fun, playable game If the AI is really very sophisticated but, as a result, the game
is unplayable or extremely frustrating, a player is not going to remark on how smartthe AI is A player may notice advanced rendering algorithms which improve thevisuals of a given title He may remark on this and appreciate the game’s aestheticvalue even if the gameplay is poor, but a non-programming player is not going toappreciate sophisticated AI if the game that features it is not any fun to play
AI Agents and Their Environment
Computer game AI cannot be designed or developed in a vacuum For a game AI toturn out well, it needs to be developed in close association with the game’s game-play and the environments in which that gameplay is going to take place Thesimple fact is that no AI agent is going to be smart enough to prevail in all situa-tions While an AI may be exceedingly good in wide open spaces, when it is throwninto a narrow canyon it will encounter problems its programmer never anticipated
If the AI programmer comes up with an AI that can handle the confined spaces,chances are it will not be as good out in the open The best one can hope for is thatthe AI has a fighting chance in a specific type of gameplay situation If the levelsand AI are not developed in synchronicity, then there is little chance that the oppo-nents the player faces will appear very smart at all
This creates special problems in terms of how to best produce a game Leveldesign is often one of the last tasks to be carried out on a game, before it goes intofinal balancing, then testing, and finally ships Similarly, AI is usually only worked
on after the game’s rendering is firmly in place, most of the mechanics for theplayer’s movement are fully functional, and many of the other more critical
172 Chapter 9: Artificial Intelligence