Every battle action is a short byte string: the action queue. For an attack, the player's arrows go in as swing bytes, the queue builder rewrites recognised combos into art constants, and the action state machine plays one byte per swing while the animation's hit events apply the damage. A Tactical Art is not a separate system - it is a byte in this string.
+0x1DF..+0x1F2: a 16-byte build window inside a 19-byte streamctx[+0x15], a battle-context byte (0xFF = parked)+0x1DE; 3 = Attack, which is also every Tactical ArtFUN_801EED1C (PROT 0898), called at the action-seed state 0x0CFUN_801EF9E4FUN_801EC3E4, called from the animation tick FUN_80047430 once per hit event+0x1DA, committed +0x1D9, latched +0x1DB; per-clip hit index +0x1F4legaia_art::tokenize and the matchers; engine-battle-vm::battle_action (queue applier, attack chain, validator). The port builds byte-identical queues| Byte | Meaning |
|---|---|
0x00 | terminator (the magic band uses 0xFF) |
0x0C / 0x0D / 0x0E / 0x0F | direction swing: Left / Right / Down (low) / Up (high) - written as 0x0B + direction |
0x19 | art starter, art already known |
0x1A | art starter, art learned on this use; also the starter the Super applier stamps |
0x1B..0x1E | the Miracle Art and the three Hyper Arts |
0x1F.. | ordinary arts: art ordinal n is constant 0x1B + n |
0x8C..0x8F | on-disc Miracle rows only: direction bytes with bit 7 set, cleared by the builder |
For a monster the bytes are action-entry indices from the AI picker, and for a cast they are the spell id followed by clip and shot pairs.
On a match the builder does not collapse the combo into one constant. It overwrites only the last matched arrow with a starter, and inserts the art constant after it, shifting the tail right by one. Every arrow before it stays in the stream and still executes as its own swing - so a three-arrow art is two swings plus the art.
stream[i] - 0x0B with the record's command bytes; the commit writes the starter over the last matched arrow and inserts art_id + 0x1B after it.Hyper Arts are the exception. The builder walks the character's art records in groups, and the first four groups (the Miracle Art and the three Hyper Arts) take a separate arm. With the Ra-Seru marker set, a matched Hyper Art's arrows do collapse: the run becomes 0x1A and the art constant, and the rest of the queue moves down behind them. Gala's Lightning Storm (Right, Right, Up, Left) reads 1A 1D. Without the marker, that arm writes nothing and the arrows stay plain swings. The groups are counted per record group, not per constant: Noa's Hurricane Kick spans three records, so her Vulture Blade and Frost Breath are her second and third Hyper Arts.
After the per-art commits come two trigger passes, in this order:
FUN_801EF9E4 matches each Super “find” pattern against the tail of the queue and replaces it with a tail ending in the finisher constantA Super triggers only when the last art of its pattern is the last action in the queue and every participating art paid its AP. The Miracle, Super find and Super replace tables are resident in the battle overlay.
The strike loop stages one byte per swing and applies no damage. State 0x1E of the action SM reads the byte at the strike cursor, post-increments the cursor by exactly one, and stages the byte as the actor's next clip. The action SM never calls a damage kernel: the call does not appear anywhere in it.
Damage is one power byte per animation hit event. The animation tick calls the hit resolver with the hit-event frame, and each call consumes exactly one power byte from the art record, indexed by the actor's own hit counter (bounded at four). So one staged art constant produces as many damage applications as its clip has hit events - the art's power list is walked by the animation, not by the stream. A Hyper or Super clip that replays its loop window re-fires its hits each cycle.
The total lands once. Every admitted hit adds to the target's combo word and its HP-bar word; live HP is written by one arm, normally only when the strike cursor is parked and this is the clip's last listed beat. Two exceptions:
A swing entry's first power byte is equipment-spliced, not a property of the command: the swing clips are per weapon, and the same Down swing reads different bytes on different saves.
The refill loop at the end of the strike loop is the War God Icon's second pass, not a Miracle continuation. It rewinds the strike cursor and replays the whole stream once, demoting to 0x19 every starter whose build mark reads exactly 1. The exactness is load-bearing: the Super applier writes mark 4 on the starters it stamps, so a Super's starter is the one the second pass leaves alone - the extra pass performs the Super again rather than a plain swing. The marks cannot be recovered from the finished queue bytes, because both starters read 0x1A.
The clip commit ends with an unconditional copy of the staged byte into the latch byte +0x1DB, which is what the per-art attack camera dispatches on (0x1A..=0x2D). An action whose stream carries only direction swings never puts a value in that range there, so the camera is unreachable for it. The tracks themselves are on the attack-camera table page.
FUN_801DA34C preseeds the queue from one of the character's two saved 16-byte arts-input strings (character record +0x76F / +0x77F). The slot pick and its fallback are asymmetric: one leg prefers the first string and falls back to the second; the other reads only the second. After an arts action FUN_801DA59C writes the queue back, which is what the next preseed replays.FUN_8003FB10 (SCUS) is the 18-arm gate the menu and battle UI run against a candidate slot before committing an action: is this a valid heal target, a valid revive target, a stat that can still grow. It reads from the battle-actor table inside a fight and from the character records outside one, and writes a per-slot validity bit. Arms 0x00..=0x0D are target rules (heal, restore MP, status present, dead, alive, stat-cap walker, per-slot match); 0x80..=0x83 are out-of-battle item gates. One quirk is kept by the port: the field branch of the “has a curable status” arm reads the status word signed, so a word with bit 15 set validates even with the tested bits clear.
The full write-up - each commit path's addresses, the per-frame drift flag, the trigger tables, the port's command flow and the validator's arm table - is in docs/subsystems/battle-action-queue.md.