Skip to main content

SAV field reference

File page · Format catalogue · Schema source

This page is generated from the Kaitai schema SAV.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 saved games
  • Byte order: little-endian
  • Schema license: MIT

Description​

A saved game, EOBDATA<n>.SAV (or FINAL.SAV), is a snapshot of the game state written as seven consecutive chunks with no header: the slot description, the six characters, a block of party and world variables, every item, one record per dungeon level, three option settings and six conjured-weapon item types. Each chunk is a copy of a memory area of the game, so most of its fields are described by the runtime structure pages linked below. See the format overview and saving and restoring.

Writer and reader: the game writes the chunks in this order with these lengths; when loading, it reads the whole file and compares each chunk's length with a table of expected lengths before restoring anything. The file name is built from EOBDATA%d.SAV with the slot number, or is FINAL.SAV for slot -1.

The original EOBDATA0.SAV, 46,891 bytes, is exactly the sum of the seven lengths. Its level records chunk is byte-identical to the original LEVELS.TMP, and its level-4 record decodes to the cells of LEVEL4.MAZ. Only one saved game exists among the original files, so fields are not generalized from its values.

Checks: the reader checks only that each chunk is complete; a short chunk rejects the whole file and nothing is restored. No restored value is tested or corrected, and bytes after the seventh chunk are never read. See /eob2/saves/SAVED_GAMES#when-saving-or-loading-fails.

FINAL.SAV: written once, when a monster of a type with capability bit 0x04, other than type 0, dies on level 16, sublevel 1 (the final opponent's second form, inferred), just before the ending; the game never reads it. See /eob2/saves/SAVED_GAMES#the-end-of-the-game.

Scope: EOB II DOS only. Bytes after the seventh chunk, absent from the original file, are kept as raw data.

File structure​

FieldTypeSize, repetition and constraints
descriptionstrzsize 20; encoding ASCII
characterscharacterrepeated 6 times
worldworld_statesize 92
itemsitem_dat::itemrepeated 600 times
level_recordslevel_recordsize 2130; repeated 17 times
tunesu1—
soundsu1—
bar_graphsu1—
conjured_item_typesitemtype_dat::item_typerepeated 6 times
trailing_unknownbytes to end of stream—

description

The slot description typed in the save menu, zero-terminated; the game keeps the six descriptions in a table, 20 bytes per slot. The reader skips it; the load menu reads it from each EOBDATA file to list the slots. In FINAL.SAV (slot −1) the same formula reads the 20 bytes before the table, game variables that end with the save-slot mask, not a description (bug ANOMALY-72, see /eob2/saves/SAVED_GAMES#anomaly-final-save-description). Descriptions typed in the save menu contain only the characters from space to ~, with lower-case letters turned into capitals and no leading space; bytes after the terminator are kept from the previous contents. How the game shows other byte values found in a file is unknown. File offset 0x0000.

characters

The six party slots, 0x159 bytes each, from file offset 0x0014. See CharacterRuntime for the fields; the type below separates only what the saved form changes.

world

The 92-byte block of party and world variables, from file offset 0x082a.

items

The whole item table, 600 records of 14 bytes, from file offset 0x0886. The records have the layout of ITEM.DAT items; see ItemRuntime.

level_records

One 0x852-byte record per level, record n − 1 for level n, from file offset 0x2956: the same image as LEVELS.TMP (see LEVELS_TMP.ksy). Only records whose bit is set in world.level_record_bits are used; the others can hold leftover data, as 16 of the 17 records of EOBDATA0.SAV do.

tunes

The "Tunes" option (low byte of the game's option word). File offset 0xb6c8. 1 in EOBDATA0.SAV.

sounds

The "Sounds" option (low byte of the game's option word). File offset 0xb6c9. 1 in EOBDATA0.SAV.

bar_graphs

The "Bar Graphs" option. File offset 0xb6ca. 1 in EOBDATA0.SAV.

conjured_item_types

Item types 51 to 56 of the item-type table, from file offset 0xb6cb. The game reserves them at run time for conjured weapons; a type whose defense adjustment byte is -30 (0xe2) is free, as all six are in EOBDATA0.SAV.

trailing_unknown

Data after file offset 0xb72b, unknown, kept verbatim. Empty in EOBDATA0.SAV; the reader does not read past this point.

Type character​

One character record (0x159 bytes) as written by the save writer. The layout is that of CharacterRuntime; only the fields that the saved form treats specially are separated.

FieldTypeSize, repetition and constraints
fields_00036 bytes—
portraits1—
fields_02516 bytes—
face_image_pointeru4—
fields_039218 bytes—
timers_remainingu4repeated 10 times
fields_13b30 bytes—

fields_000

See CharacterRuntime, offsets 0x00–0x23.

portrait

Portrait number at +0x24. The reader redraws the portrait from CHARGENA.CPS when it is 0 or more, and from OUTPORTS.CPS, image −(portrait + 1), when it is negative.

fields_025

See CharacterRuntime, offsets 0x25–0x34 (food at 0x25).

face_image_pointer

A run-time far pointer to the portrait image (+0x35), written as it was in memory. The reader ignores it and keeps the pointer already in memory.

fields_039

See CharacterRuntime, offsets 0x39–0x112: spell slots, known spells, inventory.

timers_remaining

The ten character timers (+0x113), saved as the number of counter ticks left, 1 for a timer that was already due, and 0 for an unused one. The reader adds the current counter to each nonzero value.

fields_13b

See CharacterRuntime, offsets 0x13b–0x158: timer events and other state.

Type world_state​

The block of variables starting at the current level. Field names are descriptive.

FieldTypeSize, repetition and constraints
levelu2—
sublevelu2—
party_blocku2—
party_directionu2—
held_itemu2—
level_record_bitsu4—
party_spell_effectsu4—
unknown_6de0u1—
rest_refusedu1—
level_flagsu4repeated 17 times
global_flagsu4—

level

Current level. 4 in EOBDATA0.SAV.

sublevel

Current sublevel of the INF file. 0 in EOBDATA0.SAV.

party_block

Block index of the party, column = index mod 32, row = index div 32. 171, cell [11:05], in EOBDATA0.SAV.

party_direction

Party direction, 0 north, 1 east, 2 south, 3 west (see /eob2/enums/DIRECTION). 2 (south) in EOBDATA0.SAV.

held_item

Item held with the mouse, 0 for none.

level_record_bits

Bit n − 1 set when level n has a record. Only bit 3 (level 4) in EOBDATA0.SAV.

party_spell_effects

Lasting spell effects of the whole party, a SpellEffectFlags mask. 0 in EOBDATA0.SAV.

unknown_6de0

Saved and restored with this block but never read or written otherwise; its role, if any, is unknown. 0 in EOBDATA0.SAV.

rest_refused

Rest refusal flag; nonzero forbids resting.

level_flags

Script flags of each level, four bytes per level.

global_flags

Global script flags.

Type level_record​

The record of one level (0x852 bytes), packed when the party leaves the level and unpacked when it returns. It keeps what changes during play; the rest of each block is rebuilt from the level files when the level loads. See saving and restoring.

FieldTypeSize, repetition and constraints
walls_packed1200 bytes—
monster_slots30 bytesrepeated 30 times
temporary_wallstemporary_wallrepeated 5 times

walls_packed

The four wall references of the 1,024 blocks, 4,096 bytes in block order, packed with the type-4 (LCW) method of CPS.ksy into at most 0x4b0 bytes; the game decodes it with the same routine as type-4 containers. The walls are stored as they are, not as a difference from the map: the level-4 record of EOBDATA0.SAV decodes to the cells of LEVEL4.MAZ. Bytes after the end of the packed stream are unknown and not used.

monster_slots

The 30 monster slots of the level, copied verbatim; see MonsterRuntime. Record offset 0x4b0.

temporary_walls

The five temporary-wall slots. Record offset 0x834.

Type temporary_wall​

FieldTypeSize, repetition and constraints
blocku2—
ticks_remainingu4—

block

Block index of the temporary wall; 0 for a free slot.

ticks_remaining

Counter ticks left before the wall disappears, or 1 when it was already due when the record was made (free slots included).