Format:BMG message file
| Platforms | Platform:Nintendo Wii, Platform:Nintendo GameCube |
|---|---|
| Magic | 4D 45 53 47 62 6D 67 31 ("MESGbmg1") |
| Extensions | .bmg |
| Endianness | big |
| On this wiki | Facts · Code · Notes · Topics |
Nintendo's message table of Wii games (Mario Kart Wii, Animal Crossing; .bmg): magic MESGbmg1, a 0x20-byte header with file size, section count and a text encoding byte, then INF1 (message offsets and attributes), DAT1 (text pool), MID1 (message ids) and in some games FLW1/FLI1 (flow) sections.
Overview
BMG files hold the localised text of a game as numbered messages. This page is from Wiimm's SZS Tools (Wiimm/wiimms-szs-tools, GPL-2.0-or-later), project/dclib/lib-bmg.h at commit 246fdb38d7, documentation only. That code targets Mario Kart Wii, so details marked as MKW there may differ in other games.
Header (0x20 bytes)
lib-bmg.h lines 453-463, big endian: 0x00 MESGbmg1 (8 bytes), 0x08 u32 size of the file, 0x0C u32 number of sections, 0x10 u8 text encoding, 0x11 15 bytes of unknown data. Section headers follow at 0x20.
Encoding byte (lines 434-437): 1 CP1252, 2 UTF-16 big endian (used in Mario Kart Wii and Animal Crossing per the comment), 3 Shift-JIS, 4 UTF-8. The tool's default is 2.
Sections
Every section starts with a 4-character id and a u32 size of the section.
- INF1 (lines 489-498): u16 message count at +0x08, u16 size of one item at +0x0A (the tool's standard is 8: the attribute word 0x01000000 is its BMG_INF_STD_ATTRIB), u32 at +0x0C (0 in Mario Kart Wii), then the items: u32 offset into the DAT1 text pool followed by attribute bytes. In Mario Kart Wii the first attribute byte is used for font selection (comment in lib-bmg.h).
- DAT1 (line 505): the text pool starting at +0x08. STR1 (line 506) has the same layout.
- MID1 (lines 536-545): u16 message count at +0x08, u16 at +0x0A (0x1000 in Mario Kart Wii), u32 at +0x0C (0), then one u32 message id per message, in the same order as INF1.
- FLW1 and FLI1: flow-control sections; the tool marks their contents as not understood.
Text contains escape sequences introduced by the character 0x001A (the tool talks of "1A escapes", line 1186), used for colours and variables. Unverified: the layout of an escape (length byte, group and type words) was not read here.
Related
Platform:Nintendo Wii, Format:RARC archive, Format:U8 archive. Unverified: BMG files usually sit inside these archives.
Code & repositories
- https://github.com/Wiimm/wiimms-szs-tools @
246fdb38d7c2fb3054b8f8528e11dc8f17691750· license: GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize a license file)
Mario Kart Wii tool set; project/dclib/lib-bmg.h (BMG), project/src/lib-szs.h and lib-brres.h (BRRES), lib-rarc.h (RARC) document the structures in comments
Tested on: source read, not run: source read as documentation, not run · checked 2026-10-19