Autopilot · write-up
Level 3 articulated carrier: resident-C tactic
The apparent "chain" is the carrier boss's damaging appendage, not a separate enemy. In the original resident-C run, its right tail ($4FF62, identity 56322) hit the ship for 16 shield at game frame 20518. The player and tail collision rectangles overlapped at screen X288–294 and Y141–143. Baseline recording and paired AVIs: xenon_tools/run_logs/level3-dormant-formation-20260924-r6.validation/level3-dormant-formation-20260924-r6.x2events.
Boss data
$4FC88is the scripted carrier,$4FD38its two vulnerable cores,$4FE52the appendage emitters,$4FF12the links, and$4FF62the tail pieces.$4180objects are ordinary directional projectiles.- The core object field at
+$32is not health. The hit routine at$4FDC0chooses one of the global words$D76and$D78according to core field+$30, subtracts damage, and disables that core's hit procedure at zero. Both words were zero in the successful runs' final checkpoints. - Emitter phase zero means the appendage has not launched. Its collapsed tail still collides while moving with the carrier. The original C rule modeled only launched tails, which explained the later fatal collision when a core survived one extra sweep.
Resident-C encounter sequence
choose_carrier() in src/autopilot/xenon_autopilot_level3.c selects the first active core when it approaches within 96 pixels above the viewport. It latches a forward firing lane four goal pixels toward the second core and holds screen Y172–176. In the live runs this small offset gave the installed forward pair enough overlap to kill both cores despite different entry timing. The lane stays fixed across the core animation. It is placed where the core is as the carrier enters, measured from the carrier body (see "Starting inside the fight" below).
xap_level3_carrier_action() keeps firing and uses the live tail trajectory and emitter phase to change position:
- Hold the forward station while no observed tail trajectory threatens it.
- For a right-side launch approaching the station, retreat to the high left refuge near screen
(14,72). Cross toward(200,72)only after the ship has climbed above screen Y80 and the launched tail has passed below it. - For a lone left-side launch, use the lower left refuge near
(14,174), below its sweep. - A collapsed tail can sweep through the station with emitter phase zero. If it is about to cross, retreat left along the low row. Return to the firing station after this particular sweep clears so the remaining core can be shot.
- If a later left launch follows that collapsed sweep, climb to the high left refuge. Once the tail is below the ship, cross toward
(200,72)above the carrier before descending. Returning along the low row led into the moving boss attachment. - On the late sweep, a diagonal projectile crosses the firing lane while a vertical projectile blocks a simple sidestep left. Once the diagonal reaches the lane, drive right and hold DOWN toward
(296,190). The game clamps the ship at screen Y176; that low row passes beneath the right tail while the ship outruns it horizontally. Hold the right edge until every observed tail and core has risen above screen Y160 and the forecast shows a clear return to the gun lane. - Release the encounter route when the mission no longer selects an active core.
The old expanding-formation safety envelope now checks its linked controller state. A captured collapsed formation uses the observed body rather than a maximum-spread hull, which otherwise blocked the boss approach even though the formation was inactive. Missing controller state stays conservative. The Level 3 gate route also skips gates whose firing station lies behind the camera's forward limit, avoiding an unrelated stall on the approach.
Projectile and cash follow-up
All five original 4-shield hits were ordinary $4180 directional shots from the carrier, not a mispredicted worm or chain. At first observation, each shot was within one update step of the carrier's (x + 16, y + 60) fire origin. Their trajectories were straight and observable well before contact. The original earlier-checkpoint run was hit at frames 20456, 20458, 20471, 20605, and 20756. The first three crossed the fixed forward-gun station; at 20605 the ship descended through a horizontal shot; at 20756 a diagonal shot clipped the station's left edge.
The C action uses the existing straight-shot prediction to take a brief left sidestep only when a shot will cross the gun station within eight frames and the encounter is in CARRIER_ATTACK. It then returns to the gun lane. Tail-refuge phases retain their original movement and firing time. During the later return to the gun lane, descent checks include diagonal shots: in the f20197 run, one rose toward the ship at frame 20836, so holding above it avoids a 4-shield hit. The diagonal check is limited to this return phase because applying it during the right-edge escape prevented the descent beneath the tail and caused body damage. Broad candidate detours and shifting the whole firing lane were tested but delayed core destruction and caused life loss; those rules are not retained.
After the last core dies, carrier cash takes priority over the next gate. The C mission retains the encounter marker, predicts each orbit/drop pickup for 24 frames, aims for a reachable crossing, and favors the more valuable large drops before they leave the screen. The boss releases five large and five small drops, worth 750 cash total; the final earlier-checkpoint run collected all 750 (shop cash 1850 to 2600).
Validation
All runs used visible resident-C Hatari, the original and sprite AVIs, and 150-frame checkpoints. The first three saves are before the carrier appears; the f20503 save is already inside the encounter and does not restore its C refuge phase.
| Starting save | Recording | Shop frame | Shield | Boss cash | Lives |
|---|---|---|---|---|---|
xenon_tools/run_logs/level3-dormant-formation-20260924-r6.validation/checkpoints/f20044-periodic.sav |
xenon_tools/run_logs/level3-carrier-final-clean-20044-20260925-r1.validation/level3-carrier-final-clean-20044-20260925-r1.x2events |
20679 | 39 → 39 | 1900 → 2650 | 2 → 2 |
xenon_tools/run_logs/level3-dormant-formation-20260924-r6.validation/checkpoints/f20197-periodic.sav |
xenon_tools/run_logs/level3-carrier-safe-20260924-r1.validation/level3-carrier-safe-20260924-r1.x2events |
20813 | 39 → 35 | 1850 → 2600 | 2 → 2 |
xenon_tools/run_logs/level3-carrier-early-baseline-20260925-r1.validation/checkpoints/f20197-periodic.sav |
xenon_tools/run_logs/level3-carrier-resume-clean-20197-20260925-r1.validation/level3-carrier-resume-clean-20197-20260925-r1.x2events |
20813 | 39 → 35 | 1850 → 2600 | 2 → 2 |
xenon_tools/run_logs/level3-dormant-formation-20260924-r6.validation/checkpoints/f20350-periodic.sav |
xenon_tools/run_logs/level3-carrier-restored-20350-20260925-r1.validation/level3-carrier-restored-20350-20260925-r1.x2events |
20828 | 39 → 35 | 1900 → 2650 | 2 → 2 |
xenon_tools/run_logs/level3-dormant-formation-20260924-r6.validation/checkpoints/f20350-periodic.sav |
xenon_tools/run_logs/level3-carrier-cash-priority-20260924-r1.validation/level3-carrier-cash-priority-20260924-r1.x2events |
20828 | 39 → 35 | 1950 → 2700 | 2 → 2 |
The continuous f20044 path reaches the core lane at boss entry and defeats the carrier without damage. Restarting even its own f20197 checkpoint changes the input/fire sequence and takes one 4-shield hit from the diagonal shot at frame 20756; the later paths still defeat the boss and collect all ten cash drops. The C session's fire phase and refuge state are not serialized in an ordinary Hatari save. Starting directly from the f20503 save lost a life at 20535 because it begins during a body sweep without the earlier refuge history; it is not a valid pre-encounter test.
The late shot's collision rectangle at 20756 is X148–154, Y167–173; the ship at (161,176) has collision rectangle X151–172, Y166–186. The next vertical shot and this diagonal shot leave no stationary integer Y gap: holding the ship at Y151 avoids the diagonal but meets the vertical shot at 20758, while Y156 meets the vertical shot's inclusive bottom edge. Timed descents and short sideways retreats avoided one shot but met the tail or cores as the body crossed the middle. A fixed Y154 station from the older Python strategy took multiple early hits in the present C loadout. Releasing the authored rule to the generic maneuver evaluator likewise avoided the shot but ran into the body. The measured lower-right escape avoids the projectile pair and the body without sacrificing the eventual kill.
The final C build was replayed in visible Hatari from three pre-encounter saves, with paired original/sprite AVIs and 150-frame checkpoints:
| Starting save | Recording | Shop frame | Shield | Lives | Shop cash |
|---|---|---|---|---|---|
f20044-periodic.sav |
xenon_tools/run_logs/level3-carrier-right-bottom-20044-20260925-r1.validation/level3-carrier-right-bottom-20044-20260925-r1.x2events |
20679 | 39 → 39 | 2 → 2 | 2650 |
f20197-periodic.sav |
xenon_tools/run_logs/level3-carrier-right-bottom-20197-20260925-r3.validation/level3-carrier-right-bottom-20197-20260925-r3.x2events |
20938 | 39 → 39 | 2 → 2 | 2600 |
f20350-periodic.sav |
xenon_tools/run_logs/level3-carrier-right-bottom-20350-20260925-r1.validation/level3-carrier-right-bottom-20350-20260925-r1.x2events |
20840 | 39 → 39 | 2 → 2 | 2650 |
All three defeated the carrier and collected its 750 cash; shop cash differs because the starting saves had different balances. The targeted Level 3 mission and prediction-envelope tests also pass. These runs establish this behavior for the three tested entry states, not every possible loadout or checkpoint.
October 3: goals checked by the shared C planner
The current entry point is xap_level3_carrier_goal(). It publishes a world
movement goal before the shared maneuver planner checks it; the old
xap_level3_carrier_action() post-planner steering override is removed.
The main attack remains below the cores at screen Y172–176, using the
forward weapons. Refuges interrupt this attack only while a predicted boss
sweep or projectile blocks it.
Y190 in the historical sequence above was a DOWN joystick hint, not a reachable ship position. The planner's lower-right goal now uses Y176. A new launch after an upper crossing keeps a ship already on the right there instead of ordering it back through the carrier. A completed crossing also returns to attack once rather than restarting the same crossing. The right refuge releases only after the ship reaches the lower row and the body and projectile forecasts permit the return.
Visible resident-C runs R239, R240 and R241 all defeated the carrier without shield loss during the boss fight and collected all ten cash drops. R239 also passed the earlier swarm corridor without damage; R241 took two earlier hits before the carrier. Starting states, full recording paths and rejected experiments are listed in CAMPAIGN_FIXES_20261003.MD. These results validate the carrier for those three entry states, not the whole level or every possible loadout.
Starting inside the fight (2026-10-02)
A snapshot load, switching the autopilot on, or a gap in the frames starts the encounter without its history. Two pieces of it decided the fight and could not be rebuilt: the lane, latched from wherever the core was first seen, and the one collapsed-body retreat, remembered only as the encounter stage. Both are now read from the carrier.
What the game keeps, measured in the f20651 checkpoint's RAM and the recordings:
- The appendage launch is random. The emitter at
$4FE52calls$E48(a jump to the generator at$27FE, add-with-carry over the longs at$289C/$28A0) on every frame its phase is zero and launches when the low byte is below 3. A collapsed body sweep is a pass over the gun lane without a launch, so it is not tied to a core's death. - The carrier's motion script loops: six segments of about 128 frames in all. Its position on the first and the second sweep after a core's death is the same.
- A core's health is a global word (
$D76/$D78). At zero, the core routine at$4FD38switches to the dead core's animation and turns off its hit routine. The spent core is the only lasting change the fight makes to the carrier. - The carrier body enters at x 150, screen y −122, in the original run and in three respawns. The cores' centres sit 6 and 26 px right of the body, giving lanes 160 and 180.
The rules:
- Lane.
choose_carrier()places the lane where the core is as the carrier enters: the core's centre minus the body's x plusLEVEL3_CARRIER_ENTRY_X(150), plus the 4 px lean. On entry this is the latched value. A session that starts during the fight, or a new target after the targeted core dies first, gets the same lane rather than wherever the core happens to be. - Retreat. Once the carrier has lost a core and climbs away with its tails collapsed and clear, the stage moves from attack to body_cleared, so the ship holds the gun lane instead of retreating again. Cores are shot while the carrier comes down over the lane; waiting for the climb still escapes the sweep that follows a core's death. A restart landing on a descent with a collapsed sweep under way still retreats once, as before.
Results. The original recording's replay is identical frame for frame. An open-loop replay that restarts the session every 10 frames from 20430 to 20780 (an injected autopilot reset, as Hatari records after a snapshot load) differed from the continuous stage on 220 frames in all, against 2,631 before the change. Only 3 of the 36 restarts retreated again, against 22 before. Live resident-C runs from the f20501 (both cores alive) and f20651 (one core left) checkpoints, Release builds, 450 frames:
| Start | Before | After |
|---|---|---|
f20501-periodic.sav |
hits at 20548 and 20618 (4 each) and 20762–20764 (body), life lost at 20781 | no damage; same stage changes on the same frames as the original run, last core at 20791 |
f20651-periodic.sav |
hits at 20661, 20693, 20732 (4 each) and 20766–20767 (body), life lost at 20784 | no damage; same stage changes on the same frames as the original run, last core at 20788 |
The retreat rule alone, without the lane, lost a life from both checkpoints: the late-fight refuges only fit the entry lane. Checkpoints: E:\xenon_runs\web-replay-merge\merge-l3-carrier-r1.validation\checkpoints; recordings: E:\xenon_runs\carrier-restart.