IDS file format

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

General Description
This file format is generally a text based lookup table. IDS files provide a method to map a symbolic name to a numeric identifier. The file fall into two categories; those required by the game, and those required for ease-of-use in scripting. Files required by the game (e.g. projectl.ids) are referenced at run-time to convert a number (as stored in an ITM or SPL) into a filename. Files used by scripting are referenced when scripts are compiled/decompile. When scripts are decompiled, IDS files can optionally be used to convert the numeric format stored in BSC files back to the symbolic name. When scripts are compiled, if a symbolic name has been used, the relevant IDS file must be present to convert the name into a numeric value. In either case, once the compilation/decompilation is done, the IDS file is no longer used.

Detailed Description
Overall structure

The IDS file header consists of two lines, either of which may be omitted. The first line is the file identifier (usually IDS or IDS V1.0). The second line is the number of entries in the file (this value is not always correct).

The main section of an IDS file are the data entries. The data entries are specified in two columns, the value and the identifier. The value can be specificied in decimal or hexadecimal (using the 0x0000 notation).

Encryption
NB. Some files are encrypted as detailed on the encryption page.