Files
BT411/scratchpad/night13/scoreself2.sh
T
Joe DiPrimaandClaude Opus 5 2fcce53bb2 scoring benches: self-inflicted + deaths counter verified (night 13)
scoreself2.sh -- one rig covering three unverified items, using a SELF-DESTRUCT
to reach the same paths an eject does without the panic button that defeated
five earlier rigs.

VERIFIED:
  chart '-1 each self-inflicted point'  type=0 award=-40.00 x11, total -440
  self-kill negation (#134)             type=2 award=-539.00, kills NOT incremented
  deaths counter                        PLAYER_DEAD deaths=1 tally=1

OPEN, found by arithmetic: the -500 death cost fires on a COMBAT death (prior
run: victim total exactly -500.00) but NOT on a self-kill -- A's total is
exactly -440 + -539 = -979, with no -500 in it, despite advDamage=1 and the
role bound.  The cost is dispatched by a DIRECT Player::ScoreMessageHandler()
base call, bypassing the BT handler, so it never reaches the matchlog and only
the totals expose it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCJQkvq6G2JNrpVbA75tVZ
2026-08-07 10:29:34 -05:00

65 lines
2.9 KiB
Bash

#!/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