Game Development Reference
In-Depth Information
ANALYZING A MECHANIC
Let's go back to the sample mechanic that Chapter 2 introduced in the sidebar “Game
Idea Versus Design Decision” and identify its various components. To specify the idea
“Dragons should protect their eggs,” we create a mechanic that reads: “Whenever they
have eggs in their nests, female dragons do not move out of visual range of the nest.
If an enemy approaches within 50 meters of the nest, the dragon abandons any other
activity and returns to the nest to defend the eggs. She does not leave the nest until no
enemy has been within the 50-meter radius for at least 30 seconds. She defends the eggs
to her death.”
This mechanic makes up one small part of the specification of a female dragon's artificial
intelligence. It applies to all female dragons at any time, so it belongs in the core
mechanics, not in the design of a level. (However, if dragons appear in only one level,
this mechanic should be part of that level's design, and if the dragon is a unique entity,
you should specify the mechanics relating to its behavior wherever you define what a
dragon is, and nowhere else.)
Here's how this mechanic looks with the components identified:
Whenever they have eggs in their nests (a condition about a relationship between a
resource, eggs, and an entity, the nest, such that eggs in nest > 0), female dragons (each
one an entity) do not move (a process) out of visual range of the nest (a condition placed
on the movement process). If an enemy (an entity) comes within 50 meters of the nest (a
condition), the dragon abandons any other activity (end her current process) and returns
to the nest (a process) to defend the eggs (a process). She does not leave the nest (initiate
a process) until no enemy has been within the 50-meter radius for at least 30 seconds (a
complicated condition that prevents her from initiating the process of leaving the nest).
She defends the eggs to her death (a condition indicating that the dragon does not initi-
ate any other process while defending the eggs, such as running away).”
Even this, complex as it is, isn't complete. It doesn't say whether or not eggs can be
destroyed or removed from the nest and, if so, what the dragon does about it. It doesn't
state how visual range should be computed, how the dragon goes about returning to her
nest, or what defending the eggs actually consists of. It also includes a negative condi-
tion (“she does not leave the nest until . . . ”) without a general rule stating when she
does leave the nest in the first place. All that information must be included elsewhere in
the definition of the dragon's AI and the definition of a nest and an egg. If you don't
define these things specifically, the programmers will either come and ask you to, or they
will make a guess for themselves.
Search WWH ::




Custom Search