Skip to main content

TEXT.DAT field reference

File page · Format catalogue · Schema source

This page is generated from the Kaitai schema TEXT_DAT.ksy each time the site is built. The schema is the authoritative description; statements are established unless marked inferred or unknown, and the evidence is listed on the file page (see the reading guide).

  • Schema: Eye of the Beholder II DOS dialogue texts
  • Byte order: little-endian
  • File extension: dat
  • Schema license: MIT

Description​

TEXT.DAT holds the texts of the illustrated dialogue screen and of the parchments: a table of 16-bit offsets followed by zero-terminated texts. A dialogue instruction names a text by its one-based entry in the table; a parchment shows the text whose number is its value plus one. See the format overview and the dialogue instruction.

The game opens TEXT.DAT and reads at most 32,000 bytes into a shared buffer when a dialogue opens or a parchment with a text is read. To show text n it reads the word at byte 2 × (n − 1) of the buffer and prints from that byte offset of the buffer up to a zero byte. Neither the entry number nor the offset is checked, and the game never reads a count: the table size is not part of the game's reading.

In the original file (22,463 bytes), the first offset equals the table size (244 bytes, 122 entries), the offsets increase, and each text ends with the zero byte just before the next text, the last one at the end of the file. This schema derives the entry count from the first offset; other versions of the file are unknown.

File structure​

FieldTypeSize, repetition and constraints
offsetsu2repeated first_offset / 2 times
texts_rawbytes to end of stream—

offsets

Byte offset, from the start of the file, of each text; entry n − 1 holds text n. The number of entries is the first offset divided by 2 (see the top-level description).

texts_raw

The bytes after the table, where the offsets point; kept raw so that the file can be rebuilt byte for byte. The texts themselves are in texts.

Derived values and positioned data:

FieldTypeSize, repetition and constraints
first_offsetu2at position 0
textstext_entry(offsets[_index])repeated offsets.size times

first_offset

The first table entry, read again to size the table. In the original file it is 244.

texts

The texts in table order, each read from its offset to its zero byte.

Type text_entry​

One dialogue text. Besides printable characters it may hold control bytes interpreted by the game's text printer. The original file uses only these: 0x01 (page break: the game waits for the player, then clears the text window), 0x06 followed by a colour byte (the rest of the text in that colour; the file uses 9 and 15) and 0x0d (new line). Lines are word-wrapped by the game, so other line breaks are not needed. No byte of the original file is above 0x7f. The page layout is described in text window and pages.

Parameters: ofs (u2)

Derived values and positioned data:

FieldTypeSize, repetition and constraints
bodystrzat position ofs; in stream _root._io; encoding ASCII

body

The text up to, not including, its zero byte. Entry 20 of the original file is a single space; the dialogue scripts use it to show a prompt alone.