BRLAN (File Format)

From Custom Mario Kart
(Redirected from Brlan)
Jump to navigation Jump to search

BRLAN files (Binary Revolution Layout AnimatioN) are used to produce layout animations. Along with BRCTR and BRLYT files, it's part of the UI from Mario Kart Wii. BRLAN files are always into the anim folders.

Header

The file starts with a header that is 0x10 bytes long:

Offset Type Description
0x00 String File magic. Always RLAN in ASCII.
0x04 UInt16 Byte order mark (BOM): The value is always 0xFEFF. If value 0xFFFE is read, then the false endian is used. Mario Kart Wii uses nearly always big endian (bytes 0xFE,0xFF).
0x06 UInt16 Version number of the file format.
0x08 UInt32 Length of the file in bytes.
0x0C UInt16 Length of this header in bytes.
0x0E UInt16 Number of sections.
0x10 End of file header

pat1

After the header comes the pat1 section. The section is pretty unknown.

Offset Type Description
0x00 String Section magic. Always pat1 in ASCII.
0x04 UInt32 S = Size of this section.
0x08 UInt16 Unknown.
0x0A Int16 Negated number of frames.
0x0C UInt32 O1 = Offset to string 1 relative to the start of this section.
0x10 UInt32 O2 = Offset to string 2 relative to the start of this section. Sometimes no string is stored and then this values refers to the end of the section.
0x14 Int16 Negated number of total frames.
0x16 UInt16 Unknown.
0x18 Byte isDescendingBind.
0x19 Byte Unknown.
0x1A UInt16 Unknown.
O1 StringNT String 1. This is the name of this animation used by BRCTR.
O2 StringNT String 2. Unknown usage. Often nothing.
S End of section

There may be padding (00) stored after the pat1 section to align next section.

pai1

After the pat1 section comes the pai1 section:

Offset Type Description
0x00 String Section magic. Always pai1 in ASCII.
0x04 UInt32 Size of this section including all the animation entries.
0x08 UInt16 Number of frames.
0x0A Byte Flags.
0x0B Byte Unknown.
0x0C UInt16 T = Number of TPL filenames.
0x0E UInt16 N = Number of animations.
0x10 UInt32 O = Offset to the offset array which points to the animations. Relative to the start of this section.
0x14 UInt32[T] Offsets to null-termined strings which store the TPL filenames. Relative to the start of this array.
O UInt32[N] Offsets to animation sections. Relative to the start of this section.

Animation

An animation starts with the following structure:

Offset Type Description
0x00 String Name of this animation. The length is always 0x14. Unused bytes are set to 00.
0x14 Byte N = Number of animation tags in this animation.
0x15 Byte Defines what the animation is animating. 0 = pane, 1 = material.
0x16 UInt16 Unknown.
0x18 UInt32[N] Offsets to the animation tags. Relative to the start of this section.

Animation Tag

The animation tag section sets the type of the animation.

Offset Type Description
0x00 String Animation type.
0x04 Byte N = Number of animation entries.
0x05 Byte[3] Padding?
0x08 UInt32[N] Offsets to the animation entries. Relative to the start of this section.

Animation Types

These are the 6 different animation types found in BRLAN files:

Name Description
RLPA Revolution Layout PAne SRT (Scale/Rotate/Translate) animation.
RLTS Revolution Layout Texture SRT animation.
RLVI Revolution Layout VIsibility animation.
RLVC Revolution Layout Vertex Color animation.
RLMC Revolution Layout Material Color animation.
RLTP Revolution Layout Texture Pattern animation.

Animation Entry

An animation entry stores the key frames and some settings for the animation.

Offset Type Description
0x00 Byte Index.
0x01 Byte Target. Sets the target of the animation. Different for different types. See this page for more info.
0x02 Byte Key frame type. Only types 1 and 2 are known.
0x03 Byte Unknown.
0x04 UInt16 Number of key frames.
0x06 UInt16 Unknown.
0x08 UInt32 Offset to the first key frames, relative to the start of this section. Always 0x0C.

Key Frame

The key frames contains the actual animations. The type of the key frame is set by the animation entry. Currently only two types have been seen, 1 and 2.

Type 1
Offset Type Description
0x00 Float Frame index. Can be negative.
0x04 UInt16 Value.
0x06 UInt16 Padding.
Type 2
Offset Type Description
0x00 Float Frame index. Can be negative.
0x04 Float Value.
0x08 Float Blend.

Tools

The following tools can handle BRLAN files: