FVIS (File Format)

From MK8
Revision as of 10:07, 1 April 2017 by Wexos (talk | contribs) (Created page with "{{under-construction}} '''FVIS''' files (ca'''F'''e '''VIS'''ibility) are visibility animation files. The same format seems to be used for both '''bone''' visibility and '''m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

FVIS files (caFe VISibility) are visibility animation files. The same format seems to be used for both bone visibility and material visibility. They are found into BFRES files in the 7:th index group (bone visibility) and the 8:th index group (material visibility). Unless otherwise noted, all offsets in the file are relative to themselves.

Header

The file starts with a 0x34 bytes long header.

Offset Type Description
0x00 String File magic. Always FVIS in ASCII.
0x04 Int32 Filename offset. The file name of the file without the extension.
0x08 Int32 String table end offset. Points to the end of the string table.
0x0C UInt16 Flags.
0x0E UInt16 Number of user data entries.
0x10 UInt32 Number of frames in this animation.
0x14 UInt16 Number of material targets or bone targets.
0x16 UInt16 Unknown.
0x18 UInt32 Unknown.
0x1C UInt32 Unknown.
0x20 Int32 Offset to an structure with unknown purpose. There is a UInt16 foreach material or bone.
0x24 Int32 String list offset. Points to a list of offsets which points to the names of the materials or bones.
0x28 Int32 Animation data offset. Points to the first animation data. It is unknown exactly how it works when there is more than one animation.
0x2C Int32 Offset to an unknown structure.
0x30 Int32 User data index group offset.

Animation Data

Offset Type Description
0x00 UInt16 Flag.
Bit index (MSB) Size (in bits) Description
0x02 2 Pre wrap. 0 = Clamp, 1 = Repeat, 2 = Mirror.
0x06 2 Post wrap. 0 = Clamp, 1 = Repeat, 2 = Mirror.
0x02 UInt16 Number of key frames.
0x04 UInt32 Unknown.
0x08 Float Min frame. Value of the smallest frame index.
0x0C Float Max frame. Value of the largest frame index.
0x10 UInt32 Unknown.
0x14 UInt32 Unknown.
0x18 UInt32 Unknown.
0x1C Int32 Offset to the key frames.
0x20 Int32 Offset to the value data.

Key Frames

It is unknown how the key frames are stored. Sometimes it is just a byte[] of indices. This is of course not possible if the frame count is larger than 0xFF.

Value Data

It is unknown how the value data is stored.

User Data

The user data is stored into different entries, one for each type. The index group points to these entries.

Offset Type Description
0x00 Int32 Name offset. Points to the string which is the name of this user data.
0x04 UInt16 N = number of entries.
0x06 Byte Type.
Value Type Description
0x00 Int32 The data consists of 4-bytes integers.
0x01 Float The data consists of 4-bytes floating point numbers.
0x02 String The data consists of ASCII-encoded strings.
0x03 Strings The data consists of UTF16-encoded strings.
0x07 Byte Unknown. Always 0.

Number

For user data with numbers the data comes directly after the user data header.

String

Offset Type Description
0x00 Int32[N] N offsets to the strings. The strings are null-termined and comes directly after this array. They're not stored in the string table.