T2: Add linear gun module #180
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#165 (ModularBot wayfinder map)
What to build
Linear extrapolation gun that plugs into the existing gun harness. Predicts enemy continues at current velocity and heading. Extrapolates position by ticksToArrive = distance / bulletSpeed. Returns absolute (x, y). onResult() is no-op (analytical gun).
Register it in ModularBot alongside head-on gun. The bot now has two guns competing via virtual bullet fitness — should switch to linear against moving targets.
Acceptance criteria
Blocked by
#179 (T1)
Implemented. Build is clean.
common_libs/guns/linear.nim— new file:predict: ticksToArrive = dist / bulletSpeed; extrapolates usingcos(headingRad) * speed * ticksfor X,sin(headingRad) * speed * ticksfor Y; clamps to arena boundsonResult: no-op (analytical gun)ModularBot_garage/src/ModularBot.nimchanges:guns/linearlinear: LinearGunfieldinitTracker(1)→initTracker(2)(gun 0 = head-on, gun 1 = linear)onScannedBot: spawns virtual bullets for both guns each scangunId(caseon 0/1)selectShotpicks winner;predcomputed from winning gun'spredict