#!/usr/bin/env bash # ========================================================================= # SELF-INFLICTED scoring + DEATHS counter (night 13). # # Two chart rows and one field complaint are still unverified: # "-1 each self-inflicted point of armor damage" -- code-verified only # (ScoreInflictedMessageHandler's negate-if-target-is-self arm); every # previous run reported negative(self)=0 because nobody self-damaged. # "-1000 destroying your own 'Mech by ejecting" -- arithmetic only # (-500 death cost + a self-kill negating its own ~500 award). A # SELF-DESTRUCT reaches the same two paths without needing the panic # button, which five rigs failed to trigger. # "kills/deaths counts were screwy" -- kills=1 is verified, deathTally is not. # # A self-destructs (BT_SELF_DAMAGE, inflictor = SELF); B stands off. # Composition from night12/scoreself.sh, which was built for #134. # ========================================================================= 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 s2_a.log s2_b.log s2_relay.log matchlog_*.txt bt_expert_egg MP.EGG S2.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" S2.EGG ( export BT_DMG_LOG=1 BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 bt_launch s2_b.log S2.EGG 0x0C -net 1601 ) sleep 2 ( export BT_SELF_DAMAGE=40 export BT_DMG_LOG=1 BT_DEATH_LOG=1 BT_MP_LOG=1 BT_MATCHLOG=1 BT_SCORE_LOG=1 bt_launch s2_a.log S2.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py S2.EGG 127.0.0.1:1501 127.0.0.1:1601 > s2_relay.log 2>&1 & RELAY=$! sleep 280 kill $RELAY 2>/dev/null sleep 3 bt_kill_ours sleep 2 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 3 echo "=================== SELF-SCORE + DEATHS ===================" echo "--- 0. role bound? (if NULL every number below is meaningless) ---" grep -a "\[role\] player" s2_a.log | head -3 echo echo "--- 1. CHART '-1 each self-inflicted point': type=0 with award < 0 ---" grep -ah "type=0 award=-" matchlog_*.txt | head -6 | cut -c1-115 echo -n "negative type=0 rows: "; grep -ahc "type=0 award=-" matchlog_*.txt | paste -sd+ | bc 2>/dev/null || grep -ah "type=0 award=-" matchlog_*.txt | wc -l echo echo "--- 2. CHART '-1000 ejecting' components: self-kill negation + death cost ---" echo "self-kill (type=2, award must be NEGATIVE, kills must NOT increment):" grep -ah "SCORE.*type=2" matchlog_*.txt | head -4 | cut -c1-115 echo "death cost (-specialCaseDeathPenalty, expect -500):" grep -ah "type=1 award=-5" matchlog_*.txt | head -3 | cut -c1-115 echo echo "--- 3. DEATHS counter (the other half of the field report) ---" grep -ah "PLAYER_DEAD" matchlog_*.txt | head -5 | cut -c1-115 echo -n "death cycles on A: "; grep -ac "death cycle START" s2_a.log echo echo "--- 4. net score trajectory for the self-destructor ---" grep -ah "player=2:1 type=" matchlog_*.txt | tail -4 | cut -c1-115