# Compiled actors, routes and AI manoeuvres

The [compiled-route viewer](waypoints/index.html) exposes **192 programs, 2,716 actor records and 23,147 commands**. This includes 37 programs previously left unclassified. The [map browser](maps/index.html) can overlay the selected mission's compiled aircraft/surface routes; its detail link opens the complete program. Initial actor groups are distinct from their eventual individual aircraft.

The compiled-route view overlays its actors and destinations on the relevant terrain map, with **Terrain colours**, **Original schematic** and **Tile identifiers** backgrounds and palette selection. Mission scripts supply the program-to-environment association; where several missions share a program, the Mission selector chooses the context. A matching environment filename supplies the fallback for named environment programs. Programs without an identified association keep the coordinate grid until a map is selected manually. The map and route viewers share [the same background renderer](maps/map.js), including the schematic's reversed-Z correction and deterministic scenery-variant choices.

Select an actor to highlight its path, or click a start/waypoint marker to select its record and coordinate command. Coordinate commands in the table select the corresponding point too; packed player-route points have their own selectable list. Red crosses show ground-attack command coordinates without adding travel legs through them. Checkboxes hide individual actors, the coordinate grid or mission targets/start. **Open map & scenery** retains the selected mission and opens the selected point's terrain cell. Mission starts are already expressed in fractional cell coordinates, so their markers do not receive the extra half-cell offset used for packed route points and integer target cells.

## Actor records

Each record starts with a little-endian 16-bit payload length. A zero length terminates the file. The first payload byte selects the native dispatcher at [0x75690](code/index.html#75690):

| Type | Meaning | Initial fields |
| --- | --- | --- |
| 14 | Aircraft group | Count, X/Z cell, entity ID, airborne flag, altitude and speed operands; the initial block occupies 25 bytes |
| 16 | Surface unit | X/Z cell, entity ID, altitude, heading and speed operands; initial block 13 bytes |
| 17 | Fixed scenery placement | Three 32-bit position values, definition/event fields; supported by the dispatcher but absent from the retained programs |
| 18 | Player route | 16-bit point count, then packed 16-bit points: X in the low byte, Z in the high byte |

The retained programs contain 1,709 aircraft-group, 815 surface-unit and 192 player-route records. The player conversion at `0x751a4` produces `cell * 2048 + 1024`, placing each point at the cell centre. The apparent `XOR AH,BH` clears the copied high byte; it does **not** XOR the X and Z coordinates together. All **690** player points were compared with that native routine.

The aircraft VM at [0x77d64](code/index.html#77d64) consumes the initial-state command and subsequent byte opcodes. Sizes include the opcode:

| Opcode | Bytes | Recovered purpose |
| --- | ---: | --- |
| 0 | 1 | End |
| 1 | 9 | Waypoint with near/far backward branches |
| 2 | 7 | Move until near a coordinate, with backward displacement |
| 3 | 5 | Wait, minute/second operands |
| 4 | 7 | Takeoff operands |
| 5 | 17 | Conditional action; remaining fields retained |
| 6 | 43 | Radio message, flag word and 40-byte text area |
| 7, 8 | 11, 9 | Reserved dispatcher slots |
| 9 | 7 | Pursue waypoint, distance operand and X/Z |
| 10 | 19 | Ground attack, coordinate and weapon operands |
| 11 | 3 | Altitude operand |
| 12 | 25 | Conditional action; remaining fields retained |
| 13 | 3 | Speed operand |
| 14 | 25 | Initial aircraft state |
| 16 | 13 | Initial surface state |

The plotted paths join authored coordinate commands. They do not simulate branch conditions, pursuit, formations, aircraft dynamics or actual mission timing. Raw bytes and all uninterpreted operands remain beside the decoded commands. Entity IDs link the records to the 47 profiles in `craftype.cfg`.

[decode_waypoints.py](../tools/decode_waypoints.py) checks every record/command extent and final terminator. [Native checks](waypoints/native-checks.json) execute all **2,716** record dispatches and verify the player coordinate conversions. No command-decoding warnings remain in this corpus. This does not establish the semantics of every conditional-action operand.

## Timed CBN inputs

The [AI manoeuvre viewer](manoeuvres/index.html) shows **18 sequences containing 259 control steps**. A CBN file has a 16-byte header, six bytes per step, and a zero duration terminator. The header contains a category, entry pitch/roll, minimum-speed operand and relative-altitude operand; remaining header bytes are retained without speculative labels.

Each step contains a positive duration byte, signed pitch/heading/roll/speed-change bytes, and an SSD event byte. The original interpreter at [0x772a0](code/index.html#772a0) multiplies the roll operand by 4 and the speed-change operand by 256. All **259** steps match the native operand extraction.

The loader at `0x75408` distributes sequences into category banks with capacity 40 each. Eligibility uses speed/altitude limits, entry-angle differences and random gates. Category 0 and 1 are consumed by different selection routines; names such as “defensive manoeuvre” are not assigned without further caller evidence.

The viewer animates the input cursor, rather than inventing an aircraft trajectory. Its ticks-per-second control is an inspection rate. These durations belong to the AI update clock and must not be confused with the separately verified approximately 7.8 Hz SSD part-animation gate.

The waypoint browser's mode/campaign filter and ordered mission labels come from the [retail parser associations](terrain-and-scenery.md#finding-missions-and-briefings). Searches also cover briefing text. A mission card links the original text, exact presentation clip and campaign statement; shared binaries keep separate mission/environment choices. Unlinked waypoint programs remain selectable as a separate group.
