PAN Animation Player

drop a file anywhere on the page
0 / 0

Open a Covert Action .PAN file to view it. Nothing is uploaded; everything runs in your browser.

No game files to hand?

Export WebM

Frames are recorded in real time at the file's frame delay, so a long range takes as long to export as it does to play.

Help

Using the viewer

What a PAN file is

A PAN file is a self-contained animation from Sid Meier's Covert Action: a set of embedded images plus a small program that draws, moves and sequences them. Cutscenes, building interiors and character actions all use this format.

Instructions and the VM

The top-level program runs on a stack-based virtual machine with a 16-bit value stack, 51 registers (0 to 50) and one instruction pointer. Values are pushed with Push and consumed by the next instruction. The VM runs until it hits WaitForFrames, then pauses for that many frames while sprites animate. End stops the VM but sprites keep running; EndImmediate stops everything.

Sprites and steps

There are 50 sprite slots. Each sprite runs its own step sequence: a linear list with counter-based loops but no stack or registers. A sprite only steps on frames its speed allows: the speed is added to a credit each frame and steps run when the credit passes 255. A rate of 255 steps every frame, 128 roughly every other frame.

A sprite can follow another slot: it is drawn at the followed sprite's position plus its own setup position plus its own movement. Following is a single level deep.

Frames and pages

The engine keeps a background page and a draw page. Each frame: the VM runs until a wait, every active sprite steps, stamped sprites are copied into the background, the background is restored over the areas sprites covered last frame, then all visible sprites are drawn in slot order (higher slots on top). Colour 0 in an image is transparent. A sprite set up with non-zero flags is never erased, which retail files use for static background pieces.

The background type chooses the initial background page: the previous animation's page (this viewer starts from black), the first image in the file, or a solid colour.

Images and colours

Images are 16-colour, LZW and run-length compressed, and indexed through a 250-entry table of image IDs. The file's colour block maps each colour index to one of the 16 standard VGA colours; entry 0 is always black. Retail files map colour 5 to black as well, so magenta never shows.

Debug tabs