The 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 blocks
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:
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).
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.
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)
Texture blocks are simply paths to atex files within the game's internal file structure.
Model (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
This 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
VDrw is a list of vertices, where each vertex is 36 bytes long with the following format:
VEmt
This is a list of 28-byte vertices, with the following format:
VNum
This 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).
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:
Emit:
SdNm: the path to a sound file (.sdm)
...parameters....
PrCn: number of particles
EmCn: number of emitters
...animation curves...
ItEm[]: list of emitter items
ItPr[]: list of particles items
Data: depends on the emitter type
ItEm:
[ItEm data #0]
ItEm:
[ItEm data #0]
[ItEm data #1]
ItEm:
[ItEm data #0]
[ItEm data #1]
[ItEm data #2]
ItPr:
[ItEm data #0]
[ItEm data #1]
[ItEm data #2]
[ItPr data #0]
ItPr:
[ItEm data #0]
[ItEm data #1]
[ItEm data #2]
[ItPr data #0]
[ItPr data #1]
Ptcl:
...parameters...
UvSN: number of UV Sets
...more parameters...
...animation curves...
Smpl: Simple animations (optional)
UVSet[]: a list of UVSet blocks
Data: depends on particle type
TC1: texture color 1
TC2: texture color 2 (optional)
TC3: (optional)
TC4: (optional)
TN: texture normal
TR: texture reflection
TD: texture distortion
TP: texture palette