User Guide: Hierarchy and Workflow
From AFXWiki
The primary goal of AFX is to facilitate the creation of compound special effects by layering and coordinating lower-level building-block effects. Dramatic and complex effects are achieved, not by programming new monolithic effects, but by combining many small modular pieces into a new whole – all done using scripts.
At the top of the special effects hierarchy, high-level thematic effects are realized using effects choreographers. These compound effects are designed according to the underlying themes, design logic, and art direction of an overarching game. AFX provides several different types of choreographers, each one designed to organize effects according to a specific logic or thematic framework. afxMagicSpell is one such choreographer, specializing in magic effects. Other effects choreographers include afxEffectron for basic effects and afxSelectron for selection effects.
Effects choreographers organize effects into phrases, simple groupings of effects which share a common timeline. In addition to grouping related effects together, phrases can also create a timing framework, sort of like a bounding-box of time, in which the effects occur. For example, continuous effects can be given an infinite lifetime, which really means that they run until the phrase they are in ends.
At the bottom of the hierarchy are building-block effects, individual effects like particle emitters, and sound effects, each producing specific visual, audio, or logical results. Building-block effects usually do something very specific and often act as individual components of larger compound effects.
In the middle are effect wrappers, a structure that defines position and timing information for individual effects, and also provides the means for linking the low-level building-block effects with the high-level effects choreographers. Logically, an effect wrapper is part of the building-block effect it wraps. They exist as separate entities because many building-block effects are not part of AFX and can be used apart from the AFX framework.
Given these pieces, the AFX workflow for constructing special effects is straight-forward. Typically, begin by choosing an effects choreographer type that best fits your current need. If you are creating special effects for a spell in an RPG, then afxMagicSpell is an obvious choice. Once settled on a choreographer, break down the conceptual design of your effect into smaller pieces, each of which can be realized by an individual building-block effect. Each building-block effect must then be associated with an effects wrapper and given additional position and timing information. Finally, the effect wrappers are added to the choreographer, which contains and manages lists of effects, called phrases. A choreographer may have several such phrases, and a single effect wrapper is added to just one of them. The same effect wrapper can be reused within a single phrase, within multiple phrases of a single choreographer, and even in multiple choreographers. Each case will generate a separate effect instance.
As an example of choreographer phrases, afxMagicSpell has five phrases to choose from: casting, launch, delivery, impact, and linger. The phrase chosen determines when the effect executes within the overall spell timing structure. Effects in the casting phrase occur at the beginning of a spell cast, followed be the launch and delivery phrases which begin at the same time. Then, if the spell hits something, the impact and linger phrases both begin at the time of impact.
Previous: User Guide: Overview

