TBG File Format

Applies to:
BG1, BG1: TotS, BG2, BG2: ToB, PST, IWD, IWD:HoW, IWD:TotL, IWD2

General Description
This file format allows files to be transferred between IE installations, while keeping strrefs intact. TBG V3.0 handles most filetypes (including ITM, SPL and CRE).

Detailed Description
Overall Structure:

Offset Size (datatype) Description
0x0000 4 (char array) Signature ("TBG3")
0x0004 4 (dword) Null fields
0x0008 12 (char array) Filename
0x0014 4 (dword) File offset
0x0018 4 (dword) File length
0x001C 4 (dword) Infinity Engine ID
  • value 0x01- Baldur's Gate
  • value 0x02- Planescape: Torment
  • value 0x03- Icewind Dale
  • value 0x04- Baldur's Gate II: Shadows of Amn
0x0020 4 (dword) Text Entries Offset
0x0024 4 (dword) Count of Text Headers
0x0028 4 (dword) Text Headers Offset

Offset Size (datatype) Description
0x0000 4 (dword) Offset (from start of Texct entries) to text
0x0004 4 (dword) Length of text
0x0008 4 (dword) Offset in data file where the strref should be inserted or 0xFFFFFFFF if the strref should not be inserted into the data file
0x000C 8 (char array) Associated sound filename

This is the actual file that is to be transferred.

This is all the actual text that will be actually imported into the Infinity Engine game.