If the game world is changing often, planning ahead is less valuable. Planning generally is slower but gives better results movement is generally faster but can get stuck. There’s a tradeoff between planning with pathfinders and reacting with movement algorithms. Pathfinders let you plan ahead rather than waiting until the last moment to discover there’s a problem. Either avoid creating concave obstacles, or mark their convex hulls as dangerous (to be entered only if the goal is inside): You can however extend a movement algorithm to work around traps like the one shown above. In contrast, a pathfinder would have scanned a larger area (shown in light blue), but found a shorter path (blue), never sending the unit into the concave shaped obstacle. It then finds its way around the “U”-shaped obstacle, following the red path. Near the top, it detects an obstacle and changes direction. There is nothing in the area it scans (shown in pink) to indicate that the unit should not move up, so it continues on its way. The unit is initially at the bottom of the map and wants to get to the top. Why bother with pathfinding? Consider the following situation:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |