Fix drive-to-range stall: BT_GOTO self-drives + steers correctly cross-net

The BT_GOTO beeline never actually closed on a target -- three separate faults:

1. It was gated behind `if(gBTDrive.forced)`, and `forced` was set ONLY by
   BT_AUTODRIVE -- a chicken-and-egg where the block that would drive was gated
   on the drive already being on.  So BT_GOTO alone just turned in place (the
   "stall").  Fix: BT_GOTO enables forced mode itself AND supplies its own
   forward throttle (a beeline must drive, not only steer), cutting the throttle
   inside a stop radius (weapon range for "enemy", so it holds + shoots).

2. Steering used the gDriveHeading SCALAR MIRROR (seeded to 0), but MP pilots
   spawn facing a non-zero heading -> it steered the WRONG way.  Fix: heading
   error from the mech's ACTUAL forward (localToWorld's -Z axis), signed angle
   to the target.

3. The goto turn was routed through controlsMapper->turnDemand, which zeroes out
   in -net mode (the mapper key-bridge only shapes the local viewpoint mech
   there) -- the heading froze and A drove straight past B.  Fix: apply the goto
   turn to the orientation integration DIRECTLY (if gBTGotoActive, turn=
   gBTGotoTurn), after the mapper read.

Verified 2-node one-box: A with BT_GOTO="enemy" ALONE (no autodrive) drives
dist 1673->231m, holds at weapon range, mechPicks=59, autofire -> B hdlr=192,
DESTROYED -- a fully automated human-style cross-pod KILL via the real beam
path (not the FORCE_DMG hook).  Solo un-regressed (plain autodrive still drives;
goto="enemy" resolves the enemy, mechPicks=59, no crash).  BT_GOTO_LOG traces
the beeline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-09 15:02:51 -05:00
co-authored by Claude Fable 5
parent 0dfbb97dcc
commit 9353d59eb9
2 changed files with 79 additions and 13 deletions
+17 -8
View File
@@ -122,16 +122,25 @@ groundPicks=0` → beam → `*** DESTROYED`. Also proved `PickRayHit` resolves a
(`hit=1` at 757 m in a 2-node run); the replicant `localToWorld` is correct (DeadReckon + `localToWorld=
localOrigin`, mech4.cpp:1191). [T2]
**STILL OPEN — drive-to-range.** `BT_GOTO`/`BT_AUTODRIVE` steer + move A, but A stalls (`gait adv=0`) short
of the enemy and often fails to line the boresight onto a peer at range — so an AUTOMATED 2-node kill via the
real beam path isn't demonstrated (the `BT_MP_FORCE_DMG` hook still is). A HUMAN can now aim (the ray is
correct in the default view); the gap is the auto-drive facing the target. Locomotion/goto issue, not MP.
Test aid: `BT_GOTO="enemy"` beelines toward the nearest live peer (solo dummy OR replicant); `scratchpad/
mp_kill_test.sh`.
**FIXED — drive-to-range (the automated cross-pod kill now runs end-to-end).** The `BT_GOTO` beeline had
three separate faults: (1) it was gated behind `if(gBTDrive.forced)` (mech4.cpp), and `forced` was set ONLY
by `BT_AUTODRIVE` — so `BT_GOTO` alone never drove (chicken-and-egg: the block that would drive was gated on
the drive being on). Fix: `BT_GOTO` now enables forced mode itself + supplies its own forward throttle (a
"beeline" must drive, not just steer), cutting throttle inside a stop radius (weapon range for `enemy`, so it
holds and shoots instead of ramming). (2) The steering used the `gDriveHeading` SCALAR MIRROR (seeded to 0),
but MP pilots spawn facing a non-zero heading, so the beeline steered the WRONG way. Fix: compute the heading
error from the mech's ACTUAL forward (`localToWorld`'s -Z axis), signed angle to the target. (3) The goto turn
was routed through `controlsMapper->turnDemand`, which zeroes out in -net (the mapper key-bridge only shapes
the local viewpoint mech there) — the heading froze and A drove straight past B. Fix: apply the goto turn to
the orientation integration DIRECTLY (`if(gBTGotoActive) turn=gBTGotoTurn`), after the mapper read.
VERIFIED 2-node: A `BT_GOTO="enemy"` alone (no autodrive) drives `dist 1673→231 m`, holds at range, `mechPicks=59`,
autofire → **B hdlr=192, DESTROYED** — a fully automated human-style cross-pod kill via the real beam path
(not the FORCE_DMG hook). Solo un-regressed (plain autodrive + goto both work). `scratchpad/mp_kill_test.sh`;
`BT_GOTO_LOG` traces the beeline.
## Remaining (P6 phase 4 / Phase 7)
Drive-to-range / auto-face reliability (above) for a fully AUTOMATED cross-pod kill demo; replicant GAIT
animation (derive from replicated velocity); the pod-LAN config (real IPs, bare-IP pilot entries). See
Replicant GAIT animation (derive from replicated velocity); the pod-LAN config (real IPs, bare-IP pilot
entries). See
[[open-questions]]. [T3]
## MP-front scout (task #45, 2026-07-09) — the P6 chain SURVIVES the combat/HUD rework [T2]