MSBT (File Format): Difference between revisions

From Luma's Workshop
Jump to navigation Jump to search
(Created page with "Category:File formats '''MSBT''' stands for ''Message Binary Text'', it contains all of the text used in '''Super Mario Galaxy 2'''. == Header == {| class="wikitable" ! Offset !! Type !! Description |- | 0x00 || String || ''MsgStdBn'' in ASCII. |- | 0x08 || UInt16 || Endianess. 0xFEFF for Big Endian, 0xFFFE for Little Endian. |- | 0x0A || UInt32 || Version. |- | 0x0E || UInt16 || Number of sections. |- | 0x10 || UInt16 || Padding. |- | 0x12 || UInt32 || File length...")
 
m (Super Hackio moved page MSBT to MSBT (File Format) without leaving a redirect: Title format change)
(No difference)

Revision as of 22:47, 26 January 2024

MSBT stands for Message Binary Text, it contains all of the text used in Super Mario Galaxy 2.

Header

Offset Type Description
0x00 String MsgStdBn in ASCII.
0x08 UInt16 Endianess. 0xFEFF for Big Endian, 0xFFFE for Little Endian.
0x0A UInt32 Version.
0x0E UInt16 Number of sections.
0x10 UInt16 Padding.
0x12 UInt32 File length.
0x16 Byte[0xA] Padding.

Sections

After the header follows the sections. It is worth noting that these sections are padded to the nearest 0x10th byte with the value 0xAB.

LBL1

Header

Offset Type Description
0x00 String LBL1 in ASCII.
0x04 UInt32 Section size. Does not account for this header or padding.
0x08 Byte[0x8] Padding.

Label Entries

After the header come the label entries.

Offset Type Description
0x00 UInt32 Label count.
0x04 LabelArray[N] Labels, where N is the label count read above.

A label is defined by the following structure:

Offset Type Description
0x00 UInt32 Number of strings associated with this entry.
0x04 UInt32 Offset to the strings associated with that label, offset relative to the field defining the amount of entries. Reads N strings, depending on the count read above.

ATR1

Header

Offset Type Description
0x00 String ATR1 in ASCII.
0x04 UInt32 Section size. Does not account for this header or padding.
0x08 Byte[0x8] Padding.

Attribute Entries

Offset Type Description
0x00 UInt32 Attribute set count.
0x04 UInt32 Attribute size. The size of each attribute in bytes.
0x08 AttributeSetArray[N] Attribute sets, where N is the set count read above.

The attribute structure is dependent on the game, but in Super Mario Galaxy 2 each attribute is of size 0x0C and has the following structure:

Offset Type Description
0x00 Byte NPC Sound ID.
TODO: Add a list of NPC Sounds here?
0x01 Byte Camera type.
ID Description
0 AUTOMATIC - The camera will be handled automatically by the game.
1 MANUAL - The camera used will be one from the CameraParam.bcam file inside the zone's Map archive.
2 NONE - The camera will not change.
0x02 Byte Trigger type.
ID Description
0 The player has to be close to the NPC and press A to start the dialog.
1 The dialog is activated automatically when the player is close, but the player can still move when the dialog has started. The dialog stops when the player exits the trigger area.
2 The dialog is activated automatically when the player is close, but the player has to finish the dialog to continue moving.
3 The dialog is activated automatically when the player is anywhere (or in a much larger area?), but works otherwise like 2.
0x03 Byte Dialog style.
ID Description
0 – 2 White textbox.
3 Billboard textbox.
0x04 UInt16 Camera ID. This is the ID that you find inside the CameraParam.bcam file. Needs to be higher than 0.
0x06 Byte MessageArea ID. This matches with MessageArea's Obj Arg 0.
0x07 Byte
0x08 UInt32 Offset to a UTF-16 encoded, null terminated, string. Seems to be unused.

TXT2

Header

Offset Type Description
0x00 String TXT2 in ASCII.
0x04 UInt32 Section size. Does not account for this header or padding.
0x08 Byte[0x8] Padding.

Text Entries

Offset Type Description
0x00 UInt32 Text count.
0x04 Text[N] Texts, where N is the text count read above.

A text entry is a UTF-16 string, with embedded "tags" that affect the way the text displays and functions. A tag begins with a value of 0x000E and then the "tag". The following "tags" are possible:

Type Description
0x0 System Group
0x1 Display Group
0x2 Sound Group
0x3 Picture Group
0x4 Font Size Group
0x5 Localize Group
0x6 Number Group
0x7 String Group
0x9 Race Time Group
0xA Font Group

A "tag" can have a "command", which tells it how to function.

System Group

Offset Type Description
0x00 UInt16 Type. [0 == Japanese, 3 == Color]
0x02 UInt16 Data size.
0x04 UInt16 The color to use.

Display Group

Offset Type Description
0x00 UInt16 Display type.
0x02 UInt16 Data size.
0x04 UInt16 Padding.
0x06 UInt16 Number of frames to wait if the type is 0.

Sound Group

Plays a given sound.

Offset Type Description
0x00 UInt16 Should always be 2.
0x02 UInt16
0x04 UInt16 String length.
0x06 String[Length] UTF-16 string containing the sound effect to play.

Picture Group

Offset Type Description
0x00 UInt16 Character index.
0x02 UInt16 Font.
0x04 UInt16 Character ID.

Font Size Group

Offset Type Description
0x00 UInt16 Font Size.

Localize Group

Inserts the current player's name.

Offset Type Description
0x00 Byte[0x6]

Number Group

String Group

Race Time Group

Font Group