Skip to main content

DCR field reference

File page · Format catalogue · Schema source

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

Description​

A DCR file describes extra pieces of graphics layered onto a monster's image. It holds a count of decoration groups; each group has six entries, one per shape position indexed by the loader. An entry selects a rectangle of the associated monster image and gives its offset from the monster's drawing position. The file contains descriptors, not pixels. The in-memory form is MonsterDecorationRuntime. See the format overview.

The game builds the DCR file name from the monster image name and reads count × 36 bytes. It visits six six-byte entries per group and skips those with a zero width or height. The first four bytes are passed to the shape encoder of the display driver and the last two are stored with its result. The renderer reads those two bytes as signed offsets and applies them to the monster's drawing position.

Cutting: the display driver reads the current 320-byte-wide image page from offset 8 × x + 320 × y, 8 × width pixels per row for height rows, with no clipping (16-bit offsets: a rectangle past column 39 continues on the next row; past row 199 it reads memory after the page, wrapping at 65,536). It keeps up to 16 colours in order of first appearance; later colours take the first one's index. The VGA and EGA drivers cut the same pixels; only their private pixel coding differs. All 126 nonzero entries of the nine original files fit inside 320 × 200 (largest x + width 34, y + height 194).

Selection: an INF sublevel record's monster graphics slot loads NAME.dcr with the image NAME when its decoration flag is set. Group g, entry s (from 0) goes to decoration entry 18 × slot + 6g + s of a 36-entry table. The monster drawing code draws, for each of the three decoration selectors v of the monster type (INF monster_type_entry decoration_indices; 0 = none), entry 18 × slot + 6(v − 1) + f − 1, where f (1–6) is the monster's frame and slot its graphics_index (0 or nonzero). So group v − 1 is selected by selector value v and entry s belongs to frame s + 1. Neither the group count nor the selector is checked. The original files contain one, two or three groups; see monster images.

File structure​

FieldTypeSize, repetition and constraints
num_groupsu2—
groupsdecoration_grouprepeated num_groups times
trailing_unknownbytes to end of stream—

num_groups

Number of six-entry decoration groups that follow.

groups

Groups of six descriptors, in file order.

trailing_unknown

Trailing bytes, unknown; none in the nine original files.

Type decoration_group​

The loader reads exactly six six-byte descriptors per group and skips those with a zero dimension. Group g is drawn for monster types whose decoration selector is g + 1 (counting groups from 0).

FieldTypeSize, repetition and constraints
shapesdecoration_shaperepeated 6 times

shapes

Six shape descriptors, entry s for monster frame s + 1: front, two side frames, back, two attack frames (frame meanings as in drawing the dungeon view).

Type decoration_shape​

FieldTypeSize, repetition and constraints
source_x_unitsu1—
source_yu1—
width_unitsu1—
heightu1—
offset_xs1—
offset_ys1—

source_x_units

Horizontal source coordinate, in units of eight pixels.

source_y

Vertical source coordinate, in pixels.

width_units

Rectangle width in units of eight pixels; zero makes the loader skip the entry.

height

Rectangle height in pixels; zero makes the loader skip the entry.

offset_x

Signed horizontal offset from the monster's drawing position, mirrored for a flipped shape.

offset_y

Signed vertical offset from the monster's drawing position.