FOR MODDERS AND HACKERS

Map files and locations

These rules describe how the MS-DOS release stores its maps: the two 256 x 256 worlds, the settlement floor files, the location numbers that tie them together, entrance coordinates, and four fixed scene maps. Tile values are logical tile indexes (TILE-0001). Map contents remain user-supplied data and are not reproduced here.

World maps and chunk index

MAP-0001Original: EstablishedRedux: Matches

BRIT.DAT (Britannia) and UNDER.DAT (the Underworld) each describe a 256 x 256 grid with one logical tile byte per position. The grid is divided into 256 chunks of 16 x 16 tiles. Chunks are numbered row by row across the world, and tiles row by row within a chunk:

chunk = (y >> 4) * 16 + (x >> 4)
tile  = (y & 15) * 16 + (x & 15)

UNDER.DAT stores all 256 chunks in chunk order: 65,536 bytes. BRIT.DAT omits the 51 chunks that are entirely deep water and stores the other 205 in ascending chunk order: 52,480 bytes. A 256-byte chunk index gives, for each chunk number, the chunk's record in BRIT.DAT, or FF hex for an omitted chunk. The loader fills an omitted chunk with Deep Water, tile 1. The index is compiled into the program and also stored in DATA.OVL at 3886 hex (OVL-0002). Its present entries ascend from 0 to 204, so reading the present chunks in order is equivalent to following the index.

Both worlds wrap at their edges. Closed dungeon entrances and destroyed shrines are substituted while chunks load; neither file stores those states.

Redux reads the index from DATA.OVL, fills omitted chunks with tile 1, and reads BRIT.DAT in chunk order. This match covers file decoding; the runtime substitutions belong to the dungeon and shrine rules.

Settlement floor files

MAP-0002Original: EstablishedRedux: Matches

TOWNE.DAT, DWELLING.DAT, CASTLE.DAT, and KEEP.DAT are each 16,384 bytes: sixteen floor records of 1,024 bytes. A floor is a 32 x 32 grid of logical tile bytes, stored row by row. Location numbers 1-32 select the file in groups of eight (MAP-0003).

A 32-entry table gives the record of each location's ground floor (level 0). The record loaded is that entry plus the signed level, so a basement (level -1) is the record before the ground floor and upper floors follow it. Floor counts are not stored; they follow from the gap to the next location's entry. The table is compiled into the program and also stored in DATA.OVL at 1E2A hex.

LocationsFileGround-floor recordsFloors
1-8: Moonglow, Britain, Jhelom, Yew, Minoc, Trinsic, Skara Brae, New MaginciaTOWNE.DAT0, 2, 4, 7, 8, 10, 12, 14Two each. Yew has a basement and a ground floor; the others have a ground and a first floor.
9-12: Fogsbane, Stormcrow, Greyhaven, WaveguideDWELLING.DAT0, 3, 6, 9Three each
13-16: Iolo's Hut, Sutek's Hut, Sin Vraal's Hut, Grendel's HutDWELLING.DAT12, 13, 14, 15One each
17-18: Lord British's Castle, Palace of BlackthornCASTLE.DAT1, 6Five each: a basement and ground to third floors
19-24: West Britanny, North Britanny, East Britanny, Paws, Cove, Buccaneer's DenCASTLE.DAT10, 11, 12, 13, 14, 15One each
25-26: Ararat, BordermarchKEEP.DAT0, 2Two each
27-29: Farthing, Windemere, StonegateKEEP.DAT4, 5, 6One each
30-31: The Lycaeum, Empath AbbeyKEEP.DAT7, 10Three each
32: Serpent's HoldKEEP.DAT14Three: a basement, a ground and a first floor

The ordinary entry path places the party on level 0 at (15,30). Stairs and ladders change the level by one.

Redux builds its floor tables from the same records.

Location numbers

MAP-0003Original: EstablishedRedux: Matches

The program identifies every map by a location number:

NumberLocationsStored in
0Britannia at level 0, or the Underworld at level FFBRIT.DAT, UNDER.DAT
1-8Moonglow, Britain, Jhelom, Yew, Minoc, Trinsic, Skara Brae, New MaginciaTOWNE.DAT
9-16Fogsbane, Stormcrow, Greyhaven, Waveguide, Iolo's Hut, Sutek's Hut, Sin Vraal's Hut, Grendel's HutDWELLING.DAT
17-24Lord British's Castle, Palace of Blackthorn, West Britanny, North Britanny, East Britanny, Paws, Cove, Buccaneer's DenCASTLE.DAT
25-32Ararat, Bordermarch, Farthing, Windemere, Stonegate, The Lycaeum, Empath Abbey, Serpent's HoldKEEP.DAT
33-40Deceit, Despise, Destard, Wrong, Covetous, Shame, Hythloth, DoomDUNGEON.DAT, record = number - 33
FFCombat and other special screensnone

Saved state uses the same numbers, for example the party's current map (SAVE-0004) and a companion's inn (SAVE-0002). The values 41 and 42 hex appear while Return to the View runs; their full meaning is not established.

Redux uses the same numbers for 0-40. It reserves further values for its own modes, such as camping, combat, and the finale; those are Redux identifiers, not original data.

World entrances

MAP-0004Original: EstablishedRedux: Matches

Two 40-byte tables give the world X and Y of every entrance, indexed by location number minus one: entries 0-31 are settlements and 32-39 are dungeons. They are compiled into the program and also stored in DATA.OVL at 1E9A hex (X) and 1EC2 hex (Y). Entering matches the party's coordinates against the tables; the tile at each coordinate is the visible entrance. Leaving places the party back at the same coordinate. For a dungeon, the floor it is left by picks the world: the top floor returns to Britannia and the bottom floor to the Underworld (DNG-0003).

NumberLocationX,YNumberLocationX,Y
1Moonglow232,13517Lord British's Castle86,107
2Britain81,10618Palace of Blackthorn196,245
3Jhelom36,22219West Britanny84,106
4Yew58,4320North Britanny86,105
5Minoc159,2021East Britanny88,106
6Trinsic106,18422Paws98,145
7Skara Brae22,12823Cove136,90
8New Magincia187,16924Buccaneer's Den136,158
9Fogsbane88,12025Ararat49,58
10Stormcrow152,2426Bordermarch15,160
11Greyhaven104,21627Farthing64,240
12Waveguide216,12028Windemere248,8
13Iolo's Hut45,6229Stonegate148,74
14Sutek's Hut176,20830The Lycaeum218,107
15Sin Vraal's Hut201,5931Empath Abbey28,50
16Grendel's Hut153,9132Serpent's Hold146,241

Dungeon entrances are listed with their Words of Power in WORD-0001; entries 32-39 agree with it.

Ararat is the only settlement whose entrance is in the Underworld. Doom's entrance exists only in the Underworld. Each of the other seven dungeons has an entrance at the same coordinate in both worlds.

Redux reads both tables from DATA.OVL.

Fixed scene maps

MAP-0005Original: EstablishedRedux: Unverified

The first 704 bytes of MISCMAPS.DAT hold four fixed scenes of 176 bytes each, ahead of the Return to the View data in INTRO-0004. Each record is 11 rows of 16 bytes. The first 11 bytes of a row are logical tiles and the last five are zero, giving an 11 x 11 scene.

OffsetScene
0Blackthorn's interrogation chamber
176A shrine interior
352The Codex chamber
528The endgame room

Each scene is shown through the combat-screen path, location FF. How Redux presents these scenes has not been compared with this layout.