Game Development Reference
In-Depth Information
Games as state machines
many games, and game components, can be understood as state machines (see, for
example, Järvinen 2003; Grünvogel 2005; Björk & holopainen 2005). a state machine
is a hypothetical machine that can exist in a certain number of different states, each
state having rules that control the machine's transition from that state into other states.
Think of a dvd player: When a dvd is playing, the machine is in the play state. Pressing
the pause button changes it to the paused state, while pressing the stop button causes
it to return to the dvd menu —a different state. Pressing the play button does nothing
at all—the player remains in the play state.
a game begins in an initial state, and the actions of the player (and often the mechanics,
too) bring about new states until an end state is reached. in the case of many single-player
video games, the player either wins, loses, or quits. The game's state usually reflects
the player's location; the location of other players, allies, and enemies; and the current
distribution of vital game resources. By looking at games as state machines, researchers
can determine which rules cause the game to progress from one state to another. several
successful methods allow computer scientists to design, model, and implement state
machines with a limited (finite) number of states. however, in contrast to dvd players,
games can exist in a vast number of states, far too many to document.
Finite state machines are sometimes used in practice to define the behavior of simple
artificially intelligent non-player characters. Units in a war game often have states such
as attacking, defending, and patrolling. however, because this is not a book about artifi-
cial intelligence, we won't be addressing those techniques here. state machine theory is
not useful for studying the kinds of complex mechanics that this topic is about.
Games Are Unpredictable
A game's outcome should not be clear from the start: To a certain extent, games
should be unpredictable . A game that is predictable is usually not much fun. A simple
way of creating unpredictable outcomes is to include an element of chance, such as
a throw of the dice or the twirl of a spinner in a board game. Short games such as
blackjack or Klondike (the most familiar form of solitaire played with cards) depend
almost entirely on chance. In longer games, however, players want their skills and
their strategic decisions to make more of a difference. When players feel that their
decisions and game-playing skills do not matter, they quickly become frustrated.
Pure games of chance have their place in a casino, but for most other games, skill
should also contribute to victory. The longer the game is, the more true this is.
NOTE in games and
simulations, processes
that include elements
of chance (such as
moving a certain dis-
tance based upon a
die roll) are called
stochastic processes.
Processes that do not
include chance, and
whose outcome can be
determined from their
initial state, are called
deterministic processes.
In addition to chance, there are two other, and more sophisticated, ways to make
games unpredictable: choices made by players and complex gameplay created by the
game's rules.
 
Search WWH ::




Custom Search