Extracted Data File Types - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki

Extracted data folders and file types

A named resource file contains bytes taken from the original game binary. Most resources do not contain a header, filename, dimensions, or other self-description. Their folder and faux-extension help describe what the bytes mean.

The faux-extension is documentation rather than a new file format: renaming a file does not change its contents.

Folders

Folder Purpose
data/ General game tables which are not graphical resources, maps, or sound.
gfx/ General graphics and their companion tables: walls, floor and ceiling artwork, interface pieces, doors, objects, avatars, and similar resources.
gfx-data/ Shared graphics-renderer and viewport tables used by several resource types. They describe how pictures are selected and placed, rather than containing the artwork itself.
monsters/ Graphics and companion data belonging to a particular large monster: graphic blocks, component layout, picture offsets, colour grades, and palettes.
maps/ Tower maps and their switches, triggers, objects, monsters, entrances, and related data.
sfx/ Sound data.

Object and floor-rendering resources

The game has one four-byte definition per object. The table named data/objectdefinitions.block contains entries $00-$6D, including the empty-pocket record at $00. The fields are described under Object Definitions.

The floor-object renderer uses several small parallel tables. The projection tables describe how a map view cell and one of its four mini-spaces become one of the five visible distances. ObjectsOnFloor_ViewY.positions, ObjectsOnFloor_XPositions.positions, and ObjectsOnFloor_YAdjustments.positions provide the source screen anchors and shape-specific adjustments. ObjectsOnFloor_SubpositionRotation.lookup, ObjectsOnFloor_SubpositionDepthBias.lookup, ObjectsOnFloor_ViewCellDepthBase.lookup, and ObjectsOnFloor_ProjectionGroups.lookup provide the selection logic.

These tables are renderer data rather than a second object-definition list. The graphic bytes remain in gfx/ObjectsOnFloor.gfx, with offsets and heights in their companion resources. The game selects among five distance views and applies the Y adjustments when drawing objects on the floor.

Graphics-related faux-extensions

Extension Meaning
.gfx Raw Atari ST four-plane graphical data as stored by the game. It contains no dimensions or picture directory of its own.
.offsets Big-endian word offsets locating individual pictures inside an associated .gfx block. This is the table that divides or selects pictures in sequential graphic data.
.positions Signed screen X positions, Y positions, or packed X/Y pairs used when drawing a picture or component.
.heights Stored picture heights used by the strip renderer. In several routines zero represents one drawn line because the value is used as a loop count.
.layout A packed, resource-specific mixture of component dimensions, positions, graphic bases, spacing, or mirroring rules which cannot be separated cleanly without changing the original layout. This replaces the ambiguous .renderdata name.
.lookup A value-remapping or selection table, such as view distance to graphic size or facing direction to a graphic variant. Unlike .offsets, its values are not necessarily byte positions in a .gfx file. Editable gameplay statistics use .stats instead.
.flags Bit or word values which enable rendering behaviour such as animation or mirroring.
.colours A monster's ordered selections from the master monster palette, used for colour grades.
.palette Palette entries or groups of palette indices.

Other common faux-extensions

Extension Meaning
.stats Editable gameplay statistics indexed by an object, champion, or another game entity. Examples include weapon combat modifiers, shield armour bonuses, and bow power adjustments.
.font Raw game-font data.
.sound Extracted sound sample data.
.block A fixed-size binary structure which has not yet been given a narrower file type.
.locations Encoded map or game locations.
.map One tower's packed map data.
.switches, .triggers, .obj, .monsters The corresponding fixed-capacity tower data block.

Addresses within a resource

Giving a block a name does not change its position in the source. A smaller table inside it can be named as an offset from the start of that block. For example, two of the dungeon view tables begin at these offsets:

Dungeon_ViewCell_OcclusionMasks:
        equ Dungeon_ViewCell_RelativeCoordinates+$98

Dungeon_ViewCell_VisibleFaceMasks:
        equ Dungeon_ViewCell_RelativeCoordinates+$E4

These names refer to the same bytes whether the tables are stored together or in separate files. A label cannot be placed physically inside an INCBIN; a base label plus an offset preserves that interior address.

Odd-length resources and Devpac

Devpac's INCBIN alignment matters when reproducing the original executable: an odd-length included file receives a padding byte. That byte is not part of the original table. Even-length resources can be included directly; odd-length tables can instead be represented by dc.b declarations containing their exact bytes.

For example, Monster_SubPosition_DepthAdjustments.positions has five bytes and Monster_ViewCell_DepthSlots.lookup has 19. Including both directly added two unwanted zero bytes; using their exact bytes as dc.b data preserved the original SPS 439 executable.

See also: