Animation format

From The Ghar Station Wiki
Revision as of 00:57, 13 June 2017 by Imathrowback (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Animation data

Animation within a Gamebryo NIF is achieved using a combination of different techniques.

Texture animation/scrolling

Part of a NIF file. Uses a NiFloatsExtraData flag to specify UV texture co-ords to scroll. See NIFLoader.cs source.

Character models

Most models in use a bone system to link the mesh (skin) with the bones, then the bones can be transformed. Model references are stored in telara.db in dataset 7305.

An example model might be

 imp.nif


The animations for the model utilize a KFM (Keyframe) file. A KFM file contains a list of animations sequence ids and names. The names are not used in RIFT, instead the 'ID' is used to link to a KFB file.

A KFM file uses the same naming convention as the NIF and is usually specified within the NIF entry in telara.db:

 imp.kfm

A KFB file is a NIF file containing the actual animation data. These files contain a series of data, each made up of 4 NIF blocks. A KFB file uses a slightly different naming convention than the KFM. In general if the NPC can wield different weapons, then the KFB file name changes depending on the type of weapon equipped. The actual strings can be gathered from dataset 230 such as:

 2h_staff
 1h_ranged
 dual
 etc.


These are then formatted with the name to give a valid KFB file:

 human_female_dual.kfb
 human_female_2h_staff.kfb



Each sequence in the KFB is made up of:

NIF Type Purpose
NiIntegerExtraData Contains the ID to link to the sequence within the KFM
NiIntegerExtraData Size of the uncompressed binary data of the next block
NiBinaryExtraData Compressed(ZLIB) NIF file stored as binary data.
NiBinaryExtraData Unknown additional data. Appears to contain references to animation triggers like sounds.

The stored NIF data file within the KFB contains a list of NiSequenceData and NiBSplineCompTransformEvaluator that define how the bones should be transformed for each frame by evaluating a spline function.