A Description of the LIP File Format v2 Used in Fallout 2
This document will describe the internals of the .LIP format (version 2) used in the Fallout 2 engine. This information was obtained through the analysis of the corresponding functions found in Fallout2.exe
1. FRM files: The Talking Heads[]
The name of the files used for graphical conversation takes the following form.
RootSuffix1Suffix2[Sufix3].frm
Where:
Root - Root file name eg. “ELDER” (5 characters)
Suffix1 - 1st suffix, indicates disposition (1 character)
Suffix2 - 2nd suffix, indicates file contents (1 character)
Suffix3 - 3rd suffix, indicates index number for fidget files (usually 1 character but theoretically could be more if you had over 9 fidget files)
The first suffix indicates that the graphics in this .FRM file have a certain disposition. G is good, B is bad, N is neutral. The second suffix indicates what type of animation is contained in the file, transition, fidgeting or phonemes. Transition animations show a person moving from one disposition to another. Fidgeting animations show the character blinking or nodding or something. Phoneme animations contain 9 possible positions for the characters mouth to be in. These are the ones that are used within the .LIP file format.
The possible values and their meanings for the suffixes are given in table 1.1
Table 1.1 – Values of suffix1, suffix2, suffix3 and their purpose.
Suffix1 | Suffix2 | Suffix3 | Purpose |
---|---|---|---|
‘g’ | ‘v’ | - | Unknown, no files use this combination |
‘g’ | ‘f’ | 1,2,… | Fidget animations for the “good” disposition |
‘g’ | ‘n’ | - | Transition animation from good to neutral disposition |
‘n’ | ‘g’ | - | Transition animation from neutral to good disposition |
‘n’ | ‘f’ | 1,2,… | Fidget animations for the “neutral” disposition |
‘n’ | ‘b’ | - | Transition animation from neutral to bad disposition |
‘b’ | ‘n’ | - | Transition animation from bad to neutral disposition |
‘b’ | ‘f’ | 1,2,… | Fidget animations for the “bad” disposition |
‘b’ | ‘v’ | - | Unknown, no files use this combination |
‘g’ | ‘p’ | - | Phoneme images for the “good” disposition |
‘n’ | ‘p’ | - | Phoneme images for the “neutral” disposition |
‘b’ | ‘p’ | - | Phoneme images for the “bad” disposition |
NOTE: The maximum values for the fidget file numbers (suffix3) are determined in the “heads.lst” file (in /data/art/heads). This file is formatted as such:
ROOT X, Y, Z
Where ROOT is the root filename, X is the number of “good” fidget files, Y is the number of “neutral” fidget files and Z is the number of “bad” fidget files.
Example Root file name: myron.
NOTE: Phoneme files (with suffix3 == ‘p’) must have at least 9 frames. There can be more, but the engine will only use the first 9.
NOTE: The game engine will play a random fidget file at the end of each speech segment which corresponds to the current disposition.
2. LIP File Format ver. 2[]
Offset | Size (bytes) | Data type | Description |
---|---|---|---|
0x0000 | 4 | unsigned | File type version. Fallout 2 uses version 2. |
0x0004 | 4 | unsigned = 0x00005800 | Unknown. It is always set to 0x00005800 however and is read by fallout2.exe but is never used. |
0x0008 | 4 | unsigned | Unknown. During testing these values made no changes to playback. Usually 0x00000000. |
0x000С | 4 | unsigned | Unknown. This value is read by fallout2.exe but is never used. Usually 0x00000000. |
0x0010 | 4 | unsigned | The length of the unpacked ACM file. This value is read by fallout2.exe and divided by the number of phoneme markers but is not used. |
0x0014 | 4 | unsigned | NUM-OF-PHONEMS: Total number of phoneme codes used in this file. |
0x0018 | 4 | unsigned | Unknown. This value is read by fallout2.exe but is never used.Usually 0x00000000. |
0x001С | 4 | unsigned | NUM-OF-MARKERS: Total number of position markers stored in this file. Always equal to(NUM-OF-PHONEMES + 1) because a 0 secondframe with the mouth closed is inserted to the beginning of each speech sequence. |
0x0020 | 8 | char[8] | Name of the corresponding ACM file for this .LIP file. Must not be greater than 7 bytes and must be null terminated. (ie. 0x00) |
0x0028 | 4 | char[4] = “VOC” | Read by fallout2.exe and then converted from .VOC to .ACM then not used. Probably during development they switched from .voc file format to ACM and just hacked in this change to adapt. This is also null terminated. (0x00) |
0x002С | 1 | unsigned = [0x00..0x29] | PHONEM-0: Phoneme 0 This is the first byte in a single byte list of phoneme codes which correspond to a frame in the .FRM file being used. (See table 2.1) |
0x002D | 1 | unsigned = [0x00 .. 0x29] | PHONEM-1: Phoneme 1 |
… | |||
0x002C + NUM-OF-PHONEMS | 4 | unsigned = [0,1] | MARKER-TYPE-0: Type marker 0 See note 3 |
0x0030 +NUM-OF-PHONEMS | 4 | unsigned | MARKER-SAMPLE-0: Offset in unpacked ACM when phoneme must be shown |
0x0034 + NUM-OF-PHONEMS | 4 | unsigned = [0,1] | MARKER-TYPE-1: Type marker 1 See note 3 |
0x0038 +NUM-OF-PHONEMS | 4 | unsigned | MARKER-SAMPLE-1: Offset in unpacked ACM when phoneme must be shown |
… |
NOTE 1: MARKER-TYPE-0 must have value 0x00000001, and MARKER-SAMPLE-0 must have 0x00000000.
NOTE 2: The offset code can be calculated by taking the time stamp that a phoneme appears in the audio file and multiplying it by 4X the sample rate (22,100Hz). Example: If a 'B' sound appears at 2.13s into an audio recording, this would come out to 2.13 x 4 x 22100 = 203,320. In hex, this is 0x00031A38, which would be the value of the MARKER-SAMPLE for that phoneme.
NOTE 3: The MARKER-TYPE fields are used for noting if the given phoneme in the sequence is either A) silence (like at the beginning and end of the file) or B) the start of the word. Where both A and B would be encoded with 0x00000001. If the phoneme appears in the middle of a word, it is just 0x00000000. These values don't appear to be meaningful in the talking head playback.
Table 2.1 – Phoneme codes and their corresponding sounds and frames in the .FRM files.[]
Phoneme
Code |
IPA | Sound | .FRM
Frame |
Phoneme
Code |
IPA | Sound | .FRM
Frame |
Phoneme
Code |
IPA | Sound | .FRM
Frame |
---|---|---|---|---|---|---|---|---|---|---|---|
0x00 | N/A | *Silent* | 0 | 0x10 | ɔɪ | join, boy | 7 | 0x20 | m | man, palm | 6 |
0x01 | i: | bee, lady | 3 | 0x11 | p | pin, dippy | 6 | 0x21 | n | net, funny | 2 |
0x02 | ɪ | busy, guild | 1 | 0x12 | b | bug, bubble | 6 | 0x22 | ŋ | ring, pink | 2 |
0x03 | eɪ | bay, they | 1 | 0x13 | t | tip, matter | 2 | 0x23 | l | live, well | 5 |
0x04 | e | end, bread | 3 | 0x14 | d | dad, add | 2 | 0x24 | w | wit, why | 8 |
0x05 | æ | cat, plaid | 1 | 0x15 | k | cat, folk | 2 | 0x25 | j | you, onion | 2 |
0x06 | ɑ: | arm | 1 | 0x16 | g | gun, egg | 2 | 0x26 | r | run, carrot | 2 |
0x07 | ɔ: | paw, ball | 1 | 0x17 | f | fat, cliff | 4 | 0x27 | tʃ | chip, watch | 2 |
0x08 | oʊ | open, toe | 7 | 0x18 | v | vine, five | 4 | 0x28 | dʒ | jam, wage | 2 |
0x09 | ʊ | wolf, bush | 8 | 0x19 | θ | thongs | 5 | 0x29 | ** | 8 | |
0x0A | u: | dew, blue | 7 | 0x1A | ð | leather | 5 | 0x2A | ** | ||
0x0B | ʊəʳ | cure,tourist | 3 | 0x1B | s | sit, less | 2 | 0x2B | ** | ||
0x0C | ɒ | slaw, fought | 1 | 0x1C | z | zed, buzz | 2 | 0x2C | ** | ||
0x0D | ʌ | lug, blood | 8 | 0x1D | ʃ | sham, ocean | 2 | ||||
0x0E | aɪ | sky, night | 1 | 0x1E | ʒ | treasure, azure | 2 | ||||
0x0F | aʊ | now, shout | 7 | 0x1F | h | hop, who | 2 |
**Rarely / Unused phoneme codes yet to be documented.
3. About the Author[]
Author: Anchorite, Black_Electric
E-mail: anchorite2001@yandex.ru, rlcgamingproductions *at* gmail *dot* com
The author wishes to thank Abel for his input about the ACM file format.
English Translation: phro
Email: phro <hates spam> at rogers.com
Some additional by Anchorite.
Found in TeamX's offline docs