Game Design

(Elliott) #1

order to frighten the player makes a bit of sense, so it rates a 2. And maybe trying to cir-
cle around the player character in order to disorient him is also plausible, so it rates a 3.
Using these different weights, the agent can simply randomly pick a number from 1 to
10 (the total of the weights). If less than or equal to 5, the agent will run up and attack. If
6 or 7, the agent will try to frighten the player, and if 8 through 10, the agent will do its
best to disorient the player. The weights represent the chance that the AI will make a
given decision. If the AI has enough different plans at its disposal, players will never be
able to know exactly what the AI will do, thereby making the AI unpredictable. In the
final analysis, basing AI decisions on randomness makes the agent look like it is per-
forming complex reasoning when it is not. Players will never know that the AI in
question just picked its action out of a hat. Instead, if the agent’s action does not look too
stupid, players will try to imagine why the AI might have chosen to do what it did, and
may end up thinking the agent is pretty sly when really it is just random.
Of course, the unpredictability of an AI agent in a game must not conflict with the
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 be much of a threat
to players and they will not be challenged. Ideally, unpredictability enhances the chal-
lenge the AI presents, instead of proving a detriment. If the AI randomly chooses to do
something completely foolish when what it was doing was about to lead to victory, play-
ers cannot help but wonder, “Why would the AI do such 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 to accomplish.


Assist Storytelling............................


Game AI can be used to further a game’s story. For example, in an RPG, players may
travel to a certain town that is home to a number of fearful residents who dread the
arrival of outsiders. If players only observe these people, they can be seen to be navi-
gating the town, going to the stores, restaurants, and factories just as people in a real
town would. This sets the scene for the town and makes it seem real to players. But
whenever players approach these people, they turn away, fleeing to safe areas to avoid
interacting with the players. Why is this? What does it say about the town and the peo-
ple who live there? Why are they frightened? What can players do to make the
townspeople trust them? Players want to know the answers to all of these questions,
and will start exploring the game’s story as a result. English teachers are notorious for
telling their students that it is better to show than to tell. This is especially true in a
visual medium such as computer games. Instead of just seeing that the town’s inhabit-
ants are frightened of strangers in a cut-scene, a properly designed AI can actually show
players this interesting information during gameplay. And when players are able to
interact with these characters, their involvement in the story goes beyond being shown
to actually being active in it. Players are able to be part of the narrative in a way no other
medium makes possible.
Even the adversaries that players might fight in a battle can be adjusted to aid in the
storytelling process. Suppose that in a wargame players are supposed to be fighting a
general who is known for being compassionate about the welfare of his troops, perhaps
more than is logical in a combat situation. Players could send in a few snipers to pick off
several of the opposing force’s troops that are serving as guards along the border


Chapter 9: Artificial Intelligence 159

Free download pdf