- 2
- 0
- 约3.88千字
- 约 41页
- 2019-04-17 发布于贵州
- 举报
* 中华民族有着五千多年的文明历史,中华民族在世界上是一个非常卓越和伟大的民族。我们有过繁荣昌盛的唐朝,有过强盛无比疆域辽阔的汉朝和元朝,更有灿烂美丽的唐、宋文化 A*路径搜索A* Pathfinding We are going to discuss the fundamentals of the A* pathfinding algorithm. 基本A*路径搜索算法 The A* Algorithm provides an effective solution to the problem of pathfinding. 定义搜索区域Defining the search area The first step in pathfinding is to define the search area. 首先定义搜索区域。 The game world needs to be represented by points that both the game characters and objects can occupy. We need to reduce the nodes to a manageable number, which is what we mean when we say we need to simplify the search area. 减少搜索区域的节点数量,简化搜索区域。 定义搜索区域Defining the search area 基于方块的搜索区域Tiled search area Starting the search We will use the A* algorithm to find the shortest path between any two nodes while avoiding the obstacles. 避开障碍在任意两点之间用A*算法获得最短路径。 OpenList-We need a way to keep track of which tiles need to be searched. 可以作为后备检测的点的集合; ClosedList-the tiles that already were checked. 已经检测完成的点的集合。 A*伪代码A* pseudo code Add the starting node to the open list While the open list is not empty { current node=node from open list with the lowest cost if current node=goal node then path complete else move current node to the closed list examine each node adjacent to the current node for each adjacent node if it isn’t on the open list and isn’t on the closed list and it isn’t an obstacle then move it to open list and calculate cost } A*伪代码A* pseudo code 将开始点加到Open List表中; 重复一下过程,直到Open List表空为止: { 当前点=OpenList表中代价值最小的点; 如果当前点为目标点, 则 搜索完成; 否则 将当前点移到ClosedList表中; 对与当前点相连的每一点,重复执行: 如果该点不在OpenList、ClosedList,并且不是障碍点 则 将该点移到OpenList表中,计算该点的代价值; } Create a tiled search area Spider-starting point Human character-destination Solid black squares-wall obstacles Adjacent tiles to consider We proceed to check each of the eight adjacent tiles and then add each
您可能关注的文档
最近下载
- 旁站监理记录表(装配式结构安装专用).docx VIP
- 新人教版小学数学五年级下册《观察物体》PPT课件.ppt VIP
- 紫外可见分光光度计安装确认方案.doc VIP
- 2025《全国一体化算力网 算力多量纲计费技术要求》.pdf VIP
- 2023年水利部长江水利委员会面试真题(19日上午).docx VIP
- 2022国家公务员水利部黄河水利委员会面试试题.docx VIP
- 2020国家公务员考试水利部黄河水利委员会面试真题.docx VIP
- 2025年中考语文二轮复习:散文阅读 专题练习题(含答案).docx VIP
- 2025麦肯锡AI应用现状调研-智能体创新和转型-2025-12-宏观大势.docx VIP
- 军人离婚协议书范本通用版合集三篇.docx VIP
原创力文档

文档评论(0)