Particle Script

Retro games feature a uniform, fixed-function Particle Script system for describing various geometrical effects and weapon systems. The PAK archives contain binary resources using FourCCs to build a key-value dictionary. These codes correspond to application-specific parameters controlling the system in question.

The scripts use a dataflow paradigm built around value-generating element classes of the following types:


 * Int
 * Real (float)
 * Vector (3-component float)
 * Mod Vector (3-component float)
 * Local velocity vector in/out
 * Local position vector in/out
 * Color (4-component float, internally converted to RGBA8)
 * UV (TXTR reference and UV coordinate source)
 * Emitter
 * Initial local position vector (3-component float)
 * Initial local velocity vector (3-component float)

The system features several subclasses that output generated values through  as a function of the current frame index. These implementations may recursively accept input from other elements, permitting effect designs of scalable complexity.

File Layout
All effect script file formats are read linearly to populate a description tree of element nodes, serving as a template to build an arbitrary number of generator instances:


 * Script Magic FourCC (see table below)
 * Parameters
 * Key FourCC
 * Value Parameter(s) (one of:)
 * : null value (equivalent to not specifying the key at all)
 * Element FourCC (see below)
 * Child Elements (count/types according to parent)

Elements
Many of the animated qualities in particle scripts are achieved with dynamic elements. These elements provide I/O interfaces and internally process numeric data that passes through. They may also gather data from other sources within the particle system's state.

UV Elements


Example of an ATEX map used in the closing cinematic (spoilers)

Keyframe Emitter Template
and  elements statically encode a list of key values for all element types (except Mod Vector, UV and Emitter elements). T represents the type being encoded.