Silentor / InfluenceTerrainDemo

Some experiments with zone-based terrain generation
4 stars 2 forks source link

Path/Navigator refactoring #125

Closed Silentor closed 4 years ago

Silentor commented 4 years ago

Move path refining strategy from Path to Navigator. Path should be just a storage for macro navnodes and micro waypoints, provide a handy api for path queries. Navigator should refine a path segment by segment via Pathfinder service, store refined points in Path (for debug purpose, and for path sharing (in a future)), and move along this points. 1) Implement next node refinement logic in Navigator (from current point to edge between next and next2 nodes, but return path to the nearest next node point (at edge between current and next nodes)). Repeat till finish point. If we cant find a path, then mark current-next edge as an impassable and rebuild macro path. 1.1) Implement A pathfinding variant with a predicate to check node and return path to given node. Its a subset of multidestination A, but more effective for my case (because I have only 1 main direction point and many suitable finish points) 1.2) Add some Get prev/next/next2 Node api to Path 2) Clean up Path of refining logic

Has some reference to #119