artificial intelligence - AI Pathfinding using 2D polygons instead of waypoints - Is there a recommended algorithm? -
i'm trying utilize path finding on series of convex polygons, rather waypoints. farther complicate this, polygons made users, , may have inconsistent vertices. example:
we know object x wide y deep, , polygons have vertices @ locations. there specific algorithm find fastest way goal while keeping entire object in polygons (if understand correctly, a* works on waypoints)? how handle vertices not beingness same object beingness @ same location?
edit: polygons convex; it's 2 separate polygons edges on line. also, how implement * pathfinding, node based scheme wouldn't work in 'infinite' resolution polygon?
in general, shortest-path segments have, end-points, either polygon vertices or start , goal points. if build graph includes segments (from start each "visible" polygon vertex, goal each "visible" polygon vertex, , each polygon vertex each other polygon vertex) , run a* on that, have optimal path. cost of building graph a* is:
for each vertex, visibility-test find visible vertices: simple algorithm (for each pair of vertices, see if segment 1 lies within polygon) o(n^3). building convex polygons , processing them independently, or using smarter "radial sweep" algorithm can lower this, suspect still around o(n^2). for each query (from start-point goal-point), o(n) visibility-test find vertices can see.if going apply a* once, cost of building fixed part of a* graph single traversal may steep. alternative build graph incrementally utilize it:
java code implementing above approach can found here.
artificial-intelligence path-finding
No comments:
Post a Comment