DARKER Research archive

Combined supply movement, script and message trace

The trace viewer and JSON export now combine the original supply scripts, English text, per-object scheduler and approach/docked movement. Every event records its tick, position, height, heading, output and callback.

Both records 5 and 6 run through native C776 context entry, motion-before-player-script updates, supplementary return and an explicitly supplied departure request. Record 6 consumes all 21 English messages in source order; record 5 has none. The primary message cursor is checked after restoration. Both install ordinary flight callback 8108 after departure conditions pass.

Timing in this fixture

Record Normal flight selected English messages
04_015 / 5 22,176 ticks / 44.352 seconds 0
04_015 / 6 26,416 ticks / 52.832 seconds 21

These are controlled-fixture times, not observed in-game docking durations. The test uses fixed 16-tick updates, equal BF0/BF8 clocks and the synthetic initial pose from the motion tests. Seconds use the established approximately 500 Hz interpretation.

The supply script starts while the approach callback is active. Its output-target commands and messages therefore overlap movement. The trace records those commands alongside the motion's transition to the cell centre and docked callback, rather than serializing approach and the entire supply script into separate phases.

The native shield-reset handler sets output target 700 before the sequence returns. The fixture supplies only processed pitch high byte 12 on return, then the next movement update passes the departure gate. It no longer injects an output target.

What executes and what is isolated

Original code executes for script dispatch, delays, message consumption/display descriptor writes, context swaps, output target changes, weapon selection, working/reserve ammunition refill, shield reset, weapon-mask toggle, horizontal/vertical convergence, heading changes, docked output ramp and departure transition.

Weapon selection, reload and shield reset now execute natively. Only the attitude stabilizer and audio notification are intercepted. The starting approach is eligible by construction; this test does not run collision, rendering, live input production, other objects or ordinary flight after callback 8108 is selected. It is a combined controlled trace, not a complete emulator.

Actual message bytes are loaded from 04_015's English section. Source text and offsets appear beside each message event, with native display/continuation operands. The test asserts that every stored message is consumed exactly once and in order.

Verified supplies and existing pad locations

Both fixtures start with depleted working and reserve ammunition, and shield resource 40h. The native reload handler at 5E44 fills the currently selected weapon from the original capacity tables:

Weapon index Working ammunition Reserves
0 14 5
1 8 3
2 10 4

Record 5 refills indices 0/1 and leaves index 2 at zero. Record 6 refills all three. The native selection path uses craft discriminators 26/27, changes the selected index and enable bytes, and executes its selection-delay helper; only its sound notification is suppressed. Before/after weapon state appears in the trace events.

Shield reset C7B3 writes BFh (191) to resource byte 810A and sets output target 7E4A to 700. Both are asserted at completion. No simulated shield use drains that resource during this fixture.

Playtesting confirms the existing Halon bank 31, map 69, type 3 cells are supply pads, consistent with the native entry gate. Their existing coordinates are (111,8), (67,16), (34,20), (14,51), (49,54), (95,56), (24,78), (59,102). The trace's HTML and JSON now include this identity and location list; no new inferred pad positions are introduced. A subsequent native all-cell comparison confirms that the entry gate accepts exactly these eight locations, including target-coordinate correspondence.

Reproduction

PYTHONPATH=/tmp/darker-python python3 tools/trace_supply_cycle.py

The output is self-contained HTML plus JSON. Weapon/shield effects now run natively and existing Halon pad locations are identified. Full attitude/collision integration remains a separate step; the next bounded mission target is the blackout trigger and its beacon changes.