demo/bench harness polish: BT_SELF_DAMAGE_DELAY + two harness bug fixes + the OBS limp demo bat

- BT_SELF_DAMAGE_DELAY=<s>: hold the harness off for n seconds (capture demos:
  healthy walking first).  Fixed its underflow bug (the countdown crossed below
  zero, which is also the "read the env" sentinel -- the delay re-armed forever).
- The one-death latch was fed by EVERY mech's update: a mission that generated
  any destroyed mech entity tripped it at frame one and the harness silently
  never fired (random per mission roll).  Now viewpoint-mech only.
- run\limpdemo.cmd: the OBS capture demo -- 30 s healthy auto-walk, then the
  leg crosses half on the final damage tick: klaxon-klaxon-"reverse disabled"
  + the limp, then unlimited limp footage (waypoint 8000,8000).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Joe DiPrima
2026-07-29 19:47:20 -05:00
co-authored by Claude Fable 5
parent 18766a167b
commit 5b19cd6c3f
2 changed files with 40 additions and 1 deletions
+20 -1
View File
@@ -5627,7 +5627,12 @@ void
// shooting us. (Live damage knocks the power bus down, which is exactly
// the signal a respawn test is trying to read.)
static int s_sdSpent = 0;
if (IsMechDestroyed())
// Latch off at the VIEWPOINT mech's first death only. (The latch used
// to be fed by EVERY mech's update -- a mission that generated any
// destroyed mech/wreck entity tripped it at frame one and the harness
// silently never fired; random per mission roll.)
if ((Entity *)this == application->GetViewpointEntity()
&& IsMechDestroyed())
s_sdSpent = 1;
if ((Entity *)this == application->GetViewpointEntity()
&& getenv("BT_SELF_DAMAGE") && !s_sdSpent
@@ -5635,6 +5640,20 @@ void
{
static float s_sdAccum = 0.0f;
static int s_sdTicks = 0;
// BT_SELF_DAMAGE_DELAY=<s>: hold the harness off for the first n
// seconds of the mission (capture/demo: healthy walking first).
static float s_sdDelay = -1.0f;
if (s_sdDelay < 0.0f)
{
const char *de = getenv("BT_SELF_DAMAGE_DELAY");
s_sdDelay = (de != 0 && *de != '\0') ? (float)atof(de) : 0.0f;
}
if (s_sdDelay > 0.0f)
{
s_sdDelay -= dt;
if (s_sdDelay < 0.0f) s_sdDelay = 0.0f; // NOT below: <0 is the
s_sdAccum = 0.0f; // "read the env" sentinel --
} // underflow re-armed the delay forever
// BT_SELF_DAMAGE_TICKS=<n>: stop after n hits (bench: ramp a leg
// PAST LegHalfStructure then hold, so the limp window is unbounded
// instead of the 1 s between half and destroyed at high dps).
+20
View File
@@ -0,0 +1,20 @@
@echo off
rem #78 OBS capture demo: Black Hawk walks ~12 s, right leg crosses half on
rem the FINAL damage tick (one clean trigger edge), then: klaxon, klaxon,
rem "REVERSE DISABLED" + the limp. Auto-walks via GOTO -- the only input
rem needed is V (or BACKTICK) once, for the 3rd-person chase view.
setlocal
set BT_FE_SOLO=1
set BT_GOTO=8000 8000
set BT_GOTO_THR=0.9
set BT_SELF_DAMAGE=6
set BT_SELF_DAMAGE_ZONE=18
set BT_SELF_DAMAGE_TICKS=12
set BT_SELF_DAMAGE_DELAY=30
set BT_KEY_NOFOCUS=1
cd /d "%~dp0..\content"
powershell -NoProfile -Command "(Get-Content DEV.EGG) -replace '^experience=.*','experience=novice' | Set-Content LIMPDEMO.EGG"
echo [limpdemo] auto-walk, 6x12 into zone 18 (crossing on the last tick), novice
"%~dp0..\build\Release\btl4.exe" -egg LIMPDEMO.EGG
del LIMPDEMO.EGG 2>nul
if errorlevel 1 pause