Game Development Reference
In-Depth Information
only one avatar. In a football game, the football is a unique entity, because there
may never be two footballs in play at any one time.
Note that the airplanes mentioned in the previous section are not unique entities
even if each carries its own serial number and particular state of repair. They still
may be treated collectively, bought and sold in groups, and when treated as a group
considered to be a resource.
DEFINING ENTITIES FOR YOUR GAME
As you specify your core mechanics, you will need to create entities for any charac-
ter, object, or substance that the game needs to manipulate and for any value that
the game needs to remember. In the case of items such as footballs, vehicles,
money, and health, determining what attributes each entity requires will probably
seem obvious—although defining their mechanics won't always be simple. You
may also need to create entities that hold quantities or other information that the
user interface will display. Every indicator in the user interface needs an entity that
reflects the indicator's state or appearance.
Suppose you want to warn the player when a valuable resource, such as fuel in a
car's gas tank, reaches critically low levels. You would normally put a needle gauge
in the user interface to show the fuel level, and you may want to add a warning
light to draw the player's attention to the gauge. The light can be either on or off.
To support the light, you need to define an entit y called fuel warning that can exist
in two states. During play, the user interface checks the state of the fuel warning
entity to display the appropriate image of the light. You also need to create a
mechanic (discussed in the next section “Mechanics”) to define precisely what con-
ditions change the state of the fuel warning entity.
You may wonder why you should create an additional entit y and mechanic for the
state of the warning light rather than have the user interface software check the
fuel level and decide for itself whether to turn on the warning light. Professionals
keep the mechanics in one part of the design and the UI in another. That way, the
UI designer doesn't have to worry about underlying mechanics; she can concen-
trate on screen layouts and usability considerations, and if you want to adjust the
point at which the light comes on during the tuning stage of design, you can do so
without interfering with the user interface itself.
Mechanics
Mechanics document how the game world and everything in it behave. Mechanics
state the relationships among entities, the events and processes that take place
among the resources and entities of the game, and the conditions that trigger
events and processes. The mechanics describe the overall rules of the game but also
the behavior of particular entities, from something as simple as a light switch up to
Search WWH ::




Custom Search