Enemy-motion-aware bullet simulation #122

Closed
opened 2026-08-29 19:04:14 +02:00 by SirStone · 1 comment
Owner

What to build

Fix the enemy-motion snapshot error by interpolating enemy position at bullet arrival time in the virtual bullet tracker.

Currently all 64 virtual bullets in a generation use the same enemy position snapshot from onScannedBot. Bullets travel for 5-100 ticks, but the simulation checks hit/miss against the current enemy position, not where the enemy will be when the bullet arrives.

Acceptance criteria

  • stepBullets accepts enemyVx, enemyVy parameters
  • stepBullets computes interpolated enemy position: enemyX + enemyVx * arrivalTicks
  • spawnBullet calculates arrivalTicks = ceil(distance / bulletSpeed) and passes velocity
  • Enemy velocity is threaded from onScannedBot (which already computes e.speed and e.direction)
  • For stationary enemies (zero velocity), behavior is identical to current implementation
  • Fitness scores are more accurate for moving targets
  • Existing hit detection geometry tests still pass

Blocked by

Tracker extraction (#121) - the VBulletEnvironment type must exist before we change its API

Parent

Closes part of #118

## What to build Fix the enemy-motion snapshot error by interpolating enemy position at bullet arrival time in the virtual bullet tracker. Currently all 64 virtual bullets in a generation use the same enemy position snapshot from onScannedBot. Bullets travel for 5-100 ticks, but the simulation checks hit/miss against the current enemy position, not where the enemy will be when the bullet arrives. ## Acceptance criteria - stepBullets accepts enemyVx, enemyVy parameters - stepBullets computes interpolated enemy position: enemyX + enemyVx * arrivalTicks - spawnBullet calculates arrivalTicks = ceil(distance / bulletSpeed) and passes velocity - Enemy velocity is threaded from onScannedBot (which already computes e.speed and e.direction) - For stationary enemies (zero velocity), behavior is identical to current implementation - Fitness scores are more accurate for moving targets - Existing hit detection geometry tests still pass ## Blocked by Tracker extraction (#121) - the VBulletEnvironment type must exist before we change its API ## Parent Closes part of #118
SirStone added the ready-for-agent label 2026-08-29 19:05:49 +02:00
Author
Owner

Implemented in commit a730a9e

Summary: Fixed enemy-motion snapshot error by interpolating enemy position at bullet arrival time. stepBullets now accepts enemyVx, enemyVy and computes interpolated position: enemyX + enemyVx * arrivalTicks. spawnBullet calculates arrivalTicks = ceil(distance / bulletSpeed).

Files:

  • vapourbot_garage/src/vapourbot/gun.nim - stepBullets signature, interpolation logic, spawnBullet arrival calculation
Implemented in commit a730a9e **Summary:** Fixed enemy-motion snapshot error by interpolating enemy position at bullet arrival time. stepBullets now accepts enemyVx, enemyVy and computes interpolated position: enemyX + enemyVx * arrivalTicks. spawnBullet calculates arrivalTicks = ceil(distance / bulletSpeed). **Files:** - `vapourbot_garage/src/vapourbot/gun.nim` - stepBullets signature, interpolation logic, spawnBullet arrival calculation
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#122