FTXP (File Format)

From MK8
Revision as of 14:46, 26 April 2017 by Wexos (talk | contribs) (Not completed but it's a start)
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.

FTXP files (caFe TeXture Pattern) are texture pattern animation files found into BFRES files in the 6:th index group. It contains animation data about which texture that should be rendered at what time. Unless otherwise noted, all offsets in the file are relative to themselves.

Header

The file starts with a 0x38 bytes long header.

Offset Type Description
0x00 String File magic. Always FTXP in ASCII.
0x04 Int32 Filename offset. The name of this file.
0x08 Int32 End of String table offset.
0x0C UInt16 Flags.
Bit (MSB) Size (in bits) Description
0x0D 0x01 Loops.
0x0E UInt16 Number of user data.
0x10 UInt32 Number of frames.
0x14 UInt16 Number of textures.
0x16 UInt16 Number of materials.
0x18 UInt32 Unknown.
0x1C UInt32 Unknown.
0x20 UInt32 Unknown.
0x24 UInt32 Unknown.
0x28 UInt32 Unknown.
0x2C Int32 Material array offset.
0x30 Int32 Texture index group offset. The groups point to FTEX filenames and FTEX headers.
0x34 Int32 User data index group offset.

Material

This section describes info about the material that is animated.

Offset Type Description
0x00 UInt16 Number of texture targets.
0x02 UInt16 Number of animations.
0x04 UInt32 Unknown.
0x08 UInt32 Unknown.
0x0C Int32 Name offset. Points to the name of the material into the string table.
0x10 Int32 Texture target array offset.
0x14 Int32 Animation array offset.
0x18 UInt32 Unknown.

Texture target

A texture target points to a texture type, _a0, _a1 etc. Each entry is a 8 byte structure.

Offset Type Description
0x00 Byte Unknown.
0x01 Byte Unknown.
0x02 UInt16 Unknown.
0x04 Int32 Offset to the texture type string.

Animation

Offset Type Description
0x00 UInt16 Flag.
0x02 UInt16 Number of key frames.
0x04 UInt32 Unknown.
0x08 Float Min key. The value of the smallest key frame.
0x0C Float Max key. The value of the largest key frame.
0x10 UInt32 Unknown.
0x14 Float Max value. The value of the largest animation value.
0x18 Int32 Key frame data offset.
0x1C Int32 Value data offset.

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.
Numbers

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

Strings
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.