#!/usr/bin/env bash # ========================================================================= # A REAL PANIC EJECT -- at last. (#108 ghost + the chart's "-1000 ejecting") # # WHY SIX RIGS FAILED. It was never the trigger. BT_EJECT_AT reaches the # dispatch every time (proved with an [ejecttest] receipt: "FIRING punch-out # at frame 600/900/1200"), and the HANDLER refuses it: # # [eject] 1:139 REFUSED (mech not crippled enough) # # Mech::EjectPilotMessageHandler gates on EvaluateEjectPermission() (@0x414) -- # a healthy mech cannot punch out. Every bench so far ejected a pristine mech. # In the field players eject BECAUSE they are wrecked, which is why it works # for them and never for me. (The button seam was never broken either; that # earlier conclusion was wrong too.) # # So: CRIPPLE FIRST, then eject. BT_SELF_DAMAGE grinds A down; BT_EJECT_AT # retries every 300 frames, so the first retry after permission is granted # takes it. # # WHAT THIS SETTLES: # chart "-1000 ejecting" -- the eject total, currently arithmetic only # #108 eject-ghost -- does the peer un-wreck after an EJECT death? # (normal deaths replicate fine: 9 deaths -> 8 # un-wrecks, benched) # ========================================================================= set -x . /c/git/bt411/scratchpad/night6/bench_common.sh cd /c/git/bt411/content || exit 1 bt_assert_player_env taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 rm -f er_a.log er_b.log er_relay.log matchlog_*.txt bt_expert_egg MP.EGG ER.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" ER.EGG ( export BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 bt_launch er_b.log ER.EGG 0x0C -net 1601 ) sleep 2 # A: grind itself down, then punch out once permission is granted # THE GATE, decoded from Mech::EvaluateEjectPermission (@0049fa1c): # permitted = liveWeapons < ejectMinWeapons || liveGenerators == 0 # || coolantFrac < 0.05 || (leg-gimped && !simLive) # Armour damage satisfies NONE of them -- which is why grinding A down gave # 53 attempts and 785 refusals. Killing the GENERATORS is the direct lever, # and BT_KILL_SUBSYS's comma-list form was built for precisely this bench. # It fires at frame 900, so arm the eject after that. ( export BT_KILL_SUBSYS=GeneratorA,GeneratorB,GeneratorC,GeneratorD BT_EJECT_AT=1200 export BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 BT_DMG_LOG=1 bt_launch er_a.log ER.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py ER.EGG 127.0.0.1:1501 127.0.0.1:1601 > er_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]+" er_a.log | head -1 | cut -d= -f2) echo "=================== REAL EJECT ===================" echo "A entity: ${AID:-UNKNOWN}" echo "--- 1. did a punch-out finally LAND? ---" echo -n "FIRING attempts : "; grep -ac "FIRING punch-out" er_a.log echo -n "REFUSED : "; grep -ac "REFUSED" er_a.log echo -n "PUNCH-OUT : "; grep -ac "PUNCH-OUT" er_a.log grep -aE "PUNCH-OUT|DeathWithoutHonor" er_a.log | head -3 echo echo "--- 2. CHART '-1000 ejecting': the score trajectory around it ---" grep -ah "player=2:1 type=" matchlog_*.txt | tail -6 | cut -c1-115 grep -a "\[deathcost\]" er_a.log | head -2 | cut -c1-140 echo echo "--- 3. #108: does the peer UN-WRECK after an eject death? ---" echo -n "B wreck-enters for A : "; grep -a "entered wreck state" er_b.log | grep -ac "${AID:-@@@}" echo -n "B un-wrecks for A : "; grep -a "un-wrecked + warp" er_b.log | grep -ac "${AID:-@@@}" grep -aE "entered wreck state|un-wrecked \+ warp" er_b.log | tail -6 | cut -c1-120 echo -n "B ghost lines : "; grep -ac "\[ghost\]" er_b.log