??xml version="1.0" encoding="utf-8" standalone="yes"?>久久不见久久见免费视频7,99久久国产亚洲高清观看2024 ,无码人妻久久一区二区三区蜜桃http://www.shnenglu.com/ming81/category/15290.htmlzh-cnSun, 18 Dec 2016 21:13:20 GMTSun, 18 Dec 2016 21:13:20 GMT60(搬运?Mangos代码阅读 http://www.shnenglu.com/ming81/archive/2016/12/16/214503.html点点滴滴点点滴滴Fri, 16 Dec 2016 03:28:00 GMThttp://www.shnenglu.com/ming81/archive/2016/12/16/214503.html

逻辑层: cWorld实现了wow的WorldQ所有的逻辑处理
  MaNGOS 下蝲Q编译,配置和运行的基本步骤 下蝲和安装msysgitQ用于代码管理我使用的是Git-1.6.5.1-preview20091022.exe 
  下蝲和安装tortoisegitQ用于代码管理我使用的是TortoiseGit-1.3.2.0-32bit.msi 
  使用git://github.com/mangos/mangos.gitQ从github提取mangos代码 
  采用Git GUI工具的Clone Existing RepositoryQ得?mangos代码Q我的是9560Q安装UDB参考这Q?nbsp;
  使用git://github.com/scriptdev2/scriptdev2.gitQ从github提取scriptdev2代码 
  采用Git GUI工具的Clone Existing RepositoryQ得?scriptdev2代码. 
  ~译mangos我用的是VC9,打开mangoswinmangosdVC90.slnq行构造,构造完成后Q会得到mangosbinWin32_Debug文g?nbsp;
  ~译scriptdev2我用的是VC9,打开mangoswinscriptdev2VC90.slnq行构造,构造完成后Q会得到scriptdev2binWin32_Debug文g夹也可参?nbsp;
  pandore 
  拯mangossrcmangosd目录下的mangosd.conf.dist.in为mangosbinWin32_Debugmangosd.conf 
  拯mangossrcrealmd目录下的realmd.conf.dist.in为mangosbinWin32_Debugrealmd.conf 
  从http://www.wowtaiwan.com.tw/下蝲和安装台服WOWQƈ升到最新版本我使用的是台服WOW 3.3.2 build 11403 
  Q采用MaNGOS的工具ad从wow的MPQ中抽取mapQ得到的所有的map数据文gQ文件命名规范ؓmap_idQ?位) tileYQ?位) tileXQ?位).mapQ如文g名ؓ0002035.mapQ代表的是Azeroth(地图id?00Qtile坐标?35,20). 注:WOW客户端的Tile对应mangos中的gridQWOW客户端的Chunk对应mangos中的cell(1cell = 4 chunk) 
  按照常规程Q包括徏立数据库和配|服务器Q把服务器跑hQ用account create zzh1234567 zzh1234567 创徏一个̎P使用account set gmlevel zzh1234567 3讄U用?nbsp;
  配置好客L后,q行WOWQ顺利登陆,呵呵 
  通过安装UDB来丰富场景FULL DB 9560 : HEREQ参考这Q在我安装DB9560的时候,发现Mangos在LoadCreatureAddons的时候,加蝲creature template addons出错QMangos只要求creature template addons?个字D,而creature template addons?个字D|现在只是单地跌LoadCreatureAddons的调?nbsp;
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src= 
q行Mangos Q运行Mangos一节过期,是以前我针对国服3.1.3版本q行的安装配|) Q采用MaNGOS的工具ad从wow的MPQ中抽取mapQ得到的所有的map数据文gQ文件命名规范ؓmap_idQ?位) tileYQ?位) tileXQ?位).mapQ如文g名ؓ0002035.mapQ代表的是Azeroth(地图id?00Qtile坐标?35,20). 注:WOW客户端的Tile对应mangos中的gridQWOW客户端的Chunk对应mangos中的cell(1cell = 4 chunk) 
  配置好客L后,q行WOWQ顺利登陆,呵呵 
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src= 
Mangos代码阅读 
  Mangos?3个工E?nbsp;
  使用?个外部工具库Q分别是Q?跨^台的|络通讯框架The ADAPTIVE Communication Environment (ACE) 
  压羃库zlib 
  Socket通信?C++ Sockets Library (使用在realmd工程中,和用在Mangosd工程中的RASocketQ负责处理Remote Administration其他地方没有使用到这个C++ Sockets Library Q发现在C++ Sockets Library的TcpSocket::Open中存在一个问题,在n = connect(s, ad, ad);语句执行后,如果n=-1QC++ Sockets Library会检是否ERR为WSAEWOULDBLOCKQ否则表C成功,但在动态库中用TcpSocket的时候,我发现n = connect(s, ad, ad);语句执行后,n=-1QERR会ؓ0Q这个时候连接也是成功了Q但TcpSocket::Open会当做不成功处理我发现这个问题,但没有时间去探究原因Q也许ƈ不是一个问?nbsp;
  C++的ƈ行编E模板库Threading Building Blocks Qtbb ?tbbmallocQ?nbsp;
  Mangos的实现分为:d服务器(realmdQ和世界服务器(mangosd+gameQrealmd和mangosq了Mangos公共库(sharedQ?nbsp;
  工程shared 
  提供了通用功能Q包括了数据库的装c,实现了对MySql的访问,同样Q我们可以编写派生类来支持其他的数据?nbsp;
  工程script 
  提供了脚本接口,q实C单的几个脚本Q封装ؓDLLQ提供给game使用Q具体可参考:MaNGOS脚本接口 
  通过使用不同的脚本DLL来替换share的这个DLL,可以让gameh更强的AIScriptDev2 是一个这L库ScriptDev2 is a replacement for the Script Library that comes with MaNGOS( http://www.getmangos.com ) written in C++ and is compatible with Windows and Linux. It provides scripts for NPCs, Boss events, and Items currently. Once ScriptDev2 is compiled it is automatically run by MaNGOS on server startup. 
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=

工程mangosd 
  mangos是世界服务器的管理器Q负责初始化工作和启动世界服务器各层的线E,q些工作主要是由cMaster来实现具体是Q?使用三个数据库对象WorldDatabase和CharacterDatabase和loginDatabaseQ初始化三大数据库:World Database和Character Database和login DatabaseQƈ为每个数据库的访问都启动一个DB delay threads具体的数据库操作功能都是由Mangos公共库shared来提?nbsp;
  调用sWorld.SetInitialWorldSettingsQ对Worldq行初始化,包括加蝲所有的游戏数据和初始化各种更新定时器和邮g定时器,q有些其他的初始化工作类World的成员函数SetInitialWorldSettings调用成员函数LoadConfigSettings解析mangosd.confQ解析后内容攑օuint32 m_configs[CONFIG_VALUE_COUNT]?nbsp;
  加蝲的游戏数据有Q?nbsp;
  DBC数据 
  Objects数据 
  Spells数据 
  Pooling数据 
  Game Event数据 
  loot数据 
  技能数?nbsp;
  所有其他的游戏数据Q包括Waypoints和Trainers{等{?nbsp;
  脚本数据 
  其他的初始化工作? 
  初始化MapManagerQ启动Map System 
  初始化BattlegroundsQ启动BattleGround System 
  初始化DailyQuestResetTime 
  初始化sGameEventMgrQStarting Game Event system 
  cMaster启动WorldRunnableQ开始游戏逻辑Heartbeat for the WorldQ由Master创徏Qƈ讄U程为最高优先 
  cMaster启动CliRunnableQCommand Line Interface handling threadQ由Master创徏CliRunnableq行时候会生成一个WorldDatabaseU程Q在接收到输入后会调用sWorld.QueueCliCommand把Cmd攑օ到World::cliCmdQueue?nbsp;
  mangosd的线Ed有(1+3+1+1+1+2 +1 =10Q?0个线E?ȝEMaster 
  2个网l线EReactorRunnableQ可配置数目Q(|络层) 
  一个WorldU程Q逻辑层) 
  三个DBU程Q数据层Q?nbsp;
  一个CLIU程Q输入层Q,q行时候会生成一个WorldDatabaseU程 
  一个RAU程Q管理层Q?nbsp;
  一个freeze catcher U程Q可选) 
  工程g3dliteQ游戏逻辑层的底层?nbsp;
  工程frameworkQ系l框?nbsp;
  工程realm 
  负责登陆和选择游戏服务器,q行负蝲均衡用到了C++ Sockets Libraryq行d处理Q采用select I/O模型实现了Wow, Mangosd时的SRP6认证客户端作为它的clientq接到realm server认证和选择了mangos server断开 而mangos server和realm server则不q行q接Q只是通过数据库交互数据:mangos server把自q状态和拥有的角色数攑օ库中realm server会读取数据库中的q些信息来获知mangos server的状?数据库realm的realmlist表保存了realm的列?nbsp;
  realm通过如下事g处理函数来负责登陆和选择游戏服务?nbsp;
  const AuthHandler table[] = 
  { 
  { AUTH_LOGON_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleLogonChallenge }, 
  { AUTH_LOGON_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleLogonProof }, 
  { AUTH_RECONNECT_CHALLENGE, STATUS_CONNECTED, &AuthSocket::_HandleReconnectChallenge}, 
  { AUTH_RECONNECT_PROOF, STATUS_CONNECTED, &AuthSocket::_HandleReconnectProof }, 
  { REALM_LIST, STATUS_AUTHED, &AuthSocket::_HandleRealmList }, 
  { XFER_ACCEPT, STATUS_CONNECTED, &AuthSocket::_HandleXferAccept }, 
  { XFER_RESUME, STATUS_CONNECTED, &AuthSocket::_HandleXferResume }, 
  { XFER_CANCEL, STATUS_CONNECTED, &AuthSocket::_HandleXferCancel } 
  }; d处理Q?nbsp;
  userd到realm serverq行w䆾认证Qƈ选择d上哪个mangos serveruserd到mangos server后,不再和realm server交互 
  参考: Wow 服务器解?nbsp;
  工程game 
  gameQ是Mangos的核心代码,|络层和逻辑层代?采用了ACE反应?Reactor)模式Q?nbsp;
  |络层: WorldSocket Q负责网lIO,而类WorldSession负责逻辑处理WorldSocket和WorldSession分别在独立的U程ReactorRunnable和WorldRunnable中运行,使用WorldSession中的消息队列_recvQueue来进行数据缓冲在WorldSocket接收到网咯输入后Q会调用m_Session->QueuePacket (new_pct);把网l包攑օWorldSession的_recvQueue所以,可以看到WorldSocket 是Mangos game的网l层Q而WorldSession是逻辑处理层WorldSocketMgr是网l层的一个管理器Q它负责指派WorldSocket归哪个ReactorRunnable理QMangos可创建多个ReactorRunnableQ缺省是2个) 
  WorldSocketMgrQManages all sockets connected to peers and network threadsQ管理所有的q接WorldSocketWorldSocketMgr的WorldSocketMgr::StartNetwork?085Q缺省)端口q行侦听逻辑处理的@环是在World::Update中@环处理包括: 
  h更新定时?nbsp;
  h游戏定时器和处理游戏关闭 
  处理日常d 
  处理拍卖 
  hSessionsWorld::UpdateSessions会调用所有WorldSession的WorldSession::Update在WorldSession::Update中进行逻辑处理 
  处理天气 
  huptime table 
  hObjectsQ包括mapsQtransportQcreaturesQ,Q, 
  h所有running battlegrounds 
  hSqlResultQueue, 逻辑层和数据层是通过Queue来进行异步操作的Q用了AsyncPQuery和SqlResultQueueQ?nbsp;
  处理怽U除 
  处理游戏事g 
  处理 Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" 
  处理InstanceSaveManager的刷?nbsp;
  调用World::ProcessCliCommandsQ处理CLI从cliCmdQueue取得cmdq行解析执行所有有效的CmdQ都可以在ChatHandler::getCommandTable中找?nbsp;
  cWorldSessionQ?cWorldSession负责逻辑处理 
  void WorldSession::SendPacket(WorldPacket const* packet) 负责发包l客LQ直接发包,没有输出~冲队列 
  在WorldSession::Update中进行逻辑处理World::UpdateSessions会调用所有WorldSession的WorldSession::Update 
  执行语句OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];得到opHandle 
  Ҏ得到的opHandleQ执?this->*opHandle.handler)(*packet); 
  WorldSession::HandlePlayerLogin处理玩家登陆游戏 
  构徏Player 
  Player::LoadFromDB从数据库中加载玩家数据在Player::LoadFromDB中会调用SetMap(MapManager::Instance().CreateMap(GetMapId() , this));加蝲当前player所在的map 
  Player::SetPosition在Playerq动的时候,改变位置Q保存处理夸?nbsp;
  cMap实现了一个state machineQ采用state patternl织了Gid?个state objectQInvalidStateQActiveStateQIdleStateQRemovalState 
  game中的理器有Q?ObjectMgr 
  mMangosStringLocaleMap 兌到mangos_string table 
  m_scriptNames 兌到tables: creature_template;gameobject_template;item_templat e;areatrigger_scripts;instance_template 
  mCreatureLocaleMap 兌到locales_creature table 
  mGameObjectLocaleMap兌到locales_gameobject table 
  mItemLocaleMap兌到locales_item table 
  mQuestLocaleMap –> locales_quest 
  mNpcTextLocaleMap –> locales_npc_text 
  mPageTextLocaleMap –> locales_page_text 
  mGossipMenuItemsLocaleMap –> locales_gossip_menu_option 
  mPointOfInterestLocaleMap –> locales_points_of_interest 
  … 
  对象cd?nbsp;
  对象的类层次如下Q所有的Object都由ObjectMgrq行理ObjectMgr以GUID方式Q管理了charactersQcreatureQitem_instanceQgameobjectQauctionhouseQmailQitem_textQcorpseQarena_teamQcharacter_equipmentsets 
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=

Player状?nbsp;
  /// Player state 
  enum SessionStatus 
  { 
  STATUS_AUTHED = 0, ///< Player authenticated (_player==NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage) 
  STATUS_LOGGEDIN, ///< Player in game (_player!=NULL, m_GUID == _player->GetGUID(), inWorld()) 
  STATUS_TRANSFER, ///< Player transferring to another map (_player!=NULL, m_GUID == _player->GetGUID(), !inWorld()) 
  STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, ///< _player!= NULL or _player==NULL && m_playerRecentlyLogout, m_GUID store last _player guid) 
  STATUS_NEVER ///< Opcode not accepted from client (deprecated or server side only) 
  }; 
  生物状?nbsp;
  enum DeathState 
  { 
  ALIVE = 0, 
  JUST_DIED = 1, 
  CORPSE = 2, 
  DEAD = 3, 
  JUST_ALIVED = 4, 
  DEAD_FALLING= 5 
  }; 
  玩家登陆 
  服务器端在连接打开后,会发SMSG_AUTH_CHALLENGE到客L客户端从服务器端发送回来的U子?SRP6 数据中生随机种子,生成 SHA1 字符Ԍ用这些数据生?CMSG_AUITH_SESSION 数据包,发送给服务端这个过E是没有l过加密?nbsp;
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  客户端发送SMSG_AUTH_SESSION到服务器 
  服务器处理SMSG_AUTH_SESSION 
  服务器发送SMSG_AUTH_RESPONSEl客L 
  服务器发送SMSG_ADDON_INFOl客L 
  服务器发送SMSG_CLIENTCACHE_VERSIONl客L 
  服务器发送SMSG_TUTORIAL_FLAGSl客L 
  packetl构 SMSG_AUTH_SESSION 是client packet有一个头部(ClientPktHeaderQ,后面是数据块 
  SMSG_AUTH_RESPONSE 是server packet有一个头部(ServicePktHeaderQ,后面是数据块 
  SMSG_AUTH_RESPONSE 的包l织 
  SMSG_AUTH_RESPONSE 的opcode?1EEQByteBuffer大小? + 4 + 1 + 4 + 1=11一个SMSG_AUTH_RESPONSE 的数据如下: 在构造了SMSG_AUTH_RESPONSE packet后,WorldSocket::SendPacket会根据SMSG_AUTH_RESPONSE packet构造出一个ServerPktHeaderQƈ对ServerPktHeader中的数据headerq行加密发送加密采用m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength()); WorldSocket::handle_input_header会对从客L接收来的数据q行解密Q解密采用m_Crypt.DecryptRecv ((uint8*) m_Header.rd_ptr (), sizeof (ClientPktHeader)); 
  角色枚D 玩家M服务器后Q从客户端发送SMSG_CHAR_ENUM到服务器 
  在服务器?nbsp;
  Ҏ{ "CMSG_CHAR_ENUM", STATUS_AUTHED, &WorldSession::HandleCharEnumOpcode }Q服务器会调用WorldSession::HandleCharEnumOpcode 
  WorldSession::HandleCharEnumOpcode会调用CharacterDatabase.AsyncPQueryQ进行异步查询后Q调用CharacterHandler::HandleCharEnumCallback 
  CharacterHandler::HandleCharEnumCallback会回头调用session->HandleCharEnum(result); 
  WorldSession::HandleCharEnumҎcharacters数据库的查询l果Q调用Player::BuildEnumDataQ加载角色数据,构造SMSG_CHAR_ENUMq回包,然后发送回客户?nbsp;
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=
  角色创徏 
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src= 
  角色的初始化装备在CharStartOutfit.dbc 
  角色的创建和选择的设|都?ChrRaces.dbc 
  角色的创建属性都在PlayercreateinfoQ包括出生地和出生属?nbsp;
  playercreateinfo_item表是创徏一个新人物Ӟ人物默认带的所有Item的表 
  playercreateinfo_spell表是创徏一个新人物Ӟ人物默认带的所有Spell的表 
角色删除 
  Mangos代码阅读 - 陈L - cp7618@yeah的博? src=



点点滴滴 2016-12-16 11:28 发表评论
]]>
(搬用?mangos新手教程 - 服务器配|文件中文说?/title><link>http://www.shnenglu.com/ming81/archive/2016/12/16/214497.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Fri, 16 Dec 2016 03:16:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/12/16/214497.html</guid><description><![CDATA[<div style="box-sizing: border-box; word-break: break-all; color: #333333; font-family: sans-serif; font-size: 24px; background-color: #ffffff;"></div><table border="0" style="box-sizing: border-box; border-collapse: collapse; border-spacing: 0px; max-width: 100%; background-color: #ffffff; word-break: break-all; border-width: 0.05rem; border-style: solid; border-color: #eeeeee; color: #333333; font-family: sans-serif; font-size: 24px; table-layout: fixed;"><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; border-width: 0.05rem; border-style: solid; border-color: #eeeeee;"><div class="hltnlfx" id="blog_text" style="box-sizing: border-box; word-break: break-all;"><div style="box-sizing: border-box; word-break: break-all;"># MaNGOS Configuration file 服务器配|文件中文说?br style="box-sizing: border-box;" />ConfVersion=2007071001<br style="box-sizing: border-box;" /># RealmID must match the realmlist (国度ID 必牒?攘斜砝锩娴南?<br style="box-sizing: border-box;" />RealmID = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 0 NORMAL 1 PVP 4 NORMAL 6 RP 8 RPPVP(服务器类?<br style="box-sizing: border-box;" />GameType = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 扩展柚每 ?# 0 不检查扩展地?不允许创建新U族,忽略账号的扩展设|?<br style="box-sizing: border-box;" /># 默认: 1 (如果客户端支持扩展且账号拥有扩展权限,卛_怋用新U族及访问新地图.)<br style="box-sizing: border-box;" />Expansion = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#==================================服务端添加的参数===========================================================================<br style="box-sizing: border-box;" />#世界聊天消费(默认?G/?<br style="box-sizing: border-box;" />sjxf=10000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#初始人物金币Q以分ؓ单位.<br style="box-sizing: border-box;" /># 默认: 8<br style="box-sizing: border-box;" />mymoney = 1000000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 自动公告旉间隔 1=1U?br style="box-sizing: border-box;" />AutoBroadcastInterval=10 <br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#初始怪物怽停留旉<br style="box-sizing: border-box;" />#单位/U?nbsp;<br style="box-sizing: border-box;" /># 默认: 60<br style="box-sizing: border-box;" />MyCropseDelay = 60<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#人物复活虚弱旉<br style="box-sizing: border-box;" />#默认: 1000<br style="box-sizing: border-box;" />Playerdietime = 1000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#初始出生人物{<br style="box-sizing: border-box;" /># 默认: 1<br style="box-sizing: border-box;" />LevelFirst = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#加血技能治疗倍数<br style="box-sizing: border-box;" />aurahealing = 5<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#法术技能伤宛_数<br style="box-sizing: border-box;" />tmpDamage = 5<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#物理技能伤宛_数(数字别改的太大了)<br style="box-sizing: border-box;" />pdaDamage = 2<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#猎h闪避率设|?数字大闪避率越?<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />Rate.Hunter_Max.Dodge=31.4<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#盗贼闪避率设|?数字大闪避率越?<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />Rate.Roguer_Max.Dodge=19.5<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#其他职业闪避率设|?数字大闪避率越?<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />Rate.Else_Max.Dodge=27<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#==================================服务端添加的参数===========================================================================<br style="box-sizing: border-box;" /># 数据目录讄?br style="box-sizing: border-box;" /># 重要说明Q数据目录需要放在引号里面,因ؓ字符串可能包含空?br style="box-sizing: border-box;" /># DataDir = "@MANGOSD_DATA@" //q个是默认目?br style="box-sizing: border-box;" />DataDir = "./"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Logs directory setting.<br style="box-sizing: border-box;" /># Important: Logs dir must exists, or all logs be disable<br style="box-sizing: border-box;" /># Default: "" - no log directory prefix, if used log names isn't absolute path then logs will be stored in current directory for run program.<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />LogsDir = ""<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 世界服务器的数据库连接设|?br style="box-sizing: border-box;" /># 格式Q主机地址(域名或IPQ?端口;用户?密码;数据库名U?br style="box-sizing: border-box;" />#           .;somenumber;username;password;database - use named pipes at Windows<br style="box-sizing: border-box;" />#                 Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini<br style="box-sizing: border-box;" />#           .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux<br style="box-sizing: border-box;" />#                 Unix sockets: experimental, not tested<br style="box-sizing: border-box;" />LoginDatabaseInfo = "127.0.0.1;3306;root;netspace;realmd"<br style="box-sizing: border-box;" />WorldDatabaseInfo = "127.0.0.1;3306;root;netspace;mangos"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 讄最高ping数据库的旉间隔(分钟)<br style="box-sizing: border-box;" />MaxPingTime = 30<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># DBC 语言讄<br style="box-sizing: border-box;" />#8 p<br style="box-sizing: border-box;" />#4 韩语<br style="box-sizing: border-box;" />#3 法语<br style="box-sizing: border-box;" />#3 徯<br style="box-sizing: border-box;" />#4 中文<br style="box-sizing: border-box;" />#5 台湾J体<br style="box-sizing: border-box;" />#6 西班牙语<br style="box-sizing: border-box;" />#7 俄语<br style="box-sizing: border-box;" />#8 未知 <br style="box-sizing: border-box;" /># 8 = Unknown<br style="box-sizing: border-box;" /># 9 = Unknown<br style="box-sizing: border-box;" /># 10 = Unknown<br style="box-sizing: border-box;" /># 11 = Unknown<br style="box-sizing: border-box;" /># 12 = Unknown<br style="box-sizing: border-box;" /># 13 = Unknown<br style="box-sizing: border-box;" /># 14 = Unknown<br style="box-sizing: border-box;" /># 15 = Unknown<br style="box-sizing: border-box;" /># 255 = 自动?(默认)<br style="box-sizing: border-box;" />DBC.Locale = 255<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 启用GM命o记录-所有的SQL代码都将被记录在日记文g?br style="box-sizing: border-box;" /># All commands are written to a file: YYYY-MM-DD_logSQL.sql<br style="box-sizing: border-box;" /># If a new day starts (00:00:00) then a new file is created - the old<br style="box-sizing: border-box;" /># file will not be deleted.<br style="box-sizing: border-box;" /># 0 - 不记?br style="box-sizing: border-box;" /># 1 - 记录<br style="box-sizing: border-box;" />LogSQL = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 服务器控制台记录昄的?br style="box-sizing: border-box;" /># 0 = 最? 1 = 基础和错? 2 = 详细; 3 = 完全或侦?br style="box-sizing: border-box;" /># 默认: 0<br style="box-sizing: border-box;" /># 推荐: 1<br style="box-sizing: border-box;" />LogLevel = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 记录文g 的名?br style="box-sizing: border-box;" /># 文g名ؓI?则不创徏记录文g,? LogFile = <br style="box-sizing: border-box;" /># 默认: ""<br style="box-sizing: border-box;" />LogFile = "Server.log"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Logfile with timestamp of server start in name<br style="box-sizing: border-box;" /># Default: 0 - no timestamp in name<br style="box-sizing: border-box;" />#           1 - add timestamp in name in form Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />LogTimestamp = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 记录文g的记录?br style="box-sizing: border-box;" /># 0 = 最? 1 = 基础和错? 2 = 详细; 3 = 完全或侦?br style="box-sizing: border-box;" /># 默认: 0<br style="box-sizing: border-box;" />LogFileLevel = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Log filters<br style="box-sizing: border-box;" /># 0 (default) - include in log if log level permit, 1 - not include with any log level<br style="box-sizing: border-box;" />LogFilter_TransportMoves = 0<br style="box-sizing: border-box;" />LogFilter_CreatureMoves = 0<br style="box-sizing: border-box;" />LogFilter_VisibilityChanges = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 控制C息的颜色 (格式: "正常颜色 详情颜色 debug颜色 错误颜色)<br style="box-sizing: border-box;" /># 颜色: 0-黑色, 1-U? 2-l? 3-? 4-? 5-品红, 6-青绿, 7-灰色, <br style="box-sizing: border-box;" /># 8-? 9-淡红, 10-淡绿, 11-淡蓝, 12-淡品U? 13-淡青l? 14-白色<br style="box-sizing: border-box;" /># 默认: "" 无颜?白色)<br style="box-sizing: border-box;" /># 例如: "13 7 11 9" <br style="box-sizing: border-box;" />LogColors = "13 7 11 9"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Packet logging file for the worldserver.<br style="box-sizing: border-box;" /># Default: ""<br style="box-sizing: border-box;" />WorldLogFile = "world.log"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 记录数据库错误的文g?br style="box-sizing: border-box;" /># 默认: ""<br style="box-sizing: border-box;" />DBErrorLogFile = "DBErrors.log"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 记录GM命o使用情况?记录文g?br style="box-sizing: border-box;" /># 默认: "" (止) 允许?例如: "GMcommand.log"<br style="box-sizing: border-box;" />GmLogFile = ""<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Log file of RA commands, "" for disable<br style="box-sizing: border-box;" /># Default: "Ra.log"<br style="box-sizing: border-box;" />RaLogFile = ""<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 在多U程pȝ 使用U程MASK(只在Windowspȝ下?<br style="box-sizing: border-box;" /># 默认: 0 (操作pȝ来选择)<br style="box-sizing: border-box;" /># 举例: 数字<br style="box-sizing: border-box;" />UseProcessors = 80<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># q程优先权设|?只在Windowspȝ下?<br style="box-sizing: border-box;" /># 0 (正常优先?<br style="box-sizing: border-box;" /># 默认: 1 (高优?<br style="box-sizing: border-box;" />ProcessPriority = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#发送到客户端的更新数据包的压羃U别(1?)<br style="box-sizing: border-box;" /># 默认: 1 (速度?不压~? <br style="box-sizing: border-box;" /># 9 (最好的压羃) <br style="box-sizing: border-box;" />Compression = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 除GM之外 游戏最大在U玩家数限制<br style="box-sizing: border-box;" /># 默认: 100<br style="box-sizing: border-box;" />PlayerLimit = 100<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 玩家获得l验能升到的最高等U?必须?1 ?255).<br style="box-sizing: border-box;" /># 不徏议修?用默认的 60 过60 可能影响游戏q<br style="box-sizing: border-box;" /># 默认: 60<br style="box-sizing: border-box;" />MaxPlayerLevel = 70<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 天气pȝ开?br style="box-sizing: border-box;" /># 默认: 1 (开)<br style="box-sizing: border-box;" />#           0 (?<br style="box-sizing: border-box;" />ActivateWeather = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 是否忽略q入副本的等U需?br style="box-sizing: border-box;" />#       1 (true)<br style="box-sizing: border-box;" /># 默认: 0 (?<br style="box-sizing: border-box;" />IgnoreATLevelRequirement = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 玩家最多可以学?商业技?br style="box-sizing: border-box;" /># 默认: 2<br style="box-sizing: border-box;" /># 最? 9<br style="box-sizing: border-box;" />MaxPrimaryTradeSkill = 2 <br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 建立公会所需的最玩家签名个?(0..9).<br style="box-sizing: border-box;" /># 默认: 9<br style="box-sizing: border-box;" />MinPetitionSigns = 9<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 队成员在生物死?获得l验?最大距?同怪物的距?<br style="box-sizing: border-box;" /># 默认: 74<br style="box-sizing: border-box;" />MaxGroupXPDistance = 74<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 队成员在生物死?获得l验?最大等U差(同怪物的等U?<br style="box-sizing: border-box;" /># 默认: 10<br style="box-sizing: border-box;" />MaxGroupXPLevelDiff = 10<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 是否q行?个帐?建立?个不同阵营的角色 GM号ؓ始终?允许<br style="box-sizing: border-box;" /># 默认: 0 (不允?<br style="box-sizing: border-box;" /># 1 (允许)<br style="box-sizing: border-box;" />AllowTwoSide.Accounts = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 是否允许 不同阵营间的 聊天 频道聊天 l队 交易<br style="box-sizing: border-box;" /># 默认: 0 (不允?<br style="box-sizing: border-box;" />#     1 (允许)<br style="box-sizing: border-box;" />AllowTwoSide.Interaction.Chat = 0<br style="box-sizing: border-box;" />AllowTwoSide.Interaction.Channel = 0<br style="box-sizing: border-box;" />AllowTwoSide.Interaction.Group = 0<br style="box-sizing: border-box;" />AllowTwoSide.Interaction.Guild = 0<br style="box-sizing: border-box;" />AllowTwoSide.Interaction.Trade = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 是否?在线玩家列表 里显C敌寚w营玩?br style="box-sizing: border-box;" /># 默认: 0 (不允?<br style="box-sizing: border-box;" /># 1 (允许)<br style="box-sizing: border-box;" />AllowTwoSide.WhoList = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 防刷屏开?多少条违规信息激zM?br style="box-sizing: border-box;" />#           0 (为关闭防刷屏)<br style="box-sizing: border-box;" /># 默认: 10<br style="box-sizing: border-box;" />ChatFlood.MessageCount = 10<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 防刷屏开?多少U间隔开始计ؓq规信息<br style="box-sizing: border-box;" /># 默认: 1 (U?<br style="box-sizing: border-box;" />ChatFlood.MessageDelay = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 防刷屏开?言旉.<br style="box-sizing: border-box;" /># 默认: 10 (U?<br style="box-sizing: border-box;" />ChatFlood.MuteTime = 10<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># GM默认是否接受玩家的悄悄话.<br style="box-sizing: border-box;" /># 默认: 0 (false)<br style="box-sizing: border-box;" />#     1 (true) <br style="box-sizing: border-box;" />GM.WhisperingTo = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 当GM讄为可见时 是否在玩家列表显CGM.<br style="box-sizing: border-box;" /># 默认: 0 (false)<br style="box-sizing: border-box;" />#     1 (true) <br style="box-sizing: border-box;" />GM.InGMList = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 是否昄GM名单 (if visible).<br style="box-sizing: border-box;" /># 默认: 0 (false)<br style="box-sizing: border-box;" />#           1 (true) <br style="box-sizing: border-box;" />GM.InWhoList = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># GM模式在登陆时状?br style="box-sizing: border-box;" />#           0 (L?<br style="box-sizing: border-box;" />#           1 (L开) <br style="box-sizing: border-box;" /># 默认: 2 (上次d时状?<br style="box-sizing: border-box;" />GM.LoginState = 2<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 如果打开 则在GM LOG里记录GM的交易和交易信息<br style="box-sizing: border-box;" />#           0 (不记?<br style="box-sizing: border-box;" /># 默认: 1 (记录)<br style="box-sizing: border-box;" />GM.LogTrade = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 团队可见模式<br style="box-sizing: border-box;" /># 默认: 0-标准讄Q只有同一个团队的队友才可?00%侦测隐Ş玩家<br style="box-sizing: border-box;" />#    1-只有同一个小队的队友才可?00%侦测隐Ş玩家<br style="box-sizing: border-box;" />#    2-同一阵营的队友可?00%侦测隐Ş玩家<br style="box-sizing: border-box;" />Visibility.GroupMode = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 不同的游戏物体之间的可见?nbsp;<br style="box-sizing: border-box;" /># 最大设|? ~ 166<br style="box-sizing: border-box;" /># 最设|以物体为准<br style="box-sizing: border-box;" /># 默认: 66 (单元)<br style="box-sizing: border-box;" />#<br style="box-sizing: border-box;" /># Min limit is max aggro radius (45) * Rate.Creature.Aggro<br style="box-sizing: border-box;" />Visibility.Distance.Creature    = 66<br style="box-sizing: border-box;" />Visibility.Distance.Player       = 66<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># gameobject, dynobject, bodies, corpses, bones<br style="box-sizing: border-box;" /># Min limit is iteraction distance (5)<br style="box-sizing: border-box;" />Visibility.Distance.Object       = 66<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># visible distance for player in flight<br style="box-sizing: border-box;" /># Min limit is 0 (not show any objects)<br style="box-sizing: border-box;" />Visibility.Distance.InFlight    = 66<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Visibility grey distance for creatures/players (fast changing obects)<br style="box-sizing: border-box;" />#     addition to appropriate object type Visibility.Distance.* use in case visibility removing to object (except corpse around distences)<br style="box-sizing: border-box;" />#     If ?is distance and G is grey distance then object make visible if distance to it <= D but make non visible if distance > D+G<br style="box-sizing: border-box;" /># Default: 1 yard<br style="box-sizing: border-box;" />Visibility.Distance.Grey.Unit = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Visibility grey distance for dynobjects/gameobjects/corpses/creature bodies<br style="box-sizing: border-box;" /># <br style="box-sizing: border-box;" /># Default: 10 yards<br style="box-sizing: border-box;" />Visibility.Distance.Grey.Object = 10<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 如果邮寄物品延时多久收到Q?<br style="box-sizing: border-box;" /># 默认: 3600 U?(1 hour)<br style="box-sizing: border-box;" />MailDeliveryDelay = 3600<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 每日消息。当玩家q入游戏的时候显C在聊天H口的信息?br style="box-sizing: border-box;" />Motd = "Welcome to the Massive Network Game Object Server."<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># Health and power regeneration and rage income from damage.<br style="box-sizing: border-box;" />Rate.Health = 1;<br style="box-sizing: border-box;" />Rate.Mana = 1;<br style="box-sizing: border-box;" />Rate.Rage.Income = 1;<br style="box-sizing: border-box;" />Rate.Rage.Loss = 1;<br style="box-sizing: border-box;" />Rate.Focus = 1;<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 物品的掉率倍数<br style="box-sizing: border-box;" />#poor,白色Q?br style="box-sizing: border-box;" />#common,普通;<br style="box-sizing: border-box;" />#uncommon,|见?<br style="box-sizing: border-box;" />#rare,贵重的;<br style="box-sizing: border-box;" />#Epic,史诗;<br style="box-sizing: border-box;" />#Legendary,传说;<br style="box-sizing: border-box;" />#uest,d> <br style="box-sizing: border-box;" /># 默认: 1<br style="box-sizing: border-box;" /># Rate.Drop.Items = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Poor = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Common = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Uncommon = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Rare = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Epic = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quality.Legendary = 1<br style="box-sizing: border-box;" />Rate.Drop.Items.Quest = 1<br style="box-sizing: border-box;" />Rate.Drop.Money = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 杀?d,探烦地图 获得l验 乘以的倍数<br style="box-sizing: border-box;" /># 默认: 1<br style="box-sizing: border-box;" />Rate.XP.Kill     = 20<br style="box-sizing: border-box;" />Rate.XP.Quest = 30<br style="box-sizing: border-box;" />Rate.XP.Explore = 10<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 普?_英,E有精?BOSS,E有普通?的伤?乘以的倍数<br style="box-sizing: border-box;" /># 例如: 1.4 是 增加0.4倍攻M?br style="box-sizing: border-box;" />Rate.Creature.Normal.Damage = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.Elite.Damage = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.RAREELITE.Damage = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.WORLDBOSS.Damage = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.RARE.Damage = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 普?_英,E有精?BOSS,E有普通?的血?乘以的倍数<br style="box-sizing: border-box;" /># 例如: 1.4 是 增加0.4倍攻击血?br style="box-sizing: border-box;" />Rate.Creature.Normal.HP = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.Elite.HP = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.RAREELITE.HP = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.WORLDBOSS.HP = 1<br style="box-sizing: border-box;" />Rate.Creature.Elite.RARE.HP = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />#仇恨pLQ默?.1fQ即有超q第一仇恨者造成伤害110%者就转变d对象?br style="box-sizing: border-box;" />#注意Q必ȝ到数点后1?br style="box-sizing: border-box;" /># 默认: 1.1f<br style="box-sizing: border-box;" />AggroThreat = 1.1f<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># _֊条增长倍数 (1 - normal, 2 - double rate, 0.5 - half rate, etc) from standard values<br style="box-sizing: border-box;" /># 游戏?br style="box-sizing: border-box;" />Rate.Rest.InGame = 1<br style="box-sizing: border-box;" /># 在旅馆下U时<br style="box-sizing: border-box;" />Rate.Rest.Offline.InTavernOrCity = 1<br style="box-sizing: border-box;" /># 在野外下U时<br style="box-sizing: border-box;" />Rate.Rest.Offline.InWilderness = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># IZ跌落伤害倍数<br style="box-sizing: border-box;" />Rate.Damage.Fall = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 拍卖 倍数<br style="box-sizing: border-box;" /># Rate.Auction.Time (拍卖旉倍率),Rate.Auction.Deposit(拍卖押金),Rate.Auction.Cut(拍卖上限)<br style="box-sizing: border-box;" />Rate.Auction.Time = 1<br style="box-sizing: border-box;" />Rate.Auction.Deposit = 1<br style="box-sizing: border-box;" />Rate.Auction.Cut = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 矿物 倍数<br style="box-sizing: border-box;" />#Rate.Mining.Next (采矿的几率倍数),Rate.Mining.Amount (产生矿最大最的倍数)<br style="box-sizing: border-box;" />Rate.Mining.Amount = 1<br style="box-sizing: border-box;" />Rate.Mining.Next = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 天赋点的升倍率<br style="box-sizing: border-box;" /># 默认: 1<br style="box-sizing: border-box;" />Rate.Talent = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 保存h旉 当生物死 当物体被打开或?br style="box-sizing: border-box;" />#           0 (保存?物体的刷新时间在|格卸蝲的时?<br style="box-sizing: border-box;" /># 默认: 1 (不在|格卸蝲的时候保存h/物体的刷新时?<br style="box-sizing: border-box;" />SaveRespawnTimeImmediately = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 技能熟l度提升几率(0..100)  <br style="box-sizing: border-box;" /># 默认: 100-75-25-0<br style="box-sizing: border-box;" />SkillChance.Orange = 100<br style="box-sizing: border-box;" />SkillChance.Yellow = 75<br style="box-sizing: border-box;" />SkillChance.Green = 25<br style="box-sizing: border-box;" />SkillChance.Grey = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 怪物自动d的范围乘以的倍数 或?关闭自动d<br style="box-sizing: border-box;" /># 0 - 关闭(0%)<br style="box-sizing: border-box;" /># 默认: 1 - 乘以100% <br style="box-sizing: border-box;" /># 1.5 - 乘以150%<br style="box-sizing: border-box;" />Rate.Creature.Aggro = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 控制台开?br style="box-sizing: border-box;" />#           0 - ?br style="box-sizing: border-box;" /># 默认: 1 - 开<br style="box-sizing: border-box;" />Console.Enable = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># q程控制台开?br style="box-sizing: border-box;" /># 默认: 0 - ?br style="box-sizing: border-box;" />#           1 - 开<br style="box-sizing: border-box;" />Ra.Enable = 0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 默认q程控制IP地址,0.0.0.0为所有IP皆可.<br style="box-sizing: border-box;" />Ra.IP = 0.0.0.0<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 默认q程控制台端?br style="box-sizing: border-box;" />Ra.Port = 3443<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># q程控制台连接到服务器所需要的GM{Q默认ؓ3Q管理员Q?br style="box-sizing: border-box;" />Ra.MinLevel = 3<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># t出用户Q如果他输入了错误的密码 Q仅限远E控制台Q?br style="box-sizing: border-box;" />Ra.Secure = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 最大速度限制倍率<br style="box-sizing: border-box;" /># 默认: 2 如果?则关闭检查加?br style="box-sizing: border-box;" />MaxOverspeedPings = 2<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 卸蝲Grids (如果里的内存够大,可以用,提高玩家W二ơ经q新Grids时候的速度)<br style="box-sizing: border-box;" /># P.S: Grids是地图上刷出来的东?玩家l过一个地?׃加蝲该地方的环境,d的时?卸载该地方的环?br style="box-sizing: border-box;" /># 默认: 1 ( 卸蝲 grids) 0 ( 不卸?grids)<br style="box-sizing: border-box;" />GridUnload = 1;<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 以下所有的旉讄都以毫秒为单位?br style="box-sizing: border-box;" /># 默认端口选择旉<br style="box-sizing: border-box;" />SocketSelectTime = 10000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 默认地图|格清理延迟<br style="box-sizing: border-box;" />GridCleanUpDelay = 300000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 默认地图更新间隔<br style="box-sizing: border-box;" />MapUpdateInterval = 100<br style="box-sizing: border-box;" /># 默认天气更新间隔<br style="box-sizing: border-box;" />ChangeWeatherInterval = 600000<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 默认玩家数据保存间隔<br style="box-sizing: border-box;" />PlayerSaveInterval = 900000<br style="box-sizing: border-box;" /># 默认世界服务器端?mangosd.exe 的端口)<br style="box-sizing: border-box;" />WorldServerPort = 8085<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 在mangos启动完毕后蜂鸣一?通常只在Unix nuxpȝ下工?<br style="box-sizing: border-box;" /># 默认: 1<br style="box-sizing: border-box;" />BeepAtStart = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 打开/关闭 VMmap 对视U和高度的推支?br style="box-sizing: border-box;" /># Default: 1 (true)<br style="box-sizing: border-box;" />#       : 0 (false)<br style="box-sizing: border-box;" />vmap.enableLOS = 1<br style="box-sizing: border-box;" />vmap.enableHeight = 1<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 不?VMap功能的地图ID<br style="box-sizing: border-box;" /># 地图ID之间?','分割<br style="box-sizing: border-box;" /># 如果有多个地图ID使用 "号包?br style="box-sizing: border-box;" />#vmap.ignoreMapIds = "369,0,1,530"<br style="box-sizing: border-box;" />#DeeprunTram 没有包含在地图中<br style="box-sizing: border-box;" />vmap.ignoreMapIds = "369"<br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /># 不进行视U推的技?br style="box-sizing: border-box;" /># 技能之间?','分割<br style="box-sizing: border-box;" />vmap.ignoreSpellIds = "7720"</div></div></td></tr></tbody></table><img src ="http://www.shnenglu.com/ming81/aggbug/214497.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-12-16 11:16 <a href="http://www.shnenglu.com/ming81/archive/2016/12/16/214497.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运?CritterAI官方文档译【An Introduction to NMGen?/title><link>http://www.shnenglu.com/ming81/archive/2016/11/08/214398.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Tue, 08 Nov 2016 13:18:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/11/08/214398.html</guid><description><![CDATA[<span style="font-family: Arial; color: #333333; background-color: #ffffff"><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">The purpose of NMGen is to generate navigation meshes from arbitrary source geometry. Features fall into two categories: Core and 'standard build'.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">NMGen用于Q意网D{化ؓ一个或多个NavMesh?其所有功能都包含于两个目录: Core(核心) ?'standard build'(普?;</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">The core features are located in the org.critterai.nmgen namespace and involve creating simplified polygon mesh data from detailed triangle-based source geometry. You can code your own build process from scratch using these features, but it will require a significant amount of work and detailed knowlege of all aspects of the process.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">核心功能位于nmgen命名I间下,与将复杂的三角Şmesh转化为简化的多边形mesh有关。你可以通过代码d重新规划生成q程(1)Q不q这里有很多事情要做Q而且你需要了解生成过E中各个斚w的实现细?2)?/span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">The standard build process implements a flexible, extendable build process suitable for use at design time. It takes care of many of the mundane details for you. Its features are implemented in the following namespaces:</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Common extentions: org.critterai.nmbuild</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Unity extensions: org.critterai.nmbuild.u3d.editor</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">普通生成流Eؓ了满编辑期的需要,被设计成可变的、可扩展的结构。它已经Z处理好了很多l枝末节的事?3)。普通功能位于以下的命名I间中:</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">通用扩展(3): nmbuild</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Unity扩展: nmbuild.u3d.editor</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">The standard build process has three main steps which will be covered in detail throughout the rest of this section.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Compile the input.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">The NMGen Build. (Produces the polygon meshes.)</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Create the navigation mesh.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">普通生成流E有如下三个主要步骤Q稍后的章节会对q三个步骤进行详l的介绍?/span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">~译数据?</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">调用NMGen的生成功?生成多边形网?.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">生成 Navigation Mesh.(D|格)</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">Note Note:</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">CAINav uses the OpenGL coordinate system.</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">注意Q?/span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">CAINav使用OpenGL坐标pȝ.(XYZ,左右手什么的);</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">(1)生成q程有哪些?</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">(2)哪些斚w的细节需要了解?</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">(3)相对于recast的扩?cai是基于recast的功能基而实现的;</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">快速扫?/span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">1、A* Path Finding是一个图最短\径搜索算法,只要数据源支?遍历d"的操作,可以应用A*;</span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">2、Ploygen Mesh 是凸多边形网|因ؓ凸多边Ş内Q意两点可以直?-在满x定的倾斜?slope limit)和高度差(step height)的情况下?/span><br style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" /><span style="font-size: 14px; font-family: Arial; white-space: normal; text-transform: none; word-spacing: 0px; float: none; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal">3、如果有地Ş的Triangle Mesh,其实已经可以Z它进行A*了,因ؓ三角形也是凸多边形。大费周章的使用Nav Mesh是ؓ?、大q简化图的复杂度Q将不必要的信息q行合ƈ?、记录一些额外的信息Q比?xxx xxx?/span></span><img src ="http://www.shnenglu.com/ming81/aggbug/214398.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-11-08 21:18 <a href="http://www.shnenglu.com/ming81/archive/2016/11/08/214398.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运? CritterAI官方文档译【The Crowd Manager?/title><link>http://www.shnenglu.com/ming81/archive/2016/11/08/214397.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Tue, 08 Nov 2016 13:17:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/11/08/214397.html</guid><description><![CDATA[<span style="font-family: Arial; color: #333333; background-color: #ffffff"> <div class="1pf3n5t" id="article_content" class="article_content" style="white-space: normal; text-transform: none; word-spacing: 0px; color: rgb(51,51,51); text-align: left; font: 14px/26px Arial; margin: 20px 0px 0px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px">The crowd manager is the big beast of the navigation components. It not only handles a lot of the path management for you, but also local steering and dynamic avoidance between navigation clients. I.e. It can keep your agents from running into each other.<br />【CrowdManager】类是十分庞杂的一个类。它不仅Z处理了非常多的\径管理相关的事情Q同时也处理一些局部{向和避开其它寻\代理对象。也是_他可以让所有的代理对象不会怺I插?br /><br /><br />Core Class: CrowdManager<br />核心c:CrowdManager<br /><br /><br />The NavmeshQuery and PathCorridor classes provide perfectly good, easy to use path planning features. But in the end they only give you points that your navigation client should be moving toward. When it comes to deciding things like client velocity and steering to avoid other clients, that is up to you to implement. Unless, of course, you decide to use the crowd manager.<br />NavmeshQuery和PathCorridorq两个类已经很不错了Q用来做路径规划也够简单。但是说到底它们只是l了你一堆指D色运动的路点。当你决定实C些角色之间不发生撞的特性时Q只能你自己实现了。除非,当然Q你军_使用CrowdManager?br /><br /><br />Basically, you add an navigation client (agent) to the crowd manager, providing various configuration settings such as maximum speed and acceleration. You also provide a local target to more toward. The crowd manager then provides, with every update, the new agent position and velocity for the frame. The movement will be constrained to the navigation mesh, and steering will be applied to ensure agents managed by the crowd manager do not collide with each other.<br />基本上来Ԍ你可以往CrowdManagerd一个角Ԍ同时提供一些配|数据,例如最大速度和加速度。你也可以提供一个局部的目标(让角色自ȝUdq去(1))。然后CrowdManager会在每更新的时候设|角色的最C|和速度。运动会被约束在Navmesh内,CrowdManager会让角色在需要的时候进行{向,以确保不会相互碰?br /><br /><br />This is very powerful feature set. But it comes with limitations.<br />The biggest limitation is that you must give control of the agent's position and velocity completely over to the crowd manager. You can update things like maximum speed and acceleration. But in order for the crowd manager to do its thing, it can't allow you to constantly be giving it overrides to position and velocity. So you give up direct control of the agent's movement. It belongs to the crowd manager.<br />The second biggest limitation revolves around the fact that the crowd manager deals with local planning. The agent's target should never be more than 256 polygons aways from its current position. If it is, you risk your agent failing to reach its target. So you may still need to do long distance planning and provide the crowd manager with intermediate targets.<br /><br /><br />q是一个非常强大的Ҏ集。但是它伴随着一些限制?br />最大的限制在于你必d角色的位|和速度完全交给CrowdManager来控制。你可以更新cM最大速度和加速度之类的参数。但是ؓ了让CrowdManager能正常工作,你不能经常的改变角色的位|和速度。因此你需要放弃管理角色运动。这个工作现在属于CrowdManager?br /><br /><br /><br /><br />Other significant limitations:<br />All agents using the crowd manager use the same NavmeshQueryFilter.<br />Crowd management is relatively expensive. The maximum agents under crowd management at any one time is around 20.<br /><br /><br />其他明显的限?br />所有托的角色都用同L查询qo?br />人群理的开销相对较大。可以管理的人群的个体数量最大约?0?1)?br /><br /><br />The Sample Pack includes a Crowd Manager Demo that lets you see the manager in action.<br /><br /><br /><br /><br />(1)需要实?<br />(1)q个数量是一个h为的限制Q可以通过修改代码H破此限制?/div> <div id="5bjdr5f" class="bdsharebuttonbox tracking-ad bdshare-button-style0-16" style="font-size: 12px; font-family: Arial, Console, Verdana, 'Courier New'; white-space: normal; text-transform: none; word-spacing: 0px; zoom: 1; float: right; font-weight: normal; color: rgb(51,51,51); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-caps: normal" data-bd-bind="1478611370148" data-mod="popu_172"><a class="bds_more" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png); background-repeat: no-repeat; background-position: 0px 0px; float: left; color: rgb(51,51,51); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="more"></a><a title="分n到QQI间" class="bds_qzone" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://www.shnenglu.com/ming81/img/share/icons_0_16.png?v=91362611.png); background-repeat: no-repeat; background-position: 0px -52px; float: left; color: rgb(51,102,153); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="qzone"></a><a title="分n到新微? class="bds_tsina" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://www.shnenglu.com/ming81/img/share/icons_0_16.png?v=91362611.png); background-repeat: no-repeat; background-position: 0px -104px; float: left; color: rgb(51,102,153); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="tsina"></a><a title="分n到腾讯微? class="bds_tqq" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://www.shnenglu.com/ming81/img/share/icons_0_16.png?v=91362611.png); background-repeat: no-repeat; background-position: 0px -260px; float: left; color: rgb(51,102,153); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="tqq"></a><a title="分nCh人网" class="bds_renren" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://www.shnenglu.com/ming81/img/share/icons_0_16.png?v=91362611.png); background-repeat: no-repeat; background-position: 0px -208px; float: left; color: rgb(51,102,153); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="renren"></a><a title="分n到微? class="bds_weixin" style="cursor: pointer; font-size: 12px; height: 16px;background-image: url(http://www.shnenglu.com/ming81/img/share/icons_0_16.png?v=91362611.png); background-repeat: no-repeat; background-position: 0px -1612px; float: left; color: rgb(51,102,153); padding-left: 17px; text-decoration: none; margin: 6px 6px 6px 0px; line-height: 16px" target="_blank" data-cmd="weixin"></a></div></span><img src ="http://www.shnenglu.com/ming81/aggbug/214397.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-11-08 21:17 <a href="http://www.shnenglu.com/ming81/archive/2016/11/08/214397.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运? CritterAI官方文档译【The Path Corridor?/title><link>http://www.shnenglu.com/ming81/archive/2016/11/08/214396.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Tue, 08 Nov 2016 13:16:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/11/08/214396.html</guid><description><![CDATA[<span style="color: #333333; font-family: Arial; background-color: #ffffff;">The Path Corridor</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">译Qkun 2014.12.4</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The path corridor provides a way of moving along a navigation path without worrying about the minutiae of managing the path.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">廊道提供了一U沿指定D路径q行UdQ而不必担心管理用\径数据时的细节问题?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Core Class: PathCorridor</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">核心c:PathCorridor</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">In the simplest scenario, a path is a list of waypoints from a starting point to an end point. The waypoints form a connected set of line segments along which a navigation client moves. But </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">navigation is much more complex in the real world. There are locomotion limitations, local steering restrictions, dynamic obstacle avoidance, and good old floating point errors. All of these </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">issues can make management of a path difficult.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">在最单的情景里,一个\径是一l从开始点到结束点的\点列表。如果能_的按照用此D数据q动Q角色的轨迹会是一l相互连接的U段。但是在真实环境下进行导航比q个要复杂的多。你需要考虑角色的运</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">动能力的局限?1)、局部{向限制、避开动态障物、以及一些常见的点数错误。所有这些情况都会让理一个\径的使用变得困难?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Navigation based on a polygon mesh provides a different abstraction than just a list of waypoints. The path returned by the NavmeshQuery class is a list of polygons. Technically, a client can </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">move freely anywhere within this corridor of polygons. If a client strays outside the corridor, then the corridor can be patched up using local searches rather than full path replanning.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">在一个多边Ş|格上进行导航比在一堆\点上q行D要更加抽象一些。NavmeshQueryq回的Path是一l多边Ş。技术上Ԍ一个角色可以在q个廊道上的L多边形内自由的移动。如果一个角色跑Zq个廊道的范</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">_廊道的范围可以用局部搜索进行扩大,而不是重新规划整条\径?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The path corridor is loaded with a path, a start point, and a target point. It is then used to move the navigation client through the corridor. It handles path straightening, constraining the </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">client to the navigation mesh, and adjusting the corridor due to inaccurate client locomotion.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">廊道需要加载一个Path、一个v始点、一个目标点。然后用于角色在q个廊道内移动。它处理路径的矫正、确保角色不会跑出Navmesh、以及当角色Ud出预期时修正廊道信息?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The PathCorridor API is well documented. The only thing worth repeating here is a warning: You can't just initialize a corridor with a path and forget long distance path planning. Since the </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">path corridor class uses local searches to maintain the corridor, attempting to apply large delta movement to the corridor's position or target can result in a malformed corridor. Details are </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">in the API documentation.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">PathCorridor API已经有详l的文档说明了。在q里只有一点值得提一下:你不能只创徏一个廊道然后一切都交给它去做,而不q行长\径规划。虽然廊道用了局部搜索来l持廊道完整性,不过如果在廊道里产生一</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">个大的运动距,或者目标点d很远Q会产生一个畸形的廊道(1)。更多的l节可以参考相关API文档?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">(1)加速、减速、惯性之cȝq动参数.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">(2)啥意?</span><img src ="http://www.shnenglu.com/ming81/aggbug/214396.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-11-08 21:16 <a href="http://www.shnenglu.com/ming81/archive/2016/11/08/214396.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运?CritterAI官方文档译【The Navigation Query?/title><link>http://www.shnenglu.com/ming81/archive/2016/11/08/214395.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Tue, 08 Nov 2016 13:15:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/11/08/214395.html</guid><description><![CDATA[<p style="color: #333333; font-family: Arial; background-color: #ffffff;"><span style="line-height: 26px;">译Qkun 2014.12.4</span><br /></p><p style="color: #333333; font-family: Arial; background-color: #ffffff;">The navigation mesh query is the most important class to understand since most navigation clients will interact with the query rather than the navigation mesh itself. The mesh contains the data, but the query provides almost all of the features necessary for pathfinding.<br />用户和navigation mesh query(Navmesh查询?打交道的ơ数比Navmes本n多的多。网格包含数据,但是查询器提供了几乎全部的寻路特性?/p><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Core Class: NavmeshQuery</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">核心c:NavmeshQuery</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Query features fall into two general categories: Pathfinding and local search.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">查询器的Ҏ包括两个大的方面:寻\和局部搜索?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Pathfinding involves standard A* and Dijkstra searches that find the best path(s) between two points. Paths are made up of a list polygon references that represent a polygon corridor from the start to the end position. Path straightening is used to convert the path into a list of waypoints. (I.e. String pulling.)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">寻\使用标准的A*和Dijkstra法Q用于找Z点之间最好的路径(可能不止一?。Path(路径)是由一lPolygon的引?1)l成数据Q从开始点到结束点。\径矫正是一个Path数据转ؓ一l\Ҏ?即String pulling(l_拉直))(2)?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The local search features offer various methods for locating polygons and points on polygons, and for querying the local environment. I.e. Raycasting, finding the distance to the nearest wall, etc.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">局部搜索功能提供多U方式进行多边Ş和多边Ş上的点的定位Q以及查询局部的一些环境信息。比如射U查询、计离最q的墙的距离之类的?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Many of the query methods require a NavmeshQueryFilter. Filters define area traversal costs as well as flags used for including/excluding polygons and off-mesh connections from results.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">许多查询Ҏ要求一个NavmeshQueryFilter(查询qo?。过滤器定义了Polygon和off-mesh connections的穿代P代h值可以参与启发式的计,用来军_是否在最l\径里包含/排除某个Polygon或off-mesh connections?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The best way to understand the query class is to play around with it. The Sample Pack includes the Query Explorer demo that permits experimentation with all of the main query features.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">理解查询器的最好办法就是用一用。【Sample Pack(CZ?】里的【Query Explorer(查询演示)】demo展示了查询器一些主要的Ҏ?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Common Operations</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">通用操作</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">This section contains some simple examples of common query operations.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Finding a Point in the Navigation Mesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">You can't do much without first getting a valid point on the navigation mesh. So the first step is to find one.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">本节是例?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">查询一个在Navmesh上的?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">如果你没有一个Navmesh上的起始点的话,你能做的不多。所以第一部就是找一个点?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)函数提供此功能?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">CopyC#</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'position' is a Vector3 indicating the world position of the client.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'query'是一?NavmeshQuery对象Q?filter'是一个NavmeshQueryFilter对象?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'position' 是一个Vector3对象Qgؓ角色的世界坐标?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">NavmeshPoint result;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Vector3 extents = new Vector3(1, 1, 1);  // Keep this to the minimum extents practical. // 范围小好?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">NavStatus status = query.GetNearestPoly(position, extents, filter</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , out result);</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">if (result.polyRef == Navmesh.NullPoly)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">{</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // Handle error.  Could not find a result.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // The status can be checked to see if there was an error.  If not, then</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // the cause is that the search extents did not overlap any polygons.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // 错误处理。找不到l果?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // 可以查状态看看是什么问题。如果没有问题,说明指定范围里不包含多边形?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">}</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// Use the result point, which includes a vector point and the reference of </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// the polygon that contains the point.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">//使用l果炏V包括一个Vector3的点和包含这个点的Polygon的引用?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Basic Pathfinding</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Even if you are planning to use PathCorridor or CrowdManager, you'll always need to do long distance planning using the basic NavmeshQuery features. First, get a path, then optionally straighten it.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">基础的寻?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">即你打用pathcorridor或crowdmanager,你也会需要NavmeshQuery的功能来完成一些长距离路径规划。第一Q获取一条\径,然后选择性的弄直?3)?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">CopyC#</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'start' and 'end' are NavmeshPoints known to be on the navigation mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'query'是一?NavmeshQuery对象Q?filter'是一个NavmeshQueryFilter对象;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 'start' ?'end' 是已知的在Navmesh上的?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">int pathCount;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// The path will be a list of polygon references.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// path是一lpolygon的引?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">uint[] path = new uint[100];  // Size for maximum allowed path length. // 路径的最大长?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">NavStatus status;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">if (start.polyRef == end.polyRef)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">{</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // No need to do any planning.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // 开始点和结束点在同一个多边Ş内,不需要进行\径规?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        pathCount = 1;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        path[0] = start.polyRef;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">}</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">else</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">{</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        status = query.FindPath(start, end, filter, path</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">                , out pathCount);</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        if (NavUtil.Failed(status) || path.pathCount == 0)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        {</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">                // Handle pathfinding failure.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">                // 处理寻\p|;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        }</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        else if (end.polyRef != path[pathCount - 1])</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        {</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // Handle a partial path.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // The query either could not reach the end point,</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // or the path buffer was too small to hold the</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // entire path.  (A check of 'status' will reveal if</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // the buffer was too small.)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // 处理只有一部分路径的情?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // 可能是结束点不可?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // 或者\径的buffer长度太小Q装不下整条路径;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">            // 如果是buffer太小Q可以检查state;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        }</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">}</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// If you need to straighten the path...</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 如果你需要拉直\?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">const int MaxStraightPath = 4;  // Just getting the first 4 waypoints. // 只处理前4个\?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">int wpCount;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// The waypoints.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 路点列表;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Vector3[] wpPoints = new Vecotr3[MaxStraightPath];</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// A list of polygon references.  (The polygon being entered at each waypoint.)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 一个多边Ş引用列表;(路点是多边Ş的入口点)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">uint[] wpPath = new uint[MaxStraightPath];</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// The type of each waypoint. (Start, end, off-mesh connection.)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 每一个\点的cd信息.(开始点Q结束点, q接);</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">WaypointFlag[] wpFlags = new WaypointFlag[MaxStraightPath];</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">status = query.GetStraightPath(start.point</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , goal.point</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , path</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , 0                // The index of the start of the path. // 路径的开始点;</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , pathCount        // The length of the path.             // 路径的长?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , wpPoints</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , wpFlags</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , wpPath</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        , out wpCount);</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">if (NavUtil.Failed(status) || wpCount == 0)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">{</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // Handle the failure.  There should always be at least one waypoint </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // (the goal) for a valid point/path combination,</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">        // 处理p|。应该L存在一个点(目标?用于路径合ƈ.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">}</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// Use the path and waypoints.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">// 使用路径和\?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">(1)可以理解为句柄,或烦引?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">(2)Path上每个多边Ş中心之间的连U一般不会是直线Q\径如果有拐角也会造成一些美观上的问题,q个时候需要用特定的Ҏ\径变得尽量笔_好像将一根子拉直?/span><img src ="http://www.shnenglu.com/ming81/aggbug/214395.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-11-08 21:15 <a href="http://www.shnenglu.com/ming81/archive/2016/11/08/214395.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运?CritterAI官方文档译【The Navigation Mesh?/title><link>http://www.shnenglu.com/ming81/archive/2016/11/08/214394.html</link><dc:creator>点点滴滴</dc:creator><author>点点滴滴</author><pubDate>Tue, 08 Nov 2016 13:14:00 GMT</pubDate><guid>http://www.shnenglu.com/ming81/archive/2016/11/08/214394.html</guid><description><![CDATA[<span style="color: #333333; font-family: Arial; background-color: #ffffff;">The Navigation Mesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">译Qkun 2014.12.4 </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The navigation mesh is the primary data model for the navigation system. The only user component that deals directly with the mesh on a regular basis is the component that is responsible for creating the mesh and managing its state. Normal navigation clients, the one's needing to perform pathfinding and such, rarely if ever interact directly with the navigation mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">NavigationMesh是导航系l的主要数据模型。用户只需要创建导航网格数据和l护数据状态。需要用导航的地方一般是q行寻\操作Q偶也可以使用navmeshq行一些交互?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Core Class: Navmesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">核心c:Navmesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The Data Model</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">数据模型</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tiles</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">At the core of the navigation mesh is the tile. Tiles hold the vast majority of structural and state information. In fact, the Navmesh class is little more than a tile manager. It may consist of a single tile, or many tiles laid out in a grid that can be swapped in and out at runtime.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The tile based structure of the navigation mesh adds a lot of flexibility. As mentioned, tiles can be swapped in and out at runtime. This means that the mesh can represent a large area, but not all tiles have to be loaded and active, reducing the mesh's memory footprint. This also allows for a situation where individual tiles can be rebuilt without the need to rebuild the entire mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tiles(片区)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Navmesh的核心概念之一是Tile。Tiles存放了大多数的结构信息和状态信息。事实上QNavmeshcL点像一个TileManager。Navmesh可以由单个Tile构成Q也可以向网gLq铺开来,以便在运行期动态的替换其中的某个Tile?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Structural Elements</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The tile's structural data is what defines the navigation graph used for pathfinding. It consists of two types of elements: Polygons and off-mesh connections.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The core of the structure is a mesh of convex polygons with between three and MaxAllowedVertsPerPoly vertices. This mesh is in the same format as NMGen's PolyMesh structure, and usually represents an abstraction of a scene's static geometry.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Off-mesh connections are optional. They consist of two connected endpoints, at least one of which resides within a polygon in the polygon mesh. Off-mesh connections are added to the navigation graph as a single edge and represent special travel routes not defined by scene geometry. Think: The route an agent travels if it jumps over a railing that normally blocks movement.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">节点元素</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tile的数据结构是一个用于寻路的graph(?。它׃U数据结构组成:Polygons(多边形集?和off-mesh connections(分离的网g间的q接关系集合)?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Off-mesh connections(分离的网g间的q接关系集合)可以没有。它׃个相互连接的端点构成Q至一边在某个多边形里。Off-mesh connections作ؓ单独的边d到图的数据结构里。它代表着一U特D的行走路线Qƈ且不是由原始场景的几何体生成的。想象一下,一个角色蟩q一个栏?栏杆可以ȝ普通的前进?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">State Data</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tiles also contain state data. This data is associated with individual polygons and off-mesh connections. State data includes area and flags.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Areas are used to associate traversal cost to structural elements. This effects pathfinding. For example, the area representing swampland can have a higher cost than the area representing smooth surfaces such as meadowland.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Flags can be used to control when a structural element is traversable. For example, a flag can be set on the polygon below a door to indicate that it is closed and locked. Or a flag can indicate that only agents of a particular type are allowed to traverse the element.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">It is important to note that areas and flags have no meaning within the navigation mesh itself. The interpretation of the values is dependant on the NavmeshQueryFilter used by each navigation client. For example: One filter may define a cost of 10 for area id 5, while another may define a cost of 2 for the same area. One flag may be set when a door is closed with one filter checking for the flag during pathfinding, while another filter, used by a ghost, ignores the flag completely.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">状?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tile包括了一些状态信息。状态用来区分不同的Polygons和off-mesh connections。状态数据包括areas(区域信息)和flags(标志??/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Areas(区域)一般用来定义移动代L。代价媄响寻路。D个例子,I越被标Cؓ沼泽的区域时的代仯费可能比I越标记地的区域的代仯高?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Flags(标志?可以用来控制一个节点的可行走属性。D个例子,一个作??的多边ŞQ在门关闭的时候,可以l这个多边Ş讄一个特D的标志位,以表C它是不可通过的。或者设|一个特D的标志位,只允许特定类型的角色通过?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Areas和Flags的意义不是由Navmesh定义的,q非帔R要。这些特别指定的数字都是由导航系认的用户pȝ自定义的NavmeshQueryFilter来解释的。D个例子:一个过滤器认ؓID?的区域具?0点\径代P而另一个过滤器则认为只?的\径代仗当一个关闭的门的标志位被讄?1)Q一U过滤器在寻路的时候就会考虑q种情况而将q个门视Z可通过Q另外一U过滤器-可能是用于鬼的寻\-׃完全忽略q个标志位而将此节点认为是可通过的?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Structure Versus State</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Why is it important to know the difference between structural elements and state data?</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The first reason is that it is possible to save and load state separately from structure. One common use case is to have a serialized version of the full navigation mesh that represents its default state. Then serialized versions of various states, such as the last runtime state, are used to overwrite the default state as needed.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The main limitation is that a state is only valid for a particular structure. So you can't, for example, save the state, change the tile structure, then load the original state into the new structure.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The second reason for understanding the difference between structure and state has to to with tile and polygon references...</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">l构VS状?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">节点元素和状态之间进行了分离Q理解这炚w帔R要?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">首先Q这样它们可以独立的q行保存和加载。一个通常的情冉|Q加载一个预制的Navmesh数据后,其中的状态可能都是默认|而利用一个上一ơ运行时保存的串行化的状态缓存,可以覆盖原始的状态信息?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">不过q里有一个限Ӟ状态信息和节点自n是精匹配的。你不能在更改完一个节点的信息后,又将一个老的状态赋l它?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">W二点则是对Tile和Polygon的引用方式?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tile and Polygon References</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The last bit of information needed to understand the navigation mesh is the concept of tile and polygon references. These values are one of the few data types that are defined by the navigation mesh rather than the tiles within the mesh. It is important to understand what references are because they are used by various classes to automatically invalidate pathfinding data if the structure of a navigation mesh changes.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Essentially, tile and polygon references are unsigned integer 'handles' to structural elements within a navigation mesh. Tile references are rarely used by navigation clients, while polygon references are all over the place. Polygon references are unique for the navigation mesh, so they are useful for easily identifying a polygon without needing to know which tile it belongs to. </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Despite the name, polygon references can refer to a either a polygon or an off-mesh connection.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">References can become invalid. If they are used after they are invalidated, then methods will return a failure status. Polygon references are based on the tile reference. So they will be invalidated whenever their associated tile reference is invalidated.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Structural changes govern the life of a reference. Changing the configuration of a navigation mesh or the internal structure of a tile will invalidate all associated references.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">References are preserved during tile state changes such as changes flags and areas. They are also preserved during normal runtime loading and unloading of tiles, and during normal serialization/de-serialization of a navigation mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Tile和Polygon的引用方?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">要完全理解NavmeshQ最后一点信息是关于Tile和Polygon的引用这个概c这些引用是Navmesh为数不多的数据结构之一Q而不是由Tile定义的。理解引用是什么很重要Q因为通过它可以实现当D|格发生变化的时候,一些类似寻路功能的模块能自动的引用的多边形置为无效?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">本质上来_Tile和Polygon的引用是一个uint32(无符h?。Tile的引用很被客户代码直接使用Q因Z用场合基本上都可以被Polygon代替。Navmesh里的每个Polygon的引用都是唯一的,因此它们能够非常方便的定位到指定的PolygonQ而不需要知道这个Polygon属于哪个Tile?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">虽然名字差别比较大,Polygon的引用概念同时也늛了off-mesh connections对象?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">引用可以变成无效的。如果在无效之后q用引用,函数会返回一个失败信息。Polygon的引用有效性是ZTile的引用的。因此当Tile的引用无效了Q所有属于Tile的Polygon的引用也会无效?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">构造的变化会媄响引用的生命周期。改变Navmesh的配|或者Tile的内部结构会引v相关的引用全部失效?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">引用会在Tile的状态发生变化的时候进行保存,比如指定Area或Flag值的时候。在q行期动态的加蝲或卸载Tile也会使引用自动保存,q有当正怸行化/反串行化一个Navmesh的时候?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Creating a Navigation Mesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">There are various pipelines for creating a navigation mesh. If you are using Unity, the Unity extensions make it easier. Otherwise, the basic steps are as follows:</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Generate packed tile data:</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Generate PolyMesh and PolyMeshDetail data using NMGen.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Optionally create a ConnectionSet. (Off-mesh connections.)</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Load the data into a NavmeshTileBuildData object.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Create a NavmeshTileData object from the build data.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The tile's structure and default state is now locked into a packed data format that is ready to be loaded into a navigation mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏一个Navigation Mesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏一个Navmesh有一些流E。如果你在用UnityQ那么CAI提供的Unity扩展会让qg事情E微单点。否则,基本程如下Q?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">生成打包好的Tile数据.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">使用NMGen生成PolyMesh和PolyMeshDetail?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏个ConnectionSet(Off-mesh connections的容?Q这是可选的?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">这些数?tile,PolyMesh,PolyMeshDetail,ConnectionSet)加蝲到NavmeshTileBuildData对象里?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏一个NavmeshTileDatad数据?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">现在Tile的构成关pd默认状态已l都装到NavmeshTileData里了Qƈ且ؓ生成Navmesh而做了数据结构的改变?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Note Note:</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Using the NavmeshTileBuildData class directly can be a bit daunting. The GetBuildData(BuildContext, Int32, Int32, PolyMeshData, PolyMeshDetailData, ConnectionSet, Boolean) utility method provides a standard way of </span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">creating the build data.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">注意Q?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">直接使用NavmeshTileBuildDatacd能有炚w搞。GetBuildDataq个工具函数提供了一U标准流E?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Create a navigation mesh:</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Single tile navigation meshes are created using the the single step Create(NavmeshTileBuildData, Navmesh) method.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Multi-tile navigation meshes are created then loaded using multiple methods. Use the Create(NavmeshParams, Navmesh) method to initialize an empty mesh. then add tile data using the AddTile(NavmeshTileData, UInt32, UInt32) method.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏一个Navmesh</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">如果创徏只有个Tile的Navmesh,只需要调用一ơCreate(【NavmeshTileBuildData? Navmesh)函数?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">创徏多Tile的Navmesh需要多ơ调用函数。用Create(【NavmeshParams? Navmesh)函数创徏一个空的navmesh,然后使用AddTile函数Tiledq去(1)?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Navigation Mesh Serialization</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">The Navmesh class supports byte serialization using the GetSerializedMesh() method. This saves the entire mesh.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">It is possible to serialize state separately from structure on a tile-by-tile basis. Get the tile from the mesh using the GetTile(Int32) method, then use the GetState(Byte[]) and SetState(Byte[]) methods.</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">Navmesh的串行化</span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">NamveshcL持二q制串行化,使用GetSerializedMesh来完成。这会将整个mesh转成二进制数据?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">它可以每Tile的、状态和拓扑l构分离的进行串行化。从mesh里取Tile使用GetTile(Int32)函数Q然后用GetState(Byte[])函数和SetState(Byte[])函数q行状态的赋倹{?/span><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><br style="color: #333333; font-family: Arial; background-color: #ffffff;" /><span style="color: #333333; font-family: Arial; background-color: #ffffff;">(1)Tile数据有自q生成程Q可以参考An Introduction to NMGen</span><img src ="http://www.shnenglu.com/ming81/aggbug/214394.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ming81/" target="_blank">点点滴滴</a> 2016-11-08 21:14 <a href="http://www.shnenglu.com/ming81/archive/2016/11/08/214394.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(搬运?CritterAI官方文档译【An Introduction to Navigation?http://www.shnenglu.com/ming81/archive/2016/11/08/214393.html点点滴滴点点滴滴Tue, 08 Nov 2016 13:13:00 GMThttp://www.shnenglu.com/ming81/archive/2016/11/08/214393.html译Qkun 2014.12.4 


The navigation side of CAINav consists of features used to create and use navigation meshes for pathfinding and local steering.
CAINav提供创徏Navmesh、基于Navmesh的寻路和局部{向避障?br />

Core: org.critterai.nav
Unity extensions: org.critterai.nav.u3d
核心命名I间Qorg.critterai.nav
Unity扩展Qorg.critterai.nav.u3d




There are five main classes you'll be dealing with:
l常和你打交道的cL五个Q?br />

Note Note:
CAINav uses the OpenGL coordinate system.
注意Q?br />CAINav使用OpenGL坐标pR?br />

The Navmesh class defines the structure and state of the navigation mesh. The only user component that deals directly with this class on a regular basis is the component responsible for creating the mesh and managing its state. Normal navigation clients, the one's needing to perform pathfinding and such, rarely if ever interact directly with the navigation mesh.
【Navmesh】类定义了导航网格的数据l构和状态。这个类用于保存用户创徏的导航网格数据和数据状态。需要用导航的地方一般是q行寻\操作Q偶也可以使用navmeshq行一些交互?br />

The most important class to understand and become comfortable with is the NavmeshQuery class. It provides almost all of the client navigation features, including A* and Dijkstra path searches, string pulling, point and polygon searches, raycasting, etc.
【NavmeshQuery】类是需要理解透彻的最重要的类。它提供了所有用L的导航功能,包括使用A*法和Dijkstra法q行寻\、索牵引、搜索点和多边Ş、射U查询等{?br />

The NavmeshQueryFilter is a seemingly minor class, but it has a large impact on navigation. Filters are used to define the costs of traversing the mesh and flags that control which parts of the navigation mesh are included in operations. Multiple filters can be used to customize the navigation behavior on a per client basis.
【NavmeshQueryFilter】是一个看h很小的类Q但是它对导航的影响很大。过滤器用来定义I过某个区域时的代h。可以用多个过滤器来实现自定义的导航行为?br />

The PathCorridor class provides a way of moving along a navigation path without worrying about the minutiae of managing the path.
【PathCorridor】类提供了一U沿D路径Q而不必担心管理\径的l节(1)?br />

The CrowdManager is the big beast of the navigation classes. It not only handles a lot of the path management for you, but also local steering and dynamic avoidance between navigation clients. I.e. It can keep your agents from running into each other.
【CrowdManager】类是十分庞杂的一个类。它不仅Z处理了非常多的\径管理相关的事情Q同时也处理一些局部避障和避开其它寻\代理对象。也是_他可以让所有的代理对象不会怺I插?br />

(1)需要实验?nbsp;

点点滴滴 2016-11-08 21:13 发表评论
]]>
(搬运?五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT)http://www.shnenglu.com/ming81/archive/2010/12/28/137615.html点点滴滴点点滴滴Tue, 28 Dec 2010 09:07:00 GMThttp://www.shnenglu.com/ming81/archive/2010/12/28/137615.html当Adobe、Microsoft、Sun{一pd巨头开始表现出?#8221;开?#8221;的青睐时Q?#8221;开?#8221;的时代即到来!

最初来自:sinoprise.com/read.php?tid-662-page-e-fpage-1.htmlQ遗憄是这个链接已l打不开了)Q我基本未改动,只是q行了一些排版和整理?br>参考文献:http://www.fsf.org/licensing/licenses/

C存在的开源协议很多,而经qOpen Source Initiativel织通过批准的开源协议目前有58U(http://www.opensource.org/licenses/alphabeticalQ。我们在常见的开源协议如BSD, GPL, LGPL,MIT{都是OSI批准的协议。如果要开源自q代码Q最好也是选择q些被批准的开源协议?/p>

q里我们来看四种最常用的开源协议及它们的适用范围Q供那些准备开源或者用开源品的开发h?厂家参考?/p>

BSD开源协议(original BSD license?/strong>FreeBSD license?/strong>Original BSD licenseQ?/strong>

BSD开源协议是一个给于用者很大自q协议。基本上使用者可?#8221;为所Ʋؓ”,可以自由的用,修改源代码,也可以将修改后的代码作ؓ开源或者专有Y件再发布?/p>

?#8221;为所Ʋؓ”的前提当你发布用了BSD协议的代码,或则以BSD协议代码为基做二ơ开发自q产品Ӟ需要满三个条Ӟ

  1. 如果再发布的产品中包含源代码Q则在源代码中必d有原来代码中的BSD协议?
  2. 如果再发布的只是二进制类?软gQ则需要在cd/软g的文档和版权声明中包含原来代码中的BSD协议?
  3. 不可以用开源代码的作?机构名字和原来品的名字做市场推qѝ?

BSD 代码鼓励代码׃nQ但需要尊重代码作者的著作权。BSD׃允许使用者修改和重新发布代码Q也允许使用或在BSD代码上开发商业Y件发布和销售,因此是对商业集成很友好的协议。而很多的公司企业在选用开源品的时候都首选BSD协议Q因为可以完全控制这些第三方的代码,在必要的时候可以修Ҏ者二ơ开发?/p>

Apache Licence 2.0Q?/strong>Apache License, Version 2.0?a >Apache License, Version 1.1?a >Apache License, Version 1.0Q?/strong>

Apache Licence是著名的非盈利开源组lApache采用的协议。该协议和BSDcMQ同样鼓׃码共享和重原作者的著作权,同样允许代码修改Q再发布Q作为开源或商业软gQ。需要满的条g也和BSDcMQ?/p>

  1. 需要给代码的用户一份Apache Licence
  2. 如果你修改了代码Q需要再被修改的文g中说明?
  3. 在g伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标Q专利声明和其他原来作者规定需要包含的说明?
  4. 如果再发布的产品中包含一个Notice文gQ则在Notice文g中需要带有Apache Licence。你可以在Notice中增加自q许可Q但不可以表Cؓ对Apache Licence构成更改?

Apache Licence也是对商业应用友好的许可。用者也可以在需要的时候修改代码来满需要ƈ作ؓ开源或商业产品发布/销售?/p>

GPLQ?/strong>GNU General Public LicenseQ?/strong>

我们很熟悉的Linux是采用了GPL。GPL协议和BSD, Apache Licence{鼓׃码重用的许可很不一栗GPL的出发点是代码的开?免费使用和引?修改/衍生代码的开?免费使用Q但不允怿改后和衍生的代码做ؓ闭源的商业Y件发布和销售。这也就是ؓ什么我们能用免费的各种linuxQ包括商业公司的linux和linux上各U各L׃人,l织Q以及商业Y件公司开发的免费软g了?/p>

GPL协议的主要内Ҏ只要在一个Y件中使用(“使用”指类库引用,修改后的代码或者衍生代?GPL 协议的品,则该软g产品必须也采用GPL协议Q既必须也是开源和免费?strong>q就是所谓的”传染?#8221;。GPL协议的品作Z个单独的产品使用没有M问题Q还可以享受免费的优ѝ?/p>

׃GPL严格要求使用了GPLcd的Y件品必M用GPL协议Q对于用GPL协议的开源代码,商业软g或者对代码有保密要求的部门׃适合集成/采用作ؓcd和二ơ开发的基础?/p>

其它l节如再发布的时候需要伴随GPL协议{和BSD/Apache{类伹{?/p>

LGPLQ?/strong>GNU Lesser General Public LicenseQ?/strong>

LGPL是GPL的一个ؓ主要为类库用设计的开源协议。和GPL要求M使用/修改/衍生之GPLcd的的软g必须采用GPL协议不同。LGPL允许商业软g通过cd引用(link)方式使用LGPLcd而不需要开源商业Y件的代码。这使得采用LGPL协议的开源代码可以被商业软g作ؓcd引用q发布和销售?/p>

但是如果修改LGPL协议的代码或者衍生,则所有修改的代码Q涉及修攚w分的额外代码和衍生的代码都必采用LGPL协议。因此LGPL协议的开源代码很适合作ؓW三方类库被商业软g引用Q但不适合希望以LGPL协议代码为基Q通过修改和衍生的方式做二ơ开发的商业软g采用?/p>

GPL/LGPL都保障原作者的知识产权Q避免有人利用开源代码复制ƈ开发类似的产品

MITQ?a >MITQ?/strong>

MIT是和BSD一样宽范的许可协议,作者只想保留版?而无M其他了限?也就是说,你必d你的发行版里包含原许可协议的声明,无论你是以二q制发布的还是以源代码发布的.



点点滴滴 2010-12-28 17:07 发表评论
]]>
VVþþ | 69Ʒþþþ777| ɫۺϺϾþۿ| 88þþƷһëƬ| 91ɫۺϾþѷ| þþþþþĻ | ŷ޾Ʒ˾þԻӰƬ | þþƷĻһ| Ʒݾþþþø | þþƷ91þ鶹| 2020þþƷ| þۺϾþþ| ƷþĻ| պƷרþþ| þþûɫƬ| ٸ߳ҽоþþ| ݹƷþþþ| ɫۺϺϾþۿ| ޾ƷþþþþðĦ| ٸ߳ҽоþþþþ| ձѾþþþþþվ| þþƷһ| ɫþˬˬƬAV| ĻþþƷˮ | þù޾ƷӰԺ| һaƬþëƬ| þþ뾫Ʒպ˳| ݹƷþþþþ| ۿ ۺϾþþþùɫ ŷ һ | ޾ƷŮþþþ99| ҹƷþþþþþС˵ | þۺ77777| Ļþҹ| þþþӰԺ| 2019þþø456| þŮվ| 97þùۺϾƷŮ| ޳ɫ999þվ| ޾Ʒþþþþ| þþþþ޾Ʒ| þ99Ʒþþþ|