#124 twist-sign VERIFIED correct (live missile bench) + the rig to do it

The frame-adapter's inferred twist-sign flip (SelectSlice theta -= twist,
vs the binary's += pre-reflection) was the last unverified half of #124 --
every earlier probe ran at twist 0.  Bench: stationary madcat target with
the torso PINNED at 0 / +140 / -140 deg, LRM salvos from a fixed shooter
(missiles = the authentic cylinder path; the binary DROPPED zone -1 beam
damage).  Result: slice picks track the physically-facing flank in BOTH
directions (twist-left -> right-family zones for left-flank impacts,
twist-right -> left-family), deterministic, wrong-sign outcome (slice 7
vs observed slice 1) clearly excluded.  No game-code change needed.

Instrumentation added (all env-gated):
- torso.cpp BT_FORCE_TWIST=<-1..1>: HOLD the sim's analogTwistAxis (the
  input-level pin was dead -- live input rides the CONTROLS.MAP device
  push, and Basic mode auto-centers; sim-level is plumbing-independent).
- dmgtable.cpp [slice] line: rot flag, live twist, thetaIn/thetaAdj,
  chosen slice -- the weighted leaf roll made zone-only logs ambiguous.
- [dmgresolve] now names the zone (BTMechZoneSegAndName).
- mech4.cpp BT_FORCE_TWIST input pin + one-shot mode cycle (kept as doc
  of the dead path), mechmppr [mppr] mode probe.
- scratchpad/night11/twistsign.sh: the 3-config bench.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Joe DiPrima
2026-08-04 15:49:14 -05:00
co-authored by Claude Fable 5
parent 952f10b18d
commit 1f995ee35a
5 changed files with 122 additions and 1 deletions
+23 -1
View File
@@ -175,6 +175,7 @@ DamageZonePercentTable *
{
if (sliceCount <= 0) return 0;
Scalar thetaIn = theta;
if (rotateWithTorso) // binary this[3] != 0
{
// #124 frame adapter, angular half: theta arrives in the 1995 frame
@@ -189,6 +190,19 @@ DamageZonePercentTable *
int index = (int)floorf(theta * (Scalar)sliceCount * (1.0f / TwoPi));
if (index < 0) index = 0;
if (index > sliceCount - 1) index = sliceCount - 1;
// #124 twist-sign bench: expose the twist term itself -- the leaf is a
// weighted roll, so the SLICE choice (not the rolled zone) is the signal.
if (getenv("BT_DMGTABLE_LOG"))
{
static int s_sl = 0;
if (s_sl++ < 400)
DEBUG_STREAM << "[slice] rot=" << (int)rotateWithTorso
<< " twist=" << (float)owner->TorsoHeading()
<< " thetaIn=" << (float)thetaIn
<< " thetaAdj=" << (float)theta
<< " -> slice " << index << "/" << sliceCount << std::endl;
}
return slices[index];
}
@@ -327,6 +341,12 @@ int
{
static int s_rh = 0;
if (s_rh++ < 400)
{
extern int BTMechZoneSegAndName(void *mech_v, int zone_idx,
int *seg_out, const char **name_out);
int seg = -1; const char *zname = 0;
if (resolved >= 0)
BTMechZoneSegAndName((void *)owner, resolved, &seg, &zname);
DEBUG_STREAM << "[dmgresolve] impact=(" << impact.x << ","
<< impact.y << "," << impact.z << ")"
<< " local=(" << local.x << "," << local.y << "," << local.z << ")"
@@ -334,7 +354,9 @@ int
<< " frac=" << (depth / heightRef)
<< " layer=" << layerIndex << "/" << layerCount
<< " theta=" << theta
<< " -> zone " << resolved << std::endl;
<< " -> zone " << resolved
<< " '" << (zname ? zname : "?") << "'" << std::endl;
}
}
return resolved;
}