Game Development Reference
In-Depth Information
THE RECTANGULAR INVENTORY PROBLEM
Consider the situation in Figure 15.6 . The player has found a staff but cannot put it in
his inventory because he doesn't have enough free boxes in the right configuration. The
staff takes up 4 boxes in a 1 × 4 configuration, and the longest space he has available is 1
× 3. If he moves the apple in the top space, however, he will have a space of 1 × 4 and will
be able to store the staff. The question to ask should be: Is this activity fun for the player?
Probably not; therefore, the computer should handle it automatically. Note that an adequate
4 × 1 horizontal space is available. Why can't the staff simply rotate 90 degrees and fit into
the 4 × 1 gap at the bottom? Most CRPGs cannot handle that simple situation. What will
happen if the player finds a staff that requires a 1 × 5 space, when the storage space avai-
able consists of a 4 × 4 grid of boxes? In the real world, we could place it diagonally in the
pack, but CRPG inventory-maintenance systems generally cannot accommodate that action.
FIGURE 15.6
An inventory problem
To resolve this, consider two possibilities. First, allow the player to turn rectangular
objects sideways when putting them in the inventory, perhaps with a single button click
that toggles the object between vertical and horizontal orientations. The staff in Figure 15.6
would easily fit along the bottom row if the player could turn it sideways. Second, and more
difficult to implement, design a system that automatically moves the inventory contents
around to keep all the free space together rather like defragmentin a hard disk drive.
Core Mechanics
During play, most of the actions in an RPG consist of the player designating a char-
acter to attempt some particular activity. The player must then roll dice (in video
games, the computer simulates this) to determine whether the attempt was success-
ful or not. The rules governing success and failure for a particular activity describe
how to test the die roll against one or more of the character attributes. For example,
consider the following situation: Johnny Rock, the warrior, wants to smash down a
 
 
Search WWH ::




Custom Search