feat(pathfinding): add the @codexo/exojs-pathfinding extension package - #676
Conversation
One search core - A* over integer node handles, with an optional pruned expansion - serving two navigation spaces. GridSpace is a finite window of weighted cells with diagonal policies, brushfire clearance for wide agents and string-pulling smoothing; WaypointGraph is a directed graph whose edges carry a kind and a payload, which is what a platformer needs and what a grid cannot express. Both implement NavigationSpace, and so can application code. The window is finite by construction rather than chunk-aware, which is the answer for streamed maps: size it to the loaded region and push edits through setCost. That keeps every search terminating without the package learning what a tilemap is - the integration is a cost callback, not a package edge. Jump-point search is a pruned successor generator the grid hands to the same A*, not a second solver, and it self-enables only where its assumptions hold: uniform costs, agentSize 1, corner cutting disallowed. Its pruning rules are derived for that stricter movement rule and differ from the textbook ones - a diagonal step has no forced neighbours at all, and a straight step gains them from the cell diagonally behind it. A randomized suite pins jump-point cost against plain A* cost on the same grids. Determinism is a contract: equal-f nodes leave the open list by ascending node id, so a query is reproducible across runs and machines. The search state lives in typed arrays reset by a generation counter, so interleaved queries over different spaces cost one counter increment and a search allocates nothing that scales with the nodes it visits - gated by an allocation suite that budgets a query against the result it returns while expanding an order of magnitude more nodes than the path is long. Claude-Session: https://claude.ai/code/session_01NSrXpH1WyqP7udpWWhHz1i
…eference Two playground examples under a new `pathfinding` category. grid-navigation puts the decisions that change the answer on a panel - jump-point pruning, path smoothing, a 2x2 agent, the diagonal policy - next to the expanded-node counter that shows what each of them costs; painting a single mud cell makes the grid non-uniform and switches pruning off by itself, which is the clearest way to see what the fast path is worth. tilemap-navigation builds the grid from a tile layer through the cost callback, which is the only place the two packages meet: the example imports the tilemap package, the pathfinding package does not. A two-chapter guide part follows the same split - the grid chapter covers costs, diagonals, clearance, smoothing, statuses, staleness and the tilemap recipe, the waypoint chapter covers typed traversal edges, positionless Dijkstra mode, and implementing NavigationSpace for a world of one's own. Every snippet is a real compiled file under examples/guides. Claude-Session: https://claude.ai/code/session_01NSrXpH1WyqP7udpWWhHz1i
The source-hygiene gate reads a comment opening with "The agent" as development provenance. The sentence says the same thing about the walker it actually describes. Claude-Session: https://claude.ai/code/session_01NSrXpH1WyqP7udpWWhHz1i
Every lockstep package carries the repository's current version, 0.16.1, not the next one; release:cut is what moves them together. Claude-Session: https://claude.ai/code/session_01NSrXpH1WyqP7udpWWhHz1i
Bundle ReportChanges will increase total bundle size by 18.69MB (59.71%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: site-server-esmAssets Changed:
App Routes Affected:
view changes for bundle: exo-full-iife-min-Exo-iifeAssets Changed:
Files in
view changes for bundle: exo-full-iife-Exo-iifeAssets Changed:
Files in
|
Grid and graph pathfinding as an opt-in extension package, per the pathfinding design: one generic search core over an abstract
NavigationSpacewith integer node handles and typed-array search state (zero allocation in the hot path, deterministic tie-breaking, optimal with an admissible heuristic), and two spaces.Pathfinder:findPath,findPathBetween,floodFrom; optionssmooth,agentSize,maxExpandedNodes,snapToNearest.PathResultcarriesstatus(found/unreachable/budget-exceeded), nodes, points, edges, cost, revision and expanded-node count.GridSpace: per-cell costs (0 = blocked), clearance for agent size, diagonal policy (never/no-corner-cutting/always), a finite window with integer origin for streamed maps,setCostbumpingrevision, string-pulling smoothing, and JPS as a pruned expansion on the same A* that enables itself for uniform grids.WaypointGraph: nodes with optional positions, edges with a userkindand payload (the platformer contract); without positions it degrades to Dijkstra.tilemap-navigationexample.Forty-nine package tests (optimality against an independent Dijkstra, randomised JPS equals A*, corner cutting, budgets and snapping, determinism, clearance, smoothing, waypoint kinds, allocation gates via the sampling profiler), two examples verified in the browser, a guide chapter, API docs. Wired like the other packages; never published, so it needs
release:bootstrapat the next coordinated release.Deliberately not built from the design's dock points: PathFollower, FlowField, NavmeshSpace, request queue / worker offload, debug overlay.