Files
claudeandClaude Opus 5.5 aa797580a7 #72: The packet ship, the lifeline mortar and the gull-kite
Eric chose option B on #72. The drop is now the GDD's launch:

- A packet ship sails a seeded straight line past the island, offshore,
  as close in as it can while keeping 45 m of open water from any land
  (eight-way probes; up to 32 headings, then the four world sides).
- Jump fires the lifeline mortar along the look heading. How high the
  player aims sets the charge (-10 to 45 degrees: 16 to 110 m/s over
  the ground; every shot climbs at 75 m/s). The climb can't be steered
  and the kite can't open until the arc tops out. Riders still aboard at
  the end are fired towards the middle of the island.
- Drop.reach() mirrors the fall for both ways down (kite at the top, or
  a fall with the kite opening by itself); bots, the soak and autoplay
  clients and the tutorial pilot aim with Drop.aim_charge().
- Bots fire at their landing spot once abeam of it, when in easy reach
  at their own staggered moment, or just before the route ends, and open
  the kite early only when the spot is beyond the rest of a fall.
- Art: VesselModels.ship() (two-masted packet, tanned square sails, a
  salt-white boot-top, a bowsprit and the mortar on its bed, mirrored to
  face the island), the figure's gull-kite (figure.py), and a lifeline
  cord from the muzzle to each player still climbing.
- Renamed barge to ship and wing-sail to gull-kite throughout code,
  tests, captures, docs and the tutorial text. make match now defaults to
  seed 2, where the scripted player still harvests and builds.

Closes #72

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:49:21 -05:00

64 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# H1: repeatable performance benchmark.
#
# Server: runs the headless server with 24 bots, unthrottled, for BENCH_TICKS ticks on
# each of BENCH_SEEDS seeds, and reads its p50/p99/max tick time.
# Client: renders the moments of the match `make match` saved (whole island, ship,
# landed, a build, the final players) and a crowded pine forest in the capture
# container, and reads each frame's draw calls, primitives, objects and memory.
#
# tools/bench_report.gd checks every number against the budgets in
# docs/ARCHITECTURE.md and writes build/bench/report.txt and report.json.
#
# Software rendering counts what is drawn, not how fast: frame rates on a real GPU are
# left to the hands-on playtest (R6).
#
# tools/bench.sh about 3 minutes; needs Docker for the client
# BENCH_SEEDS="2 7" BENCH_TICKS=6000 tools/bench.sh
# BENCH_CLIENT=0 tools/bench.sh the server only
set -uo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
seeds="${BENCH_SEEDS:-2 7 20261109}"
ticks="${BENCH_TICKS:-12000}"
client="${BENCH_CLIENT:-1}"
[[ "$ticks" =~ ^[0-9]+$ ]] || { echo "bench FAIL: bad BENCH_TICKS '$ticks'"; exit 2; }
out="build/bench"
mkdir -p "$out"
rm -f "$out"/*.jsonl
status=0
for seed in $seeds; do
[[ "$seed" =~ ^[0-9]+$ ]] || { echo "bench FAIL: bad seed '$seed'"; exit 2; }
echo "bench: server, seed $seed, $ticks ticks, 24 bots" >&2
raw="$(timeout --signal=KILL 900 nice -n 15 tools/godot.sh -- --server --seed="$seed" --bots=24 --ticks="$ticks" --unthrottled 2>&1)"
code=$?
line="$(grep -m1 '"event":"stats"' <<<"$raw" || true)"
if [[ "$code" -ne 0 || -z "$line" ]]; then
echo "bench FAIL: the server on seed $seed exited $code"
grep -v '^{' <<<"$raw" | tail -n 10
status=1
continue
fi
echo "$line" >>"$out/server.jsonl"
done
if [[ "$client" == "1" ]]; then
if [[ ! -f build/match/match.tclog ]]; then
echo "bench: no saved match yet; playing one (make match)" >&2
tools/match.sh >/dev/null || { echo "bench FAIL: make match failed"; exit 1; }
fi
for stage in match_lobby match_ship match_landed match_built match_final props_forest; do
echo "bench: client, $stage" >&2
if ! report="$(tools/capture.sh "$stage" "captures/bench_$stage.png" 2>/dev/null)"; then
echo "bench FAIL: the $stage capture failed"
status=1
continue
fi
echo "$report" | grep -m1 '^{' >>"$out/client.jsonl"
done
fi
tools/godot.sh --script res://tools/bench_report.gd -- --dir="res://$out" --client="$client" || status=1
exit "$status"