Implement async job pathfinding system

- Add calculate_traversal_distance() - full A* that returns actual distance
- Add batch_calculate_traversals() for efficient batch processing
- Add Calculating state to JobState enum for dorf locking
- Add approach_target and retry_count to job Entry
- Add helper methods: is_dorf_locked, get_locked_dorfs, get_scope_for_job
- Add job_assignment config section with max_dorfs_per_job
- Create job_pathfinding.rs with main pathfinding system:
  - Throttled to MAX_JOBS_PER_TICK (5) per frame
  - Expanding scope: 5 -> 20 -> 200 dorfs based on retry count
  - Uses full pathfinding, not provisional
  - Pre-computes approach_target for assigned dorfs
- Simplify job_assignment.rs to only handle idle fallback
- Update has_fell_tree to check state (Unclaimed, Calculating, Claimed)
This commit is contained in:
2026-03-29 13:13:53 +01:00
parent 3c74a68d4d
commit 053fe415bf
8 changed files with 506 additions and 131 deletions
+4 -1
View File
@@ -6,4 +6,7 @@ vsync = "mailbox"
[spawn_counts]
dorfs = 5
pigs = 0
rabbits = 0
rabbits = 0
[job_assignment]
max_dorfs_per_job = 5