-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Movement Animation Foundation with A* Integration (TD_060) #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…A* integration ## Summary Implemented smooth cell-by-cell movement animation that follows exact A* pathfinding routes. Animation now perfectly matches the hover preview path, with non-blocking execution. ## Key Changes - Added AnimateMovementAsync to ActorView with CallDeferred queue pattern - Integrated A* pathfinding calculation BEFORE move execution - Created non-blocking animation system to prevent game freezes - Ensured animation path matches preview path exactly ## Technical Details - Fixed deadlock issue with Godot Tween + async/await - Path calculated in GridPresenter before domain state changes - Uses fire-and-forget pattern with CallDeferred for thread safety - Created MovementPresenter for future event-driven coordination ## Files Modified - Views/ActorView.cs - Non-blocking animation with path queue - src/Darklands.Presentation/Presenters/GridPresenter.cs - Pre-calculates A* path - src/Darklands.Presentation/Presenters/ActorPresenter.cs - HandleActorMovedWithPathAsync - src/Darklands.Presentation/Presenters/IActorPresenter.cs - Interface updates - src/Darklands.Presentation/Views/IActorView.cs - Animation method signature - src/Darklands.Presentation/Presenters/MovementPresenter.cs - NEW (future use) ## Also Created - TD_061: Camera Follow During Movement Animation (new backlog item) Fixes: Animation now follows A* path, no more freezing Tests: 688/692 passing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Technical decisions completed: - TD_060 Movement Animation: Verified complete and archived - TD_062 Sprite Clipping Fix: Approved with elegant sub-cell waypoint approach TD_062 Solution highlights: - Uses sub-cell waypoints at corners (30% offset from center) - Implements ADR-006 Animation Event Bridge pattern - Maintains perfect logic/rendering decoupling - Complexity reduced to 2.5h by following existing patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🔍 Code Review for PR #66: Movement Animation FoundationSummaryThis PR successfully implements smooth movement animation for actors in the grid-based game, integrating with the existing A* pathfinding system. The implementation demonstrates good architectural separation between domain and presentation layers. ✅ Strengths1. Architecture Alignment
2. Non-blocking Animation Solution
3. Path Pre-calculation Strategy
|
…othing TD_061 Analysis Update: - REAL ISSUE: FOV updates instantly at destination (game mechanic bug) - NOT ISSUE: Camera smoothing (trivial visual polish) - SOLUTION: Progressive FOV updates using TD_062 callback pattern Problem clarified: - Current: FOV reveals destination before actor arrives - Expected: FOV updates cell-by-cell during movement animation - Architecture: Reuse IMovementAnimationEvents from TD_062 Complexity revised: S (1-2h) → M (3-4h) due to cross-layer coordination 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Summary
Complete movement animation foundation (TD_060) with A* pathfinding integration, plus comprehensive technical analysis of animation-related issues (TD_061, TD_062). This PR establishes the foundation for smooth, visually-correct movement with proper fog of war updates.
Changes Included
TD_060: Movement Animation Foundation ✅ COMPLETE
AnimateMovementAsync
using CallDeferred patternTD_062: Sprite Clipping Fix (Approved for Implementation)
TD_061: Progressive FOV Updates (Correctly Diagnosed)
Technical Implementation
Files Modified (TD_060)
Views/ActorView.cs
- Non-blocking AnimateMovementAsync with CallDeferredsrc/Darklands.Presentation/Views/IActorView.cs
- Added interface methodsrc/Darklands.Presentation/Presenters/ActorPresenter.cs
- HandleActorMovedWithPathAsyncsrc/Darklands.Presentation/Presenters/GridPresenter.cs
- Pre-calculates A* pathsrc/Darklands.Presentation/Presenters/IActorPresenter.cs
- Updated interfaceArchitecture Alignment
Key Technical Insights
Animation System Patterns
Godot Integration Lessons
Future Work Enabled
This foundation enables:
Testing Results
🤖 Generated with Claude Code