Ultima Stones | Ultima IV Home | Development | File Details
CGA | CON | DNG | EGA | MAP | SAV | TLK | ULT


*.TLK File Specification

    Each of the TLK files has 16 conversations in it. Every one of these conversations takes up 288 (0x120) bytes no matter what the length of the information in it (see Table. 1).

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

000

A B C

010

020

030

040

050

060

070

080

090
0A0
0B0
0C0
0D0
0E0

0F0

100

110

Table 1:  A single conversation block.

    Every block starts out with three bytes. Byte A is the question vector. The NPC poses its question after the player asks the keyword pointed to by this value. The keyword mapping follows:

0. There is no question.
1. Name
2. Look
3. Job
4. Health
5. Keyword 1
6. Keyword 2

    Byte B is a flag which is either 0 or 1. It determines the humility effect of the NPC's question. If the flag is true, equal to 1, a Yes answer to the NPC's question will subtract 5 points from the player's Humility score. A No answer will add 5 points.

    Byte C is a value which affects the attitude of the character. A zero value means the character is unaffected. A value between zero and 128 causes a flighty attitude. The greater the value, the more likely they will 'turn away' from a conversation. Values of 128 to 255 indicate a combative attitude. The greater the value, the more likely the NPC will not just break off the conversation but will actually attack the player. At 255, just saying one word to such an NPC will get you in a fight.

    The rest of the information breaks out into 12 fields separated by null zero bytes. The remainder of the block is padded with zero bytes. The fields in order are as follows:

  1. Name (Length Varies & Multilined)
  2. Pronoun or Short (Length Varies)
  3. Look (Length Varies & Multilined)
  4. Job (Varies & Multilined)
  5. Health (Varies & Multilined)
  6. Keyword 1 Response (Varies & Multilined)
  7. Keyword 2 Response (Varies & Multilined)
  8. Question (Varies & Multilined)
  9. Yes Reply (Varies & Multilined)
  10. No Reply (Varies & Multilined)
  11. Keyword 1 (4 bytes, all capitals)
  12. Keyword 2 (4 bytes, all capitals)

    Note that the bold face indicates a typical user input (keyword 1 and keyword 2 are assumed as well). The underlining notes the minimum input to type. Except for certain points in the game, it is only necessary to type in four letters of a question, or a 'y' or a 'n' to respond to a question. Knowing that every field needs to be zero terminated, including keyword 2, the free number of bytes in the block for the variable length fields is 265 (0x109). The separator in multilined fields is 0x0A. Empty fields have a single capital "A" (0x41) in them while an empty keyword field has a capital "A" followed by three spaces.