This format is used for the save game files. It doesn't store area specific information. Instead, it stores information on the party members and the global variables which affect the party members.
Overall structure
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('GAME') |
| 0x0004 | 4 (char array) | Version ('V1.1') |
| 0x0008 | 4 (dword) | Game time (300 units == 1 hour). According to Eddy Jansson, this field is exactly 7 hours (2100 units) ahead of the time displayed in the game. Precisely why this is so is unknown. |
| 0x000c | 2 (word) | Unknown |
| 0x000e | 2 (word) | Unknown |
| 0x0010 | 2 (word) | Unknown |
| 0x0012 | 2 (word) | Unknown |
| 0x0014 | 2 (word) | Unknown |
| 0x0016 | 2 (word) | Unknown |
| 0x0018 | 4 (dword) | Party gold |
| 0x001c | 4 (dword) | Unknown |
| 0x0020 | 4 (dword) | Offset to NPC structs for party members. |
| 0x0024 | 4 (dword) | Count of NPC structs for party members. (i.e. how many characters in party) |
| 0x0028 | 4 (dword) | Unknown |
| 0x002c | 4 (dword) | Unknown |
| 0x0030 | 4 (dword) | Offset to NPC structs for non-party members. |
| 0x0034 | 4 (dword) | Count of NPC structs for non-party members. |
| 0x0038 | 4 (dword) | Offset to GLOBAL namespace variables (i.e. non-local plot variables). |
| 0x003c | 4 (dword) | Count of GLOBAL namespace variables. |
| 0x0040 | 8 (resref) | The resref of some area. (Possibly refers to a .are type resource. |
| 0x0048 | 4 (dword) | Unknown |
| 0x004c | 4 (dword) | Count of journal entries |
| 0x0050 | 4 (dword) | Offset to journal entries (near end of file) |
Now, the format diverges a little between BG and PT. In BG, the next fields in the header look like:
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0054 | 4 (dword) | Unknown |
| 0x0058 | 8 (resref) | Current area (?) |
| 0x0060 | 84 (bytes) | Unknown |
In Planescape, the next fields look like:
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0054 | 4 (dword) | Offset to entries of an unknown format (26 bytes apiece) in middle of file. My belief is that these entries cover some aspect of the inter-NPC relations, but I don't have much hard evidence to back it up, and I don't have any idea what the meaning of the various fields would be, so... |
| 0x0058 | 4 (dword) | Unknown |
| 0x005c | 8 (resref) | Current area (?) |
| 0x0064 | 4 (dword) | Offset to "kill variables", which are set when a particular creature type is killed. Which variable is set is determined by beasts.ini, I believe. |
| 0x0068 | 4 (dword) | Count of "kill variables". |
| 0x006c | 4 (dword) | Offset to an array of bytes, (apparently usually 0 or 1), whose significance is not known. These bytes appear at the end of the file, and may indicate which pictures appear in the journal, or which quests have been undertaken, or any number of things. I do not yet know the purpose of the bytes. |
| 0x0070 | 8 (resref) | Current area (?) |
| 0x0078 | 64 (bytes) | Unknown |
This structure represents data about any character who can possibly be in your party.
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 2 (word) | Unknown |
| 0x0002 | 2 (word) | Party order (0-5, or 0xffff if not in party) |
| 0x0004 | 4 (dword) | Offset from start of file to CRE resource data for this character. |
| 0x0008 | 4 (dword) | Size of CRE resource data for this character. |
| 0x000c | 8 (bytes) | Unknown |
| 0x0014 | 4 (dword) | Unknown |
| 0x0018 | 8 (resref) | Area where character is currently located. |
| 0x0020 | 2 (word) | Current X coordinate of character |
| 0x0022 | 2 (word) | Current Y coordinate of character |
| 0x0024 | 2 (word) | X coordinate of viewing rectangle. possibly this is stored per character so that multi-player games allow the characters to have different saved view rects? |
| 0x0026 | 2 (word) | Y coordinate of viewing rectangle |
| 0x0028 | 100 (bytes) | Unknown |
| 0x008c | 16 (bytes) | Unknown |
| 0x009c | 3*8 (resref array) | Unknown |
| 0x00b4 | 12 (bytes) | Unknown |
For BG/TotSC:
| 0x00c0 | 32 (bytes) | Name |
| 0x00e0 | 4 (dword) | Unknown |
| 0x00e4 | 116 bytes (Char stats) | stats for this character |
| 0x0158 | 8 bytes | Unknown |
For Torment:
| 0x00c0 | 32 (bytes) | Unknown |
| 0x00e0 | 3*4 (dword) | Unknown |
| 0x00ec | 116 bytes (Char stats) | stats for this character |
| 0x0160 | 8 bytes | Unknown |
For Icewind Dale:
| 0x00c0 | 32 (bytes) | Name |
| 0x00e0 | 4 (dword) | Unknown |
| 0x00e4 | 116 bytes (Char stats) | stats for this character |
| 0x0158 | 8 bytes | Unknown |
| 0x0160 | 32 (bytes) | Unknown |
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (strref) | Name of "most powerful vanquished" |
| 0x0004 | 4 (dword) | XP of "most powerful vanquished" |
| 0x0008 | 4*3 (dword array) | Unknown |
| 0x0014 | 4 (dword) | kill XP (chapter) |
| 0x0018 | 4 (dword) | kill number (chapter) |
| 0x001c | 4 (dword) | kill XP (game) |
| 0x0020 | 4 (dword) | kill number (game) |
| 0x0024 | 4*8 (resref array) | Favorite spells |
| 0x0044 | 4*2 (word array) | favorite spell count |
| 0x004c | 4*8 (resref array) | Favorite weapons |
| 0x006c | 4*2 (word) | favorite weapon count |
These structures represent variables with a textual name an an integer value. Most variables are in some namespace or other -- a namespace being a 6-byte character string. Most variables go in the "GLOBAL" namespace, though some go in area-specific namespaces.
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 32 (char array) | Variable name |
| 0x0020 | 8 (bytes) | Unknown |
| 0x0028 | 4 (dword) | Variable value |
| 0x002c | 40 (bytes) | Unknown |
Every time some text is entered into your journal, its strref is added to this table, along with the time (in seconds! not in 12-second increments, as the earlier game time in this file), as well as the "current chapter".
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (strref) | Journal text |
| 0x0004 | 4 (dword) | Time in seconds (I believe. The number goes up approximately 12 times too fast to be on the same scale as the earlier time values. |
| 0x0008 | 4 (dword) | Current chapter number. (Always 0 for Torment). |
[ back to index ]