Three measurements, then a pilot built on them. * Hull is position+0x154. Found by anchoring on a field the definition already had solved (HP = 1500) rather than scanning for a value that falls: an undamaged craft must contain its own definition's number. Confirmed by the trace across a death -- 30/60/90 per hit, negative at 0, GAME OVER on screen. * RT accelerates, LT brakes, and the throttle is a persistent setting (488 -> 1510 -> 174 units/s, measured as displacement per second of the craft's own position, so no speed field was needed). This overturns the earlier "RT is not the throttle", which came from assuming the control and hunting for a field. * Shield is probably position+0x430 (== definition MaxValue 400), not yet confirmed live -- nothing had damaged it. pilot.py is a state machine on damage (ENGAGE / EVADE / RETIRE) that treats turrets as keep-out zones instead of targets. It flew Stage 02 for 300 s with the hull untouched at 1500/1500 and took the first confirmed kill (WARPLANES 0001); every run the day before was dead inside 35 s. Two bugs the live run exposed and this fixes: gating the guns on the commanded direction keeps them cold whenever avoidance is steering (gate on the target instead), and an orbit-plus-brake rule made it circle one attacker for 40 s outside its own firing cone. Also: boot to in-flight is now ~100 s unattended, because wait_flight.sh waits for the HUD's own shield bar instead of a fixed 75 s sleep that lavapipe does not honour; entities2.py picks the attitude block by matching the measured flight path (taking the first orthonormal block gave a bone/camera frame); and the entity-heap scan is numpy instead of a per-word Python loop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
63 lines
2.5 KiB
Bash
Executable File
63 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Boot Canary and drive it into the Stage 02 mission from save slot 01, then
|
|
# LEAVE IT RUNNING (unlike grab_tutorial.sh, which snapshots and exits) so a
|
|
# live control loop can attach to /dev/shm.
|
|
#
|
|
# Nav is the verified route: title -> LOAD GAME -> slot 01 -> YES -> READY ROOM
|
|
# -> TAKE OFF. With `--hangar` it stops in the HANGAR instead so a loadout can
|
|
# be picked first.
|
|
set -u
|
|
MODE="${1:-fly}"
|
|
export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98
|
|
SD="$(cd "$(dirname "$0")" && pwd)"
|
|
SHOTS=/sylph-home/re/shots
|
|
|
|
alive(){ ps -o pid=,stat= -C xenia_canary 2>/dev/null | awk '$2 !~ /^Z/ {print $1}'; }
|
|
ensure_display(){
|
|
if ! xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then
|
|
setsid nohup Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac -nolisten tcp \
|
|
+extension GLX +extension RANDR </dev/null >/tmp/xvfb98.log 2>&1 &
|
|
for _ in $(seq 1 50); do xdpyinfo -display "$DISPLAY" >/dev/null 2>&1 && break; sleep 0.2; done
|
|
setsid nohup env DISPLAY="$DISPLAY" HOME=/sylph-home openbox </dev/null >/tmp/openbox98.log 2>&1 &
|
|
sleep 1
|
|
fi
|
|
xdpyinfo -display "$DISPLAY" >/dev/null 2>&1 || { echo "DISPLAY UNAVAILABLE"; exit 1; }
|
|
}
|
|
step(){ vgamepad dpad "$1"; sleep 0.25; vgamepad dpad center; sleep 0.7; }
|
|
shot(){ screenshot "$SHOTS/$1" >/dev/null 2>&1; }
|
|
|
|
pkill -x xenia_canary 2>/dev/null; sleep 2
|
|
[ -n "$(alive)" ] && { kill -9 $(alive) 2>/dev/null; sleep 2; }
|
|
rm -f /dev/shm/xenia_memory_* /dev/shm/xenia_code_cache_* 2>/dev/null
|
|
ensure_display
|
|
|
|
cd /sylph-home/re
|
|
setsid nohup run-canary --audio --apu=sdl --log_mask=13 \
|
|
--logged_profile_slot_0_xuid=E0300000EFBEA3D4 </dev/null >/dev/null 2>&1 &
|
|
sleep 5
|
|
"$SD/skip_intro.sh" 600 || { echo "BOOT FAILED"; exit 1; }
|
|
sleep 14 # main menu is not input-ready before this
|
|
|
|
step down # NEW GAME -> LOAD GAME
|
|
vgamepad tap A 250; sleep 8 # save list, slot 01 preselected
|
|
vgamepad tap A 250; sleep 4 # "Load game?" -- cursor starts on NO
|
|
step up
|
|
vgamepad tap A 250
|
|
sleep 28 # -> READY ROOM
|
|
shot "lm-readyroom.png"
|
|
|
|
if [ "$MODE" = "--hangar" ]; then
|
|
step down; step down # BRIEFINGS -> HANGAR
|
|
vgamepad tap A 250; sleep 12
|
|
shot "lm-hangar.png"
|
|
echo "STOPPED IN HANGAR"; exit 0
|
|
fi
|
|
|
|
step up # BRIEFINGS -> TAKE OFF
|
|
vgamepad tap A 250
|
|
# The launch cinematic + stage load + objective card is NOT a fixed 75 s under
|
|
# lavapipe; wait for the flight HUD itself.
|
|
"$SD/wait_flight.sh" 300 || { echo "NEVER REACHED FLIGHT"; exit 1; }
|
|
shot "lm-flight.png"
|
|
echo "IN FLIGHT (emulator left running)"
|