文件名称:a_game_road_find

  • 所属分类:
  • 其它资源
  • 资源属性:
  • [Text]
  • 上传时间:
  • 2008-10-13
  • 文件大小:
  • 3.33kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • yzm***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

A*算法是一个求最短路径的函数,为许多即时战略游戏所用刀(或许人家大型的即时战略游戏笔者算法更好,不管它)。它由两个函数组成,一个是评估函数,也就是确定人物移动的下一个位置必须离目标位置最近,评估函数评估的结果越精确,则寻径的速度越快;另一个就是寻径函数,也就根据评估的结果做出响应,然后从新位置继续评估下一个位置,若无路可走(四周都是障碍什么的),那么折回一个路径节点,尝试其他方向,这个算法有个缺点,随着游戏中人物增多,相应的处理节点就增多了,会影响处理速度,而且占用大量的内存。



有兴趣的朋友可以改成动态的寻径,就是当入口和出口位置都在变化的时候进行寻径,这个代码也只有200多行。

我的算法还不能算是最优的,因为评估函数只不过是简单的测试两点距离(这会带来误差),选择离出口最短的且非障碍物的方向,进行下一个路径节点的移动。-A * algorithm is a shortest path function, To many time strategy games as a knife (and perhaps others of immediate large-scale strategy game better writer algorithm, regardless of it). It consists of two components function, a function is to assess, is to determine the movement of people under one location to be away from the target location recently to assess the function of the assessment results more precise, Routing is the faster; Another is the routing function, also based on the results of the assessment to respond, then the new location to continue to assess a position where, if there is no way out (what are surrounded by the barrier), then retrace a path nodes, try other directions, this algorithm has a shortcoming, as the game figures increased, corresponding to the processing nod
(系统自动生成,下载前可以参看下载内容)

下载文件列表

压缩包 : 63535304a_game_road_find.rar 列表
a_game_road_find.txt

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org