#!/usr/bin/env bash # ========================================================================= # EJECT + SEARCHLIGHT (#108, night 13) -- the operator's observation was # that the ghost mechs all had their SEARCHLIGHTS ON. A plain panic eject # respawns fine (ejectghost.sh), so the searchlight is the variable. # # WHY IT IS PLAUSIBLE, mechanically: the searchlight is the only thing that # attaches EXTRA GEOMETRY into a peer's mech render tree -- btl4vid.cpp # builds a spot.bgf cone as a DPLStaticChildRenderable parented to the # lamp's mount-segment renderable. The death path then does a wreck swap # ('victim -> thrdbr.bgf + debris') and respawn does 'rebuilt intact model # (N segs restored, hulk dropped)'. A child renderable held across those # two rebuilds is a lifetime hazard, and it would only bite mechs whose # lamp was ON -- which is exactly the reported population. # # SEQUENCE on A: searchlight ON (0x14) -> confirm it lit -> panic eject # (0x3D) -> respawn. B watches for the un-wreck. # PASS : B logs "[respawn] replicant un-wrecked + warp" # FAIL : wreck with no un-wreck <- the ghost, and the searchlight is it # # NB 0x14 is the searchlight per the shipped bindings comment (left column # 0x10-0x15 = map+/map-/IR/CROUCH/searchlight/display). The hardware name # table calls it "Secondary5" -- the FUNCTION comes from the streamed .CTL # rows, so the script VERIFIES the lamp actually lit before trusting the # result; a silent B with a lamp that never came on proves nothing. # ========================================================================= # # MODE=light -- searchlight ON, then punch out # MODE=nolight -- punch out with the lamp OFF (the A/B control) # # NB no BT_MP_FORCE_DMG here. ejectghost.sh had it, and that is why its # panic presses did nothing: the "control killer" had A dead or mid-respawn # for most of the run, and a punch-out press on a dead mech is a no-op. # That run still produced its control result -- 8 force-kill deaths, 8 peer # un-wrecks, so NORMAL death replication is proven good on this build. set -x MODE="${1:-light}" . /c/git/bt411/scratchpad/night6/bench_common.sh cd /c/git/bt411/content || exit 1 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 rm -f el_${MODE}_a.log el_${MODE}_b.log el_${MODE}_relay.log bt_expert_egg MP.EGG EL.EGG # NIGHT map: the searchlight is a night system and the fog swap only has # meaning there; also the field population was night-map rounds. sed -i "s/^map=.*/map=cavern/; s/^time=.*/time=night/; s/^vehicle=.*/vehicle=madcat/" EL.EGG ( export BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 BT_SPLASH_LOG=1 bt_launch el_${MODE}_b.log EL.EGG 0x0C -net 1601 ) sleep 2 ( export BT_AUTODRIVE=0.6 if [ "$MODE" = "light" ]; then export BT_BTNTEST=0x14,600,660 # SEARCHLIGHT on export BT_BTNTEST2=0x3d,1500,1560 # then punch out else export BT_BTNTEST=0x3d,1500,1560 # punch out, lamp OFF fi export BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 bt_launch el_${MODE}_a.log EL.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py EL.EGG 127.0.0.1:1501 127.0.0.1:1601 > el_${MODE}_relay.log 2>&1 & RELAY=$! sleep 300 kill $RELAY 2>/dev/null sleep 3 bt_kill_ours sleep 2 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 3 AID=$(grep -aoE "MY mech entityID=[0-9]+:[0-9]+" el_${MODE}_a.log | head -1 | cut -d= -f2) echo "=================== EJECT+SEARCHLIGHT RESULT ===================" echo "A's entity id: ${AID:-UNKNOWN}" echo echo "--- 1. did the scripted presses land? ---" grep -a "btntest" el_${MODE}_a.log echo echo "--- 2. DID THE SEARCHLIGHT ACTUALLY COME ON? (if not, the run is void) ---" grep -aiE "searchlight|\[spot\]|lightState" el_${MODE}_a.log | head -10 echo echo "--- 3. A: punch-out + own respawn ---" grep -aE "\[eject\]|PUNCH-OUT|dz\] GRANTED" el_${MODE}_a.log | head -10 echo echo "--- 4. B: the peer's view of A (wreck / un-wreck, in order) ---" grep -aE "wreck:|respawn\] replicant" el_${MODE}_b.log | grep -a "${AID:-@@@}" | head -20 echo -n "wrecks: "; grep -a "wreck:" el_${MODE}_b.log | grep -ac "${AID:-@@@}" echo -n "respawns: "; grep -a "respawn\] replicant" el_${MODE}_b.log | grep -ac "${AID:-@@@}" echo echo "--- 5. B: searchlight cones + ghost detector ---" grep -aE "\[spot\]" el_${MODE}_b.log | head -6 echo -n "cone skipped: "; grep -ac "cone skipped" el_${MODE}_b.log echo -n "ghost lines : "; grep -ac "\[ghost\]" el_${MODE}_b.log grep -a "\[ghost\]" el_${MODE}_b.log | head -3