AVFX Files
This page contains the file structure itself. What each of the structures listed here are used for can be on other pages.
AVFX files are organized as a nested series of blocks, with each block following the format:
Name: 4 bytes
Size: 4 bytes
Contents: [Size] bytesThe contents of a block can further contain other blocks. It is also worth noting that the name of a block is reversed from its actual meaning. For example, the "top-level" block for an AVFX file is "XFVA"(AVFX reversed). Names which are fewer than 4 character are also padded out to 4 bytes. Blocks are also padded out to be 4-aligned, so even if Sizeis 3, there will be an extra 00 before the next block starts.
Overview
Note: the names of the blocks are reversed for readability. Also, the notation TmLn[], for example, simply means several sequential TmLn blocks, one directly after the other. There is no "list" structure in AVFX files.
The structure is also abridged for brevity, the full list of parameters can be found at the link below.
AVFX:
Ver: the AVFX version used?
...parameters....
ScCn: number of schedulers in this file (always 1)
TlCn: number of timelines
EmCn: number of emitters
PrCn: number of particles
EfCn: number of effectors
BdCn: number of binders
TxCn: number of textures
MdCn: number of models
Schd: a scheduler block
TmLn[]: a list of timeline blocks
Emit[]: a list of emitter blocks
Ptcl[]: a list of particle blocks
Efct[]: a list of effector blocks
Bind[]: a list of binder blocks
Tex[]: a list of texture blocks
Modl[]: a list of model blocksScheduler (Schd)
Schd)Items and Triggers
The way Item and Trgr blocks are organized is somewhat unintuitive. Both of them have an identical structure:
However, each subsequent Item/Trgr will have the data of the previous appended to it. For example:
For this reason, the easiest way to read a list of Item is to take the last one, and split it into 3-block chunks.
Timeline (TmLn)
TmLn)Timeline Items
Timeline items have this structure, and are similar to scheduler items in that each item contains the data of the previous ones as well.
Timeline clips
Timeline clips are different in that the data they contain is not organized into blocks, but is rather one continuous 164-byte:
Emitter (Emit)
Emit)The Data block contains information relevant to the emitter's type (specified in the EVT parameter). Depending on the type, the Data block may not exist at all (structures).
Emitter/Particle Items
ItEm and ItPr blocks share the same basic structure, but follow the same pattern as items and triggers within schedulers, where previous items' data is appended to each subsequent one. However, in an emitter, all of the ItEm data is included in the ItPr data. As an example:
Particle (Ptcl)
Ptcl)Like with emitters, the contents of the Data block depends on the particle type (parameter PrVT ). Some particle types do not contain a Data block (structures).
Particle Simple Animations
The Smpl block contains 2 unique parameters: Cols and Frms. Cols is 16 bytes, where each 4 bytes represent an rgba color (each byte is one channel). Frms is 8 bytes, where each 2 bytes is an integer.
Effector (Efct)
Efct)As with emitters and particles, the Data block (structures) depends on the type of effector, and may not exist.
Binder (Bind)
Bind)Data is, once again, dependent on the type of binder, and may not exist (structures). Each of the binder properties have this structure.
Texture (Tex)
Tex)Texture blocks are simply paths to atex files within the game's internal file structure.
Model (Modl)
Modl)The embedded models have 4 possible blocks within them: VNum , VDrw , VEmt, and VIdx . All 4 of the blocks can be in the same model, however VNum and VEmt are always paired, as are VIdx and VDrw .
VIdx
VIdxThis is a list of 2-byte integers, where each 3 integers represents a triangle in the model. The integers themselves are the indexes of vertices within VDrw .
VDrw
VDrwVDrw is a list of vertices, where each vertex is 36 bytes long with the following format:
VEmt
VEmtThis is a list of 28-byte vertices, with the following format:
VNum
VNumThis is a list of 2-byte integers, where each integer corresponds to a vertex in VEmt (so the length of elements in VNum always equals the number in VEmt).
Curves
Curves have the following structure:
The name of a curve varies, but some examples are X ,RGB , SclA , etc. They are used to animate motion over time. Keys is a single block which contains the information on the shape of the curve. Every 16 bytes in Keys corresponds to a single keyframe, with the following format:
Last updated
Was this helpful?