IDS files

Description

IDS files provide a mapping from numeric values to arbitrary string values. Frequently, these strings are labels for internal constants of various types, including names of the triggers and actions used in the AI scripting as well as other important constants. This file format is very straightforward. In fact, it barely merits mention, but for completeness, it will be mentioned here.

IDS files: Baldur's Gate, Planescape: Torment, Icewind Dale, Baldur's Gate 2

This is a text file format, arranged in two columns. Like all text files in BG, it has CR-LF delimited lines (i.e. 0x0d 0x0a at the end of each line). First column is numeric constants, either decimal integers, or hexadecimal integers specified in the C/C++ notation. In case you are not familiar with this notation, it looks like 0x07d0, for instance, which is the hex representation of decimal 2000. Everything to the right of the whitespace following the constant is the string value of the constant. The only row which doesn't match this specification is the first row, which consists of a single number. When these files are loaded into memory, sometimes a quick "integer to string" index is built. The first row, which is not loaded, holds the maximum value, which is computed whenever the file is loaded, and which would determine the size of a quick lookup table, if one is to be built.

Encryption

Note that some of these files are encrypted, as are some of the 2DA files. (The encryption appears to only occur in BG, and not in PS: Torment. Anyway, to read about the technical details of the encryption, go to the encryption page.) These encrypted files can be recognized by the first two bytes, which are 0xffff in case of an encrypted file, and are not part of the ciphertext. An unencrypted file start immediately with the plaintext, which can always be assumed not to start with the 0xff character.

[ back to index ]