STRG (Metroid Prime)

From Retro Modding Wiki
Revision as of 17:33, 25 January 2015 by >Bearborg
Jump to navigation Jump to search

The STRG format is used to store string tables. Each STRG file can contain any number of strings, as well as variations for different languages; the Prime series supports English, French, German, Spanish, Italian, Dutch, and Japanese. The format's been updated in each game it appeared in, so no two games share the exact same STRG format, although it's very similar between all of them.


To do:
The page currently only covers the Prime 1/2 STRG formats; the Prime 3/DKCR one should be added to the page, or split off into a separate page if it turns out it's different enough.

Format

Header

Offset Size Description
0x0 4 Magic; always 0x87654321
0x4 4 Version; see below
0x8 4 Language count
0xC 4 String count
0x10 End of header

These are the possible version numbers:

Version Game
0x0 Metroid Prime
0x1 Metroid Prime 2
0x3 Metroid Prime 3/DKCR

Languages

Following is a table that describes which languages appear in the file.

Offset Size Description
0x0 4 Language fourCC
0x4 4 Language strings offset
0x8 4 Language strings size (note: this is not in Prime 1)
0xC Language entry end

String Names

In Echoes, strings can have names attached to them. Note that this table only appears in the Echoes STRG format; for Prime 1, skip ahead to the string tables.

Offset Size Description
0x0 4 Name count
0x4 4 Name table size
0x8 Name entries begin

Each entry is structured as follows:

Offset Size Description
0x0 4 Name offset (relative to after the name table size value)
0x4 4 String index - this is the string number that the name is associated with
0x8 End of entry

After every name entry comes all the names in the form of a large UTF-8 string array. The names are zero-terminated, and they're sorted in alpabetical order; the sorting is case-sensitive, so 'Z' will appear before 'a'.

String Tables

Last are the actual string tables themselves. Each table contains some metadata followed by a series of Unicode strings. The number of strings is declared in the header; there will be one of these tables present per language present in the file.

Offset Size Description
0x0 4 String table size (note: this is not in Echoes)
0x4 4 × string count String offsets (relative to after the size value)
- Varies Unicode strings

Tools

  • STRG Editor by Parax - supports creating/editing and resaving STRG files in Metroid Prime 1/2's formats