青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

Controlling Players and Characters(31)


To start, each character needs a definition, which is pulled from the master character
list. You store this definition value in the def variable. To tell similar
characters apart, you assign a unique identification number (ID) to each one.
Think of using identification numbers as you use names. Instead of adding a character
named “George” into the game during play, you refer to that same character
as character 5.

Each character being tracked is of a specific type, either a PC, an NPC, or a monster.
To determine the value for Type, use the following three macros:

#define CHAR_PC 0
#define CHAR_NPC 1
#define CHAR_MONSTER 2

Next are the character’s artificial intelligence settings. Remember that a character
can stand in place, wander around, walk a route, follow another character, or evade
another character. The artificial intelligence of each character is stored in the ai
variable and can be set to one of the following macro values:

#define CHAR_STAND 0
#define CHAR_WANDER 1
#define CHAR_ROUTE 2
#define CHAR_FOLLOW 3
#define CHAR_EVADE 4

Finally, each character needs to be enabled in order to be updated. The update_enable flag
determines this, and setting it to true lets the controller update the character every
frame, whereas setting the flag to false means that the character is never updated
(until enabled, that is).

You need to store the character’s MCL definition for referencing, and for characters
with an inventory, you contain the ICS.

Because the character’s definition stores only the maximum values of
the abilities and attributes, the sCharacter structure needs a way to
track the current values as they change through game-play. This
includes the health points, mana points, status ailment flags, and the
current charge of the character.

NOTE
Remember that characters can perform specific actions (attacking or casting a
spell, for example) only when their charges are at full peak.This charge rate increases
at the rate defined within the MCL.

As characters move around performing their various actions (moving, idling,
attacking, and so on), you need to provide a way for their actions and positions
to be tracked. In addition, their last known animation needs to be maintained
(in order to update their animation), as well as the last time their animation was
updated.

You also need to provide a way to prevent characters that perform specific actions
from being updated until the completion of those actions. When a character is
attacking, for example, there’s no need to update the character any further until
the character finishes swinging the weapon. What is needed is a countdown timer
to lock a character’s actions; this countdown timer is action_timer.

To permanently prevent a character from being updated, you use a second variable,
called is_lock. If you set is_lock to true, the character controller will not update the
character until you set is_lock to false.

When a character attacks another one, the pointers to both the attacking character
and victim character are stored in their respective sCharacter structures. The attacker
remembers the victim while the victim remembers the attacker. Also, when a character
uses a spell, the MSL spell number is stored, along with the spell’s target coordinates
and the type of character to target (CHAR_PC, CHAR_NPC, or CHAR_MONSTER).

Recall that characters have actions, and those actions have a set of associated animations.
The reason for storing the attacker, victim, and spell information (as well
as the following item information) is that a character’s action and animation must
be completed before the results of the action take place. Once an attacking character
swings a weapon, the results of the attack are calculated. The same goes for
spell; once a character casts a spell, the spell information in the sCharacter structure
is used to determine who, or what, is affected.

The same goes for using items; the pointer to the item used during a use item
action is stored, as well as the pointer to the ICS cCharItem structure of the character
(in order to remove the item if it was marked as USEONCE).

You’re about halfway through the structure. Now, you store the information about
the character’s artificial intelligence. You’ve already read about most of the following
data. You have the distance to follow or evade a character, along with the
pointer to the character to follow or evade.

For characters that use a bounding area, you store the minimum and maximum
coordinates, followed by the route information.

Moving on, you use a trio of variables to store a simple message that is overlaid on
top of a character during game-play (as illustrated in Figure 16.15).

Character messages help relate tiny bits of information, as Figure 16.15 shows.
To set a message, copy the message string (up to 128 characters) into the Message
buffer, set the amount of time (in milliseconds) to display the message, and assign
a color to the text to be displayed.

Finishing up the sCharacter class variables is the Graphics Core cObject object that
maintains the character’s mesh and animation. To enhance the visual appearance
of the characters, a separate mesh and object are used to represent a character’s
weapon. This weapon mesh and object are configured any time a new weapon is
equipped. Last comes the linked list pointers prev and next.

That’s a lot of information to store for each character, and to help the controller
prepare a structure every time a new character is added to the fray, the sCharacter
structure comes complete with a constructor and destructor in order to prepare
the data and help release its resources.

And that’s it! I told you sCharacter was a big structure, but it is nothing compared to
the character controller class that uses the structures.

posted on 2007-12-04 00:08 lovedday 閱讀(241) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一二三视频| 久久免费精品视频| 99热这里只有精品8| 欧美精品不卡| 亚洲一二三区视频在线观看| 日韩视频一区二区三区| 欧美日韩福利在线观看| 在线亚洲伦理| 午夜视频久久久久久| 国产自产v一区二区三区c| 美女免费视频一区| 欧美激情综合在线| 欧美一级日韩一级| 久久精品亚洲精品| 一本一本a久久| 亚洲欧美日韩精品久久久| 在线观看免费视频综合| 亚洲欧洲一级| 国产精品超碰97尤物18| 久久嫩草精品久久久久| 免费观看久久久4p| 午夜国产欧美理论在线播放| 久久久综合网| 亚洲欧美在线免费观看| 久久综合99re88久久爱| 亚洲一级影院| 久久香蕉国产线看观看av| 亚洲图片欧洲图片av| 久久精品一区二区三区中文字幕| 亚洲精选大片| 久久av老司机精品网站导航 | 一区二区三区国产精华| 国产视频久久久久| 亚洲国产精品女人久久久| 国产日韩精品一区二区三区在线| 亚洲国产欧美一区| 国内精品视频在线播放| 99视频在线观看一区三区| 亚洲第一色在线| 亚洲欧美在线免费| 99视频精品在线| 久久女同精品一区二区| 欧美一区二区三区四区在线观看| 欧美成人亚洲| 免费成人黄色片| 国产日韩精品一区二区| 亚洲作爱视频| 日韩一区二区精品葵司在线| 久久精品国亚洲| 欧美一区二区黄色| 国产精品高清免费在线观看| 亚洲福利专区| 亚洲国产精品久久久久秋霞蜜臀| 午夜精品福利视频| 亚洲欧美一区二区激情| 欧美剧在线观看| 亚洲日本aⅴ片在线观看香蕉| 一区在线视频观看| 欧美一级成年大片在线观看| 亚洲午夜一区二区| 欧美色另类天堂2015| 日韩午夜免费| 亚洲午夜91| 欧美亚洲成人网| 99视频一区二区| 亚洲亚洲精品三区日韩精品在线视频| 欧美精品免费观看二区| 亚洲精品影视| 亚洲午夜一区二区| 国产精品毛片a∨一区二区三区|国| 日韩一级大片在线| 亚洲字幕在线观看| 国产美女精品视频免费观看| 亚洲婷婷在线| 久久高清免费观看| 狠狠爱www人成狠狠爱综合网| 亚洲第一色在线| 老牛嫩草一区二区三区日本 | 亚洲人成在线观看网站高清| 久久激情视频| 欧美v日韩v国产v| 亚洲伦理自拍| 欧美日韩视频在线观看一区二区三区| 亚洲精品四区| 香蕉国产精品偷在线观看不卡| 国产酒店精品激情| 久久亚洲捆绑美女| 亚洲人成在线播放| 欧美亚洲免费| 亚洲二区三区四区| 欧美日韩精品一区二区天天拍小说| 一区二区三区四区国产| 久久av最新网址| 亚洲狠狠丁香婷婷综合久久久| 欧美大片在线看免费观看| 99视频一区| 巨乳诱惑日韩免费av| 亚洲精品一区二区三区蜜桃久 | 久热国产精品| 99国产精品99久久久久久| 久久精品国产久精国产思思| 激情丁香综合| 国产精品二区二区三区| 久久国产色av| 99国内精品久久久久久久软件| 久久国产欧美日韩精品| 亚洲日韩视频| 国产欧美精品va在线观看| 欧美高清在线播放| 香蕉国产精品偷在线观看不卡 | 亚洲欧美中文日韩在线| 精品99一区二区| 国产精品福利久久久| 久久在线免费观看| 亚洲欧美国产77777| 亚洲欧洲一区二区三区在线观看 | 久久深夜福利| 在线一区视频| 亚洲高清av在线| 国产欧美一区二区在线观看| 欧美成人a视频| 久久www免费人成看片高清| 99精品久久久| 亚洲国产精选| 久久久蜜桃精品| 欧美亚洲色图校园春色| 99国产精品久久久久久久成人热| 狠狠色香婷婷久久亚洲精品 | 久久精品亚洲国产奇米99| 一区二区三区 在线观看视频| 欧美电影免费观看| 六月丁香综合| 快射av在线播放一区| 久久精品国产在热久久 | 亚洲在线播放电影| 亚洲精品乱码| 亚洲国内自拍| 亚洲国产精品视频| 影音先锋在线一区| 狠狠色狠狠色综合日日tαg | 美女网站在线免费欧美精品| 午夜精品在线观看| 欧美一区三区二区在线观看| 亚洲网站在线| 亚洲尤物在线| 午夜日韩激情| 久久精品国产久精国产思思| 亚洲欧美网站| 久久国产精品网站| 久久久久国产一区二区三区四区| 欧美中文字幕在线| 久久久久久一区二区| 麻豆精品网站| 欧美精选在线| 国产精品外国| 海角社区69精品视频| 一区二区三区无毛| 亚洲精品国产精品乱码不99按摩| 亚洲欧洲日本在线| 一区二区动漫| 欧美一区二区在线免费观看| 久久精品成人一区二区三区| 久久男人av资源网站| 欧美激情视频网站| 亚洲乱码日产精品bd| 亚洲在线一区二区三区| 欧美一级二区| 蜜臀av国产精品久久久久| 欧美日韩精品中文字幕| 国产精品一区亚洲| 亚洲电影观看| 亚洲一区二区三区四区在线观看| 欧美一区免费| 欧美国产乱视频| 中国日韩欧美久久久久久久久| 亚洲欧美一区二区三区久久 | 亚洲欧美日韩中文视频| 久久综合久久综合久久| 欧美日韩视频第一区| 国内激情久久| 一区二区三区四区五区精品| 久久久精品一区二区三区| 亚洲激情六月丁香| 午夜久久黄色| 欧美日韩国产区| 国内一区二区三区在线视频| 亚洲美女啪啪| 久久综合精品国产一区二区三区| 欧美激情麻豆| 欧美专区在线| 国产精品成人免费| 亚洲破处大片| 久久久一本精品99久久精品66| 亚洲精品一区二区三区福利| 欧美在线观看视频| 欧美性猛交一区二区三区精品| 在线看日韩欧美| 久久国产主播精品| 一区二区三欧美| 欧美理论电影在线观看|