A*- not a star in the space, it's on you hands
2012-08-05 21:42
741 查看
A*游戏中的常用寻路算法,做游戏的孩子人手一个的轮子,be a gooleplayer。我也是这样的一个孩子,还想造很多轮子的孩子。
上周一位新同学问我A*,哈哈,整好去年细看了,给简单描画了一下。记得上次写A*,是zack给我们介绍了一个a*的优化算法,JPS(jump point search),我用这个算话改写优化了一下服务器的A*。效果不错,测试数据来看大概有100%的提升,服务器路径一般比较短吧,客户端那边要明显很多很多。
话接上回说,给小同学讲解之后,表示不是很明白----我这表达太菜了,呜呜呜呜。好吧,直观一点,然后我用object c写了一个有过程掩饰的A*,想想自己的虚拟机,潸然泪下。objec c自己一直是纸上谈兵,这次也给做个小菜尝尝,xcode做ui那是真心的方便啊,quartz也很赞!!!然后,然后是一直键盘声,和vmware的卡咔咔咔,再然后,再然后就这玩意儿就可以跑了,嘿嘿!
闲话少说,上图!
github: https://github.com/garfieldchen/AStarFinding
参考资料:
1. http://www.policyalmanac.org/games/aStarTutorial.htm这是一篇好文
2. http://snowyrock.wordpress.com/2007/07/15/a%E8%B7%AF%E5%BE%84%E5%AF%BB%E6%89%BE%E7%AE%97%E6%B3%95%E5%85%A5%E9%97%A8/这是上文的中中文版
3. http://harablog.wordpress.com/2011/09/07/jump-point-search/ JPS 算法,G + F + W 你懂的
这个object c版的a*只实现了,基本的A*,暂时没有实现我提到的JPS,但不久也就有了,代码可以随意使用,谢谢你看得起,哈哈。
使用说明 vm mac osx 10.7 + xocde 4.1
step1 : create map
step2: create block 0 - n times
step3. mouse down on some none block tile, drag to another tile, release, there's it, enjoy!
color : orange - > open node , purge -> close node, green -> target position, blue ===== oh, god , thanks, it's the way home.
上周一位新同学问我A*,哈哈,整好去年细看了,给简单描画了一下。记得上次写A*,是zack给我们介绍了一个a*的优化算法,JPS(jump point search),我用这个算话改写优化了一下服务器的A*。效果不错,测试数据来看大概有100%的提升,服务器路径一般比较短吧,客户端那边要明显很多很多。
话接上回说,给小同学讲解之后,表示不是很明白----我这表达太菜了,呜呜呜呜。好吧,直观一点,然后我用object c写了一个有过程掩饰的A*,想想自己的虚拟机,潸然泪下。objec c自己一直是纸上谈兵,这次也给做个小菜尝尝,xcode做ui那是真心的方便啊,quartz也很赞!!!然后,然后是一直键盘声,和vmware的卡咔咔咔,再然后,再然后就这玩意儿就可以跑了,嘿嘿!
闲话少说,上图!
github: https://github.com/garfieldchen/AStarFinding
参考资料:
1. http://www.policyalmanac.org/games/aStarTutorial.htm这是一篇好文
2. http://snowyrock.wordpress.com/2007/07/15/a%E8%B7%AF%E5%BE%84%E5%AF%BB%E6%89%BE%E7%AE%97%E6%B3%95%E5%85%A5%E9%97%A8/这是上文的中中文版
3. http://harablog.wordpress.com/2011/09/07/jump-point-search/ JPS 算法,G + F + W 你懂的
这个object c版的a*只实现了,基本的A*,暂时没有实现我提到的JPS,但不久也就有了,代码可以随意使用,谢谢你看得起,哈哈。
使用说明 vm mac osx 10.7 + xocde 4.1
step1 : create map
step2: create block 0 - n times
step3. mouse down on some none block tile, drag to another tile, release, there's it, enjoy!
color : orange - > open node , purge -> close node, green -> target position, blue ===== oh, god , thanks, it's the way home.
相关文章推荐
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings
- The program 'unzip' is currently not installed. You can install it by typing:
- PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- cocoapods was not able to update the 'master' repo.if it is a unexpected issue and persists you can
- Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings.
- 'WHERE' is the same of 'on' in mysql(many times,but not always)
- The 'Microsoft.ACE.Oledb.12.0' provider is not registered on the local machine
- The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to us
- 安装j2ee 报错 Could not find the required version of the Java(TM)2 Runtime Environment in '(null)'
- 关于编写WPF UserControl时提示The name 'InitializeComponent' does not exist in the current contextr的解决!
- HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"
- 【Android异常】The specified child already has a parent. You must call removeView() on the child's paren
- Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the ser
- date(): It is not safe to rely on the system's timezone settings in CodeIgniter
- hbase无法启动,The node /hbase is not in ZooKeeper和Can't get master address from ZooKeeper;
- android搭建环境错误 daemon not running. starting it now on port 5037 ADB server didn't ACK
- The library 'xx.jar' contains native libraries that will not run on the device解决办法
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use