feat: async pathfinding with provisional paths and bit-grid snapshots

- Add StandableBitGrid: O(1) bit-packed snapshot (~6KB per 50k tiles vs HashMap overhead)
- Implement two-tier pathfinding: sync for short paths (<64 tiles), provisional+async for long paths
- calculate_provisional_path: capped A* returning path to best heuristic node
- calculate_async_path: A* using bit-grid (Send+Sync, no thread_local)
- prepare_paths system: dispatches provisional paths immediately, spawns async for full paths
- poll_async_paths + splice_completed_async_paths: seamless path transition when async completes
- Entities start walking immediately on provisional path while full path computes in background

Architecture:
  FixedUpdate: prepare_paths → update_wandering_targets → movement
  PostUpdate: poll_async_paths → splice_completed_async_paths

Priority: DF-like pathing (immediate movement) > performance > memory
This commit is contained in:
2026-03-18 16:35:39 +00:00
parent 79a386afa6
commit c902cff908
9 changed files with 626 additions and 2417 deletions
+1
View File
@@ -14,6 +14,7 @@ rayon = "1.11.0"
rustc-hash = "2.1.1"
ahash = "0.8.12"
nohash-hasher = "0.2.0"
futures-lite = "2.6"
# Enable max optimizations for dependencies, but not for our code:
[profile.dev.package."*"]