天行健 君子当自强而不息

游戏中物件的定义与使用(1)


尝试记录那些有着各种用途的物件,以及它们在角色扮演游戏中所起的作用,将是一个非常重要的设计因素。

在游戏的过程中,通常被限定选择并不算多的物件,每个物件都有它们各自独特的用途。创建游戏时,每个物件都必须考虑到,它们都应被设计为一个特定的用途。武器、盔甲、疗伤药, 这些都需要明确定义,包括它们的形式和功能。

形式和功能,这两个单词说明了在物件定义中最重要的两个方面。形式涉及了外观和特征,即一个物体看上去像什么,感觉上是什么,它有多大,有多重等。功能则涉及到它们的用途,每个物件都有一个特定的用途,金钱可以购买东西,刀剑可以用来攻击,疗伤药可以用来治愈创伤。

 

物件的形式

尽管对我们来说,在视觉上认识一个物体十分重要,但对计算机而言却毫无意义,它们只不过是使用某个图像或三维模型所表示的物体。假设想要创建一把武器,更确切的说是一把剑,在一个三维游戏中,希望玩家们能够看到游戏中角色手握着的宝剑,而且能够随距离接近而放大。另外,为了显示出已装备的武器,还希望在屏幕上显示一把宝剑的位图。其实只需要一个网格模型和一张位图(如下图所示)就可以表示宝剑。

 

定义物件的功能

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.”

游戏引擎根据物件的类别来确定每个物件能够做些什么。例如,武器可以被装备,而食物可以被消费。可以在需要的时候添加每个物件的子类,以便可以使物件的分配更容易。

 

武器

武器所产生的破坏程度由一个数值来衡量,称之为攻击指数(attack modifier);越高的数值,就意味着武器拥有更大的破坏力。同时,一些武器能够更轻巧地挥舞,所以就能够给对手更快频率的有效打击。为了衡量一件武器攻击目标的有效性,使用了命中指数(to-hit modifier);更高数值的武器,就意味着角色命中敌人的几率越大。

一些武器也可以被归类到指定的分组中,称之为武器组合(weapon groups)。某些武器能够比另外的武器发挥更大的破坏力,例如使用一把附上烈火法术的宝剑去对付冰魔。

武器也可以被归类到子类中,例如近身格斗类和远程攻击类。无论什么类型,每件武器都有一个有效攻击范围。剑可以正面攻击目标,而一把弩可以击中40英尺外的目标。除此之外,武器还可以一次攻击多个目标。

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.


posted on 2007-11-05 23:23 lovedday 阅读(572) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理


公告

导航

统计

常用链接

随笔分类(178)

3D游戏编程相关链接

搜索

最新评论