Game Design

(Elliott) #1

interested in the AI, to make them wonder, “What’s it trying to do?” when in fact it is
just being random. The randomness inTetrisprovides the unpredictability required to
keep players challenged for hours.
Sometimes the goals of computer game AI can get confused, and in a quest for the
holy grail of realism a designer or an AI programmer can end up making a very dull
opponent for a game. Sure, the agent always makes a decision that “makes sense” given
its current situation; it may even make the decision most likely to win the current bat-
tle. 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 club above its head, and charge
at you while swinging wildly, the next time you play that room the situation will be
much less challenging and interesting. What if sometimes the orc is startled by the
player’s sudden arrival? Then the orc might flee down the hall or go cower in a corner.
What if sometimes the orc decides to hurl his club at the player character instead of try-
ing to use it as a melee weapon? That would certainly provide enough spice to keep
players on their toes. You must remember that each human being is different and that
many humans are known to act irrationally for any number of reasons. That irrationality
keeps life interesting. If players are battling humans or human-like monsters/aliens in a
computer game, a little irrationality will result in making the opponents seem that
much more real, believable, and interesting to engage.
“Fuzzy logic” is one method AI designers and programmers may use to keep the AI
agents unpredictable and interesting. Essentially, fuzzy logic takes a logical system and
inserts some randomness into it. In fuzzy logic, when the AI is presented with a given
situation, it has several worthwhile courses of action to choose from instead of just one.
Say players are at a certain distance with a certain weapon while the AI agent is at a cer-
tain health level and is equipped with a certain type of weaponry. There may be three
reasonable things for the agent to do in this case, and each can have different numerical
values or “weights” representing their relative quality. Say that running up and attack-
ing the player character makes a lot of sense, so it rates a 5. Doing a threat display in


158 Chapter 9: Artificial Intelligence


The only AITetrisneeds
is a random number
generator. Pictured here:
classic mode inThe Next
Tetris.
Free download pdf