Research bullet mechanics — speed, travel time, lead angle formula #160

Closed
opened 2026-09-13 20:27:52 +02:00 by SirStone · 1 comment
Owner

Question

What are the bullet mechanics in Tank Royale? Specifically:

  • Bullet speed formula (function of firepower)
  • How to compute travel time to a target at distance D
  • Lead angle formula: given enemy position, velocity vector, and bullet speed, what's the aim angle?
  • Does the bot API expose bullet events (fired, hit, miss)?
  • Any existing lead-angle code in the repo (PPO_Bot, EvoBot, etc.)?
## Question What are the bullet mechanics in Tank Royale? Specifically: - Bullet speed formula (function of firepower) - How to compute travel time to a target at distance D - Lead angle formula: given enemy position, velocity vector, and bullet speed, what's the aim angle? - Does the bot API expose bullet events (fired, hit, miss)? - Any existing lead-angle code in the repo (PPO_Bot, EvoBot, etc.)?
SirStone added the wayfinder:research label 2026-09-13 20:27:52 +02:00
Author
Owner

Resolution

Bullet speed: 20 - 3 * firepower (range 11–19.7 units/turn), constant velocity, no decay.
Travel time: D / bulletSpeed.
Lead angle: quadratic intercept — solve (vx²+vy²−s²)t² + 2(dx·vx+dy·vy)t + D² = 0, smallest positive root. Two Newton steps suffice.

Bullet events available in Nim API: onBulletFired, onBulletHit, onBulletHitWall, onBulletHitBullet.

No existing lead-angle code in repo. Formula needs to be implemented.

Research: SNNBot_garage/research/bullet-mechanics.md on branch research/bullet-mechanics

## Resolution Bullet speed: `20 - 3 * firepower` (range 11–19.7 units/turn), constant velocity, no decay. Travel time: `D / bulletSpeed`. Lead angle: quadratic intercept — solve `(vx²+vy²−s²)t² + 2(dx·vx+dy·vy)t + D² = 0`, smallest positive root. Two Newton steps suffice. Bullet events available in Nim API: onBulletFired, onBulletHit, onBulletHitWall, onBulletHitBullet. No existing lead-angle code in repo. Formula needs to be implemented. Research: `SNNBot_garage/research/bullet-mechanics.md` on branch `research/bullet-mechanics`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#160