Skip to content

Improve hero evasive AI for projectiles#159

Merged
npiron merged 1 commit intomainfrom
codex/improve-hero-s-evasion-intelligence
Dec 6, 2025
Merged

Improve hero evasive AI for projectiles#159
npiron merged 1 commit intomainfrom
codex/improve-hero-s-evasion-intelligence

Conversation

@npiron
Copy link
Copy Markdown
Owner

@npiron npiron commented Dec 6, 2025

Summary

  • Behavior: Player movement now dodges incoming projectiles more intelligently, strafing instead of drifting into shots.
  • Tech: Danger vector blends enemy proximity with predicted projectile paths and includes new Vitest coverage for projectile-aware movement.

Testing

  • npm test
  • npm run typecheck

Codex Task

Copilot AI review requested due to automatic review settings December 6, 2025 02:47
@continue
Copy link
Copy Markdown

continue bot commented Dec 6, 2025

Keep this PR in a mergeable state →

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts

@npiron npiron merged commit 9a6698b into main Dec 6, 2025
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the player's AI to dodge enemy projectiles more intelligently by incorporating projectile trajectory prediction into the danger awareness system. The AI now strafes perpendicular to incoming projectiles rather than drifting into them, significantly improving survival against ranged attacks.

Key Changes

  • Extended calculateDangerVector() to analyze enemy projectile trajectories using time-to-closest-approach calculations
  • Blends lateral (perpendicular) and incoming directions for imminent threats, providing natural strafing behavior
  • Added comprehensive Vitest test coverage validating projectile avoidance, proper filtering of retreating projectiles, and threat prioritization

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/playerAI.test.ts New test suite with 3 test cases covering projectile dodging, filtering of non-threatening projectiles, and combined enemy+projectile scenarios
src/player.ts Updated calculateDangerVector() to incorporate projectile threat analysis with trajectory prediction, lateral dodging, and updated documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@npiron npiron deleted the codex/improve-hero-s-evasion-intelligence branch December 8, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants