Files
BT411/scratchpad/night8/salvo.sh
T
Joe DiPrimaandClaude Opus 5 efc3e9ff1a #95/#84: missile salvos deliver their FULL authored damage, and stop double-exploding
THE SALVO DAMAGE (#95).  Players measured an LRM 15 landing "3ish points".  The
logs agreed: [projectile] IMPACT damage=3.33333 (Oracle, LRM15) and 3.5 (Rajel,
LRM10).  Those are right PER MISSILE -- 50/15 and 35/10 -- and the bench shows
why the salvo still under-delivers: each launcher pushes N rounds of which
exactly ONE carries damage.

Two individually-correct changes composed into an N-fold shortfall:

  * The ctor does what the binary's MissileLauncher ctor does (@0x3ac/@0x3d4):
        damageData.burstCount    = missileCount;
        damageData.damageAmount /= missileCount;
    The record holds the PER-MISSILE amount plus the count; the arcade
    reconstitutes amount x burstCount when it applies the hit.
  * Task #62 then correctly stopped the port applying the hit once per visual
    round (that was ~missileCount-x too lethal) by damaging only the lead round
    -- but handed it the already-divided amount.

Our DamageZone::TakeDamage is `damageLevel += amount * scale` and drops
burstCount, so the salvo delivered amount/missileCount.  Since the port collapses
the cluster to one damaging round, multiply the count back in there.  Bench: an
SRM6 salvo now lands amt=35 (the authored total) taking a zone 0 -> 0.556, where
it previously landed 5.83.

THE DOUBLE EXPLOSION (#84).  Oracle: "missile appear to register hit explosions
twice, once where target was and again where the target is."  There are two
spawn sites: BTSpawnRoundDetonation at the round's own impact point, and the
message manager's bundled explosion at the CONSOLIDATED point a frame later.
The duplicate was known and thought harmless -- "among a rippled volley it is
invisible" -- which held only while a salvo landed N detonations.  A projectile
now marks its weapon (MarkRoundDetonated) and the consolidation skips queueing a
second blast for it; direct-fire weapons never mark, so lasers/AC keep the
bundled explosion they rely on.  Bench: 4 missile impacts -> 4 SKIPPED, while 11
direct-fire hits still queue normally.

SWEPT CONTACT (#84 tail).  Contact was a 10-unit sphere sampled only at the END
of each step.  With the authored thruster live (#84) field rounds arrive at
v=955 -- a ~16 unit step at 60fps, larger than the radius -- so samples can
straddle the target.  (Pre-#84 rounds flew ~100-300 = a 1.7-5 unit step and could
never skip it: the velocity fix exposed this, it did not cause it.)  Now tests
the whole segment travelled and bursts at the point of NEAREST APPROACH, which
also stops the detonation being flung past the target at speed.

RETRACTION: I posted tunnelling as the leading explanation for the lost salvo.
The bench disproves it -- zero fizzles, and the "missing" rounds are the dmg=0
visual rounds of the cluster, which never registered damage by design.  The
sweep is kept as speed-independent robustness, not as the #95 fix.

Bench: scratchpad/night8/salvo.sh (BT_PROJ_LOG + BT_FIRE_LOG).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 23:59:44 -05:00

38 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# #95/#84 CONFIRMATION: are missiles TUNNELLING through the target?
#
# Contact is a fixed 10-unit sphere sampled ONCE PER FRAME. Logged field speeds
# reach v=955, which at 60fps is a ~16 unit step -- larger than the radius, so
# consecutive samples can straddle the target entirely. Prediction: a salvo
# lands only the rounds that pass near dead centre, and the rest hit the flight
# cap and FIZZLE. BT_PROJ_LOG=1 turns on the fizzle line (it is gated, which is
# why the field logs could not answer this).
#
# Verdict = the IMPACT:FIZZLE ratio per salvo.
set -x
. /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
sed "s/^map=.*/map=grass/; s/^time=.*/time=day/" MP.EGG > SALVO.EGG
LOG=salvo_${1:-pre}.log
rm -f "$LOG"
# Walk up to the spawned target and hold the missile group down.
BT_PROJ_LOG=1 BT_DMG_LOG=1 BT_FIRE_LOG=1 \
BT_SPAWN_ENEMY=1 BT_GOTO=enemy BT_GOTO_STOP=2 \
BT_AUTOFIRE=1 BT_AF_MISSILE=1 BT_AF_PERIOD=3 \
bt_launch "$LOG" SALVO.EGG 0x03
sleep 100
taskkill //F //IM btl4.exe > /dev/null 2>&1
sleep 2
echo "=== impacts vs fizzles ==="
printf "IMPACT %s\n" "$(grep -c 'projectile\] IMPACT' "$LOG")"
printf "FIZZLE %s\n" "$(grep -c 'projectile\] FIZZLE' "$LOG")"
printf "WORLD %s\n" "$(grep -c 'projectile\] WORLD' "$LOG")"
echo "=== impact speeds (the tunnelling driver) ==="
grep -o 'IMPACT .*v=[0-9.]*' "$LOG" | grep -o 'v=[0-9.]*' | sort -t= -k2 -n | tail -3