feat(nav): renderoni/nav — tiled grid A*, expedition router, spatial hash - #41
Open
cmaycumber wants to merge 1 commit into
Open
cmaycumber wants to merge 1 commit into
cmaycumber wants to merge 1 commit into
Conversation
…atial hash
NavGrid is generic over a NavCostField the game supplies (size, cellCost,
optional coarseWalkable/passable). Tiles are sampled lazily and LRU-evicted
(evicted arrays are pooled), blockers are re-applied on rebuild, and A* runs
in a bounded window with generation-stamped scratch and a typed-array heap.
Cell size, tile size, tile cap, window, budget, easy-cost and blocker slack
are options; defaults reproduce the Sunder March grid exactly.
ExpeditionRouter joins complete local paths into long corridors against a
small RouterNav interface. SpatialHash<T> works over anything with a
position {x, z}.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new
renderoni/naventry point: grid pathfinding for large worlds, extracted from a shipping game.NavGrid: generic over aNavCostFieldthe game supplies (size,cellCost(x, z), optionalcoarseWalkable/passablefor far-away queries that must not build tiles).nearestWalkable,lineClear,segmentWalkableandprewarm.ExpeditionRouter: joins complete local paths into long corridors across the map against a smallRouterNavinterface, with a ticketed request API.SpatialHash<T>: a neighbour-query grid over anything withposition: { x, z }.The game now supplies only its cost rules (water, cliffs, slope, roads) and uses these classes directly. Its 496-test suite passes on them, including long-range navigation tests.
Verification: typecheck, build, 246/246 tests.
🤖 Generated with Claude Code