Claude/fix unit pathfinding o1r kt#1065
Merged
Merged
Conversation
Clean up comments to remove game-specific references. The movement architecture is inspired by RTS conventions but doesn't need to call out specific games. https://claude.ai/code/session_01WMrGYxn1NPTPcGn9XCykRh
1. Building/gathering worker path failures:
- Added calculateInteractionPoint() to find valid navmesh points
on building perimeters instead of blocked centers
- clearUnitMovementTarget() now reroutes workers to interaction
points instead of cancelling assignments
- Workers path to walkable perimeter positions, not obstacle centers
2. Water navmesh support in worker:
- Added loadWaterNavMesh() for naval unit pathfinding
- Added findWaterPath() for water-based path queries
- Added isWaterWalkable() for water navmesh point validation
- Naval pathfinding no longer falls back to main thread
3. TileCache limitation documented:
- Explained why pre-exported navmesh doesn't support dynamic obstacles
- Recommended loadNavMeshFromGeometry() for games with buildings
https://claude.ai/code/session_01WMrGYxn1NPTPcGn9XCykRh
Cylinder obstacles are 5-10x faster for TileCache updates compared to box obstacles. Box obstacles require full tile rebuild from input geometry, while cylinders use an optimized path. Trade-off: Cylinders approximate rectangular buildings using the max dimension, so there's slightly more blocked area around buildings. This is acceptable since: 1. Building placement is infrequent (every 10-30 seconds) 2. The performance gain is significant 3. Units already maintain clearance via walkableRadius Changes: - PathfindingSystem: Use addObstacle() instead of addBoxObstacle() - pathfinding.worker.ts: Use cylinder directly, remove box fallback https://claude.ai/code/session_01WMrGYxn1NPTPcGn9XCykRh
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.
No description provided.