嘗試記錄那些有著各種用途的物件,以及它們在角色扮演游戲中所起的作用,將是一個非常重要的設(shè)計因素。
在游戲的過程中,通常被限定選擇并不算多的物件,每個物件都有它們各自獨特的用途。創(chuàng)建游戲時,每個物件都必須考慮到,它們都應(yīng)被設(shè)計為一個特定的用途。武器、盔甲、療傷藥,
這些都需要明確定義,包括它們的形式和功能。
形式和功能,這兩個單詞說明了在物件定義中最重要的兩個方面。形式涉及了外觀和特征,即一個物體看上去像什么,感覺上是什么,它有多大,有多重等。功能則涉及到它們的用途,每個物件都有一個特定的用途,金錢可以購買東西,刀劍可以用來攻擊,療傷藥可以用來治愈創(chuàng)傷。
物件的形式
盡管對我們來說,在視覺上認(rèn)識一個物體十分重要,但對計算機(jī)而言卻毫無意義,它們只不過是使用某個圖像或三維模型所表示的物體。假設(shè)想要創(chuàng)建一把武器,更確切的說是一把劍,在一個三維游戲中,希望玩家們能夠看到游戲中角色手握著的寶劍,而且能夠隨距離接近而放大。另外,為了顯示出已裝備的武器,還希望在屏幕上顯示一把寶劍的位圖。其實只需要一個網(wǎng)格模型和一張位圖(如下圖所示)就可以表示寶劍。

定義物件的功能
If you were to hand an
object to a child (or to anyone for that matter), the child
would be able to find some use for it, even if it’s not the correct use.
Although it
might be great to be able to do all kinds of things with objects in a game, that
just
will not do for your purposes. The items (objects) in your game
will be used for specific purposes, which can be in one of the following
categories
(note that the list is not comprehensive, but is a starting place for ideas):
■ Accessory. Rings,
necklaces, belts, and any other form of wearable equipment
that can aid an adventurer are classified as accessories. Sometimes an accessory
is a magical piece of equipment that helps boost the abilities of the wearer.
■ Armor. Taking a blow is nothing—if you’re wearing the proper protection,
that is. Armor can be any form of protective gear, from a full suit of armor to
a pair of boots.
■ Collection. Any item that doesn’t serve an actual purpose is considered to be
a collection piece. These can be items that are important to the game story
in some way or that really have no definitive use. Items such as a picture,
small ornamental figurine, or chair are considered collection items.
■ Edible. Clam cakes, clam pies, clam alamode, creamed clam, or BBQ clam—
whatever your fancy. Your gaming denizens are bound to get hungry, and
whatever they can find and consume is classified as edible, even potions and
herbs.
■ Money. Everybody deals with the big M, no matter what form it takes—coins,
bills, clam shells, and so on. Games do not require denominations—one gold
coin is as good as the next, and the more coins you have, the better.
■ Transportation. Whether by bus, boat, plane, or hang glider, people sure
know how to get around, and items that can transport belong to characters
in the game. A boat can’t be lugged around, but your game recognizes a
character as the item’s owner by noting so in the character’s inventory.
■ Weapon. Whether it’s a sword, rock, or piece of lint, some things are just
more suitable for dealing out damage.
■ Other. Anything that doesn’t fit into the preceding categories is considered
“other.”
游戲引擎根據(jù)物件的類別來確定每個物件能夠做些什么。例如,武器可以被裝備,而食物可以被消費(fèi)。可以在需要的時候添加每個物件的子類,以便可以使物件的分配更容易。
武器
武器所產(chǎn)生的破壞程度由一個數(shù)值來衡量,稱之為攻擊指數(shù)(attack
modifier);越高的數(shù)值,就意味著武器擁有更大的破壞力。同時,一些武器能夠更輕巧地?fù)]舞,所以就能夠給對手更快頻率的有效打擊。為了衡量一件武器攻擊目標(biāo)的有效性,使用了命中指數(shù)(to-hit
modifier);更高數(shù)值的武器,就意味著角色命中敵人的幾率越大。
一些武器也可以被歸類到指定的分組中,稱之為武器組合(weapon
groups)。某些武器能夠比另外的武器發(fā)揮更大的破壞力,例如使用一把附上烈火法術(shù)的寶劍去對付冰魔。
武器也可以被歸類到子類中,例如近身格斗類和遠(yuǎn)程攻擊類。無論什么類型,每件武器都有一個有效攻擊范圍。劍可以正面攻擊目標(biāo),而一把弩可以擊中40英尺外的目標(biāo)。除此之外,武器還可以一次攻擊多個目標(biāo)。
Armor
The more protection, the better, and in your game every little piece of armor
helps. Armor helps add resistance to damage. This resistance amount is called
the
defense modifier. Just like weapons, armor has special uses and usage
restrictions and
belongs to armor groups.
Armor can be split into multiple subcategories, such as helmets, chest and
abdomen protection, leggings, boots, gloves, and so on.
Accessories
As mentioned earlier, accessories usually have a specific use. A magic ring can
be
worn to gain the ability to become invisible. This ability might always be in
use
once the ring is donned, or it may have to be activated. Accessories can also
act like
armor; they can increase the resistance to some aspect of the game—for example,
making it harder for the wearer to be poisoned.
Edibles
Edible items usually come in a few flavors (pun intended). Food items sustain
life,
healing items increase health, and poisonous items decrease health. Again,
special
uses are in effect, but because there are few uses for edible items, you can
hardcode
those into your game engine.
Collections
A collectable object is usually docile; it’s needed only for some small aspect
of the
game. For example, if a character gives you a picture of himself to deliver to a
girl
in a neighboring town (and for no other purpose), the picture is considered a
collection
item. Collection items simply move some part of the game story forward.
Perhaps the character delivering the picture will receive, in turn, a special
item
from the girl in the next town.
Transportation
Getting around on foot is slow and tiring, so other forms of transportation
might
be needed. The purpose of transportation items is to change the way the
characters
move around (typically around the map). Transportation can also open up new
areas
in the game that were previously not accessible. For instance, your character’s
newly
acquired boat can now be used to sail across the lake to an isolated island, or
maybe
that horse you saw in a nearby town will help you cross a barren desert safely.
Others
“Other” items are pretty much useless because they don’t have a defined use.
However, don’t throw them out. At the least, they can perform some type of
action
as defined by the engine. For instance, depending on how well you do in combat,
your character could be awarded medals. While these medals are cool to look at,
they serve no purpose in the game.