fix(server): address PR #14 review — ordering, docs, version pin
- Fix NpcPlugin system ordering: .before(compute_paths) instead of .after(advance_tick) so PathRequests are picked up same frame - Fix stale doc comment in interpretation.rs: system runs BEFORE knowledge events, not after - Add TODO(v0.2) on RelationshipGraph about information boundary limitation for multiplayer - Document cardinal-only movement as deliberate v0.1 choice - Add comment on manhattan_distance u32::MAX fallback for cross-z - Pin pathfinding crate to 4.11 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,8 @@ pub struct PathBlocked;
|
||||
|
||||
/// System: compute paths for entities with PathRequest components.
|
||||
/// Uses A* over the WalkabilityMap with cardinal movement (4 neighbors).
|
||||
/// Cardinal-only is a deliberate v0.1 simplification: diagonal movement
|
||||
/// would require √2 cost handling and diagonal wall-clipping checks.
|
||||
/// Removes PathRequest and inserts ComputedPath or PathBlocked.
|
||||
pub fn compute_paths(
|
||||
mut commands: Commands,
|
||||
@@ -90,6 +92,8 @@ pub fn compute_paths(
|
||||
.filter(|neighbor| walkability.can_move_to(neighbor))
|
||||
.map(|neighbor| (neighbor, 1u32))
|
||||
},
|
||||
// manhattan_distance returns None for cross-z-level pairs;
|
||||
// u32::MAX makes A* deprioritize those nodes (v0.1: single z-level)
|
||||
|pos| pos.manhattan_distance(&goal).unwrap_or(u32::MAX),
|
||||
|pos| *pos == goal,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user