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

天行健 君子當自強而不息

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 閱讀(239) 評論(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>
            亚洲欧美中文日韩在线| 亚洲激情av在线| 亚洲一区二区三区777| 欧美日韩hd| 中国成人亚色综合网站| 99riav久久精品riav| 国产精品高潮呻吟久久av无限 | 美女999久久久精品视频| 亚洲国产日本| 99国内精品久久| 国产精品日日摸夜夜添夜夜av| 亚洲欧美文学| 欧美中文字幕视频| 亚洲黄一区二区| 亚洲免费av观看| 国产模特精品视频久久久久| 久久中文字幕导航| 欧美激情视频一区二区三区在线播放| 一级成人国产| 亚洲欧美视频在线观看| 亚洲高清一二三区| 亚洲国产成人av在线| 老色批av在线精品| 亚洲精品乱码| 亚洲愉拍自拍另类高清精品| 精品成人一区二区三区| 亚洲国产精品美女| 国产欧美日韩精品一区| 欧美黄色免费| 国产精品免费看片| 欧美电影在线播放| 国产精品户外野外| 欧美国产日韩一区二区| 国产精品亚洲不卡a| 欧美激情第3页| 国产视频精品免费播放| 亚洲欧洲精品成人久久奇米网| 国产精品资源在线观看| 亚洲精品国产精品国自产在线| 国产欧美亚洲视频| 亚洲精品人人| 亚洲国产日韩一区二区| 亚洲欧美国产高清va在线播| 亚洲最新视频在线| 久久视频免费观看| 久久国产精品高清| 欧美体内she精视频在线观看| 欧美岛国激情| 国产一区二区三区网站| 在线一区二区三区四区| 99精品国产在热久久| 久久精品一区蜜桃臀影院| 性欧美暴力猛交69hd| 欧美日韩免费一区二区三区| 欧美大成色www永久网站婷| 国产综合在线视频| 亚洲欧美国产精品va在线观看| 亚洲深夜福利| 欧美日本亚洲韩国国产| 亚洲第一黄色网| 亚洲第一精品夜夜躁人人躁| 久久国产精品高清| 亚洲欧美激情精品一区二区| 欧美日韩国产综合久久| 亚洲黄色在线看| 亚洲精品视频免费| 欧美精品一区二区精品网 | 午夜综合激情| 国产精品久久久久国产a级| 99视频有精品| 在线一区欧美| 国产精品va| 亚洲天堂成人| 欧美一区二区三区喷汁尤物| 国产精品乱子久久久久| 亚洲性图久久| 久久精品夜夜夜夜久久| 国产视频一区二区在线观看| 欧美一区二区三区四区夜夜大片 | 欧美呦呦网站| 国产午夜久久久久| 久久免费视频网| 欧美黄色片免费观看| 亚洲精品视频在线看| 欧美激情一二区| 99热免费精品在线观看| 先锋影音久久久| 国内精品伊人久久久久av影院| 久久九九免费视频| 亚洲国产欧美日韩另类综合| 亚洲乱码国产乱码精品精可以看| 欧美日本三区| 亚洲一区尤物| 欧美国产日韩一区二区| 99热在这里有精品免费| 国产欧美日韩91| 美女网站久久| 亚洲深夜av| 母乳一区在线观看| 宅男66日本亚洲欧美视频| 国产农村妇女毛片精品久久麻豆| 久久精品视频播放| 亚洲精品久久久一区二区三区| 亚洲一区在线播放| 一区二区三区亚洲| 欧美视频久久| 久久这里有精品15一区二区三区| 亚洲精品在线三区| 久久久视频精品| 一道本一区二区| 韩国av一区二区三区在线观看| 欧美精彩视频一区二区三区| 亚洲午夜在线观看视频在线| 欧美高清视频在线| 久久av红桃一区二区小说| 亚洲精品一区在线| 国内成人精品视频| 欧美日韩一区二区在线视频| 久久亚洲私人国产精品va| 一区二区三区波多野结衣在线观看| 久久青青草原一区二区| 亚洲私人影院在线观看| 91久久夜色精品国产九色| 国产日韩欧美视频在线| 欧美日韩在线播放三区四区| 久久久噜噜噜久久| 香蕉亚洲视频| 在线午夜精品| 日韩一区二区免费看| 亚洲国产成人在线视频| 欧美插天视频在线播放| 久久久精品午夜少妇| 欧美一区二区成人| 亚洲伊人伊色伊影伊综合网| 亚洲另类视频| 亚洲国产视频a| 一区二区三区在线高清| 国产日韩精品视频一区| 国产伦精品一区二区三区免费 | 免费成人av在线| 久久久久久久成人| 久久黄色影院| 欧美一区免费视频| 欧美与欧洲交xxxx免费观看| 亚洲资源av| 亚洲一区在线观看视频| 亚洲一区二区三区四区五区午夜 | 久久久91精品| 久久精品导航| 久久精品一二三区| 久久精品一区中文字幕| 久久蜜桃av一区精品变态类天堂| 久久成人在线| 老司机免费视频一区二区| 久久久91精品国产一区二区精品| 欧美中文字幕不卡| 久久久噜噜噜久久中文字免| 久久视频在线免费观看| 欧美成人午夜免费视在线看片| 欧美成人精品高清在线播放| 亚洲成人资源| 国产欧美大片| 国产在线一区二区三区四区| 一区二区三区在线视频播放| 亚洲国产乱码最新视频| 亚洲伦伦在线| 午夜精品短视频| 另类专区欧美制服同性| 亚洲高清电影| 亚洲午夜国产成人av电影男同| 亚洲欧美日韩综合一区| 久久久之久亚州精品露出| 欧美黄色aaaa| 国产女主播一区| 亚洲黄色在线观看| 亚洲影院在线观看| 久久久久国色av免费观看性色| 欧美激情91| 亚洲午夜精品| 欧美va亚洲va国产综合| 国产精品久久久久久久久久妞妞| 国产在线视频欧美| 一区二区三区日韩| 久久久久久香蕉网| 日韩视频免费观看| 久久国产精品亚洲va麻豆| 欧美精品大片| 国内精品久久久久影院薰衣草 | 国产精品高清在线| 黄色成人av网站| 亚洲一区二区毛片| 欧美激情国产高清| 欧美一区二区三区在线观看| 欧美久久久久久蜜桃| 韩国一区电影| 亚洲天堂免费观看| 欧美成人视屏| 久久久av毛片精品| 国产麻豆成人精品| 亚洲视频欧美视频|