Game Development Reference
In-Depth Information
CONDITIONS
Use conditions to define what causes an event to occur and what causes a process to
start or stop. Conditional statements often take the form if (condition) then (execute
an event, or start or stop a process); whenever (condition) take action to (execute an
event, or start or stop a process); and continue (a process) until (condition).
Mechanics defining victory and loss conditions conform to this style.
You can also define conditions in negative terms, such as if (condition) then do not
(execute an event, or start or stop a process), although a condition in this form is
incomplete. “If the mouse is wearing its cat disguise, the cat won't attack it,” doesn't
provide enough information because it doesn't tell the programmers when the cat
does attack the mouse. Use this form of conditional mechanic for indicating excep-
tions to more general rules already specified: “When a cat sees a mouse, the cat will
attack it. But if the mouse is wearing its cat disguise, the cat won't attack it.”
ENTITIES WITH THEIR OWN MECHANICS
Some mechanics define the behavior of only one type of entity and nothing else in
the game, in which case you should figure out the details and document the entity
and its associated exclusive mechanics together. This makes it easier for the pro-
grammers to build the game and for you to find the documentation if you need to
change something. This is very like object-oriented programming. In object-ori-
ented programming, you think about the variables and the algorithms that
manipulate them together as a unit.
Examples of entities with their own mechanics include symbolic entities that
require special mechanics to indicate how they change state (such as a traffic light);
numeric entities whose values are computed from other entities by a formula (such
as the amount of damage done in an attack under Dungeons & Dragons rules—it is
computed from several other factors, some of them random); nonplayer characters
with AI-controlled behavior (the definition of the artificial intelligence consists of
mechanics); and entities that act autonomously even if their behavior doesn't really
qualify as artificial intelligence, such as a trap that triggers whenever a character
comes near. In the case of a triggered trap, you define its various attributes, both
functional and cosmetic, and a set of mechanics that indicate exactly what sets it
off and what kind of damage it does to the character who triggers it.
Numeric and Symbolic Relationships
This section discusses the differences between the numeric and symbolic relationships
and how you may combine them to achieve your design goals for the core mechanics.
NUMERIC RELATIONSHIPS
Numeric relationship means a relationship between entities defined in terms of num-
bers and arithmetic operations. For example, the statement “A bakery can bake 50
Search WWH ::




Custom Search