Daggerfall Mod:Block Record Indexes
Records within MAPS.BSA reference records from within BLOCKS.BSA. Both RMB and RDB records are referenced from within MAPS.BSA.
Location Exterior Data Record (MapPItem)[edit]
These types of records will refer to RMB records within BLOCKS.BSA. The string name of RMB records are composed of a Prefix, a set of Letters, and then a set of Numbers. The MapPItem record element's BlockIndex, BlockNumber, and BlockCharacter are used to construct these three parts, and then they are simply concatenated together to derive the name of the RMB record to use. First the Prefix is computed. If the reference is to a temple then temple logic is invoked; otherwise default logic is invoked
Prefix[edit]
The first step is building the first part of the BLOCKS.BSA record's string name via the BlockIndex element value. This value is an index to the following array:
Index | String prefeix | Description |
---|---|---|
0 | "TVRN" | Tavern |
1 | "GENR" | General Store |
2 | "RESI" | Residence |
3 | "WEAP" | Weaponsmith |
4 | "ARMR" | Armorer |
5 | "ALCH" | Alchemist |
6 | "BANK" | Bank |
7 | "BOOK" | Bookseller |
8 | "CLOT" | Clothier |
9 | "FURN" | Furniture Store |
10 | "GEMS" | Jeweler |
11 | "LIBR" | Library |
12 | "PAWN" | Pawn Broker |
13 | "TEMP" | Temple |
14 | "TEMP" | Temple |
15 | "PALA" | Palace |
16 | "FARM" | Farm |
17 | "DUNG" | Dungeon |
18 | "CAST" | Castle |
19 | "MANR" | Manor |
20 | "SHRI" | Shrine |
21 | "RUIN" | Ruins |
22 | "SHCK" | Shack |
23 | "GRVE" | Cemetery |
24 | "FILL" | Filler |
25 | "KRAV" | Order of The Raven |
26 | "KDRA" | Knights of The Dragon |
27 | "KOWL" | Knights of The Owl |
28 | "KMOO" | Knights of The Moon (unused) |
29 | "KCAN" | Order of The Candle |
30 | "KFLA" | Knights of The Flame |
31 | "KHOR" | Host of The Horn |
32 | "KROS" | Knights of The Rose |
33 | "KWHE" | Knights of The Wheel |
34 | "KSCA" | Order of The Scarab |
35 | "KHAW" | Knights of The Hawk |
36 | "MAGE" | Mages Guild |
37 | "THIE" | Thieves Guild |
38 | "DARK" | Dark Brotherhood |
39 | "FIGH" | Fighters Guild |
40 | "CUST" | Custom |
41 | "WALL" | Wall |
42 | "MARK" | Market |
43 | "SHIP" | Ship |
44 | "WITC" | Coven |
Temple Logic[edit]
If the BlockIndex specifies either of the two Temple strings above, then the record name is decoded via special case logic.
Temple Letters[edit]
If 0x07 is less-than the BlockCharacter value, then the Letters will be "GA"; otherwise they will be "AA".
Temple Numbers[edit]
To compute the Number portion for the RMB record's name, logically and the BlockCharacter value with 0x07 and consult the following indexes table:
0 | "A0" |
---|---|
1 | "B0" |
2 | "C0" |
3 | "D0" |
4 | "E0" |
5 | "F0" |
6 | "G0" |
7 | "H0" |
Default Logic[edit]
The default logic is, unfortunately, plagued by three special cases. The first special case is the aforedescribed Temple Logic. The second two are decoding any non-temple record for Wayrest or Sentinel. Fortunately the Numbers portion for the RMB record's string name is strictly uniform. Simply use the decimal ASCII representation of the BlockNumber value. Ex: BlockNumber value 0xa0 would be "10".
To decode the Letters portion we must first create a new index variable, call it Q. Set this equal to the BlockCharacter value divided by 16, dropping all fractions. Ex: if the BlockCharacter value is 32, Q will have a value of 2. Ex: if the BlockCharacter is 17, then Q will have a value of 1.
Decoding Wayrest Letters[edit]
When decoding a "CUST" record, set Q to 0; otherwise if Q is positive (greater-than 0) then decrement Q.
Decoding Sentinel Letters[edit]
When decoding a "CUST" record, set Q to 8.
Decoding Default Letters[edit]
When decoding a "CUST" record for any region other than Wayrest or Sentinel, set Q to 0.
Using Q[edit]
Now that we have established a value for Q, we determine the Letters portion of the RMB record's string name by consulting the following table:
0 | "AA" |
---|---|
1 | "BA" |
2 | "AL" |
3 | "BL" |
4 | "AM" |
5 | "BM" |
6 | "AS" |
7 | "BS" |
8 | "GA" |
9 | "GL" |
10 | "GM" |
11 | "GS" |
Reconciling Missing Records[edit]
Some references may refer to an RMB record which does not exist within the BLOCKS.BSA file. If an exact match is not found via the above algorithm, Daggerfall will create a list of RMB record names which start with the Prefix (above) and ends with the Number (above). The list is then sorted alphabetically and the first element of this sorted list is returned.
Dungeon Interior Data Record (MapDItem)[edit]
These records will refer to RDB records within the BLOCKS.BSA file. These string names are fairly trivial to decode.
The BlockIndex field's value is actually an index into a character array at offset 001B:3E44 of Fall.exe, table below:
0 | "N" |
---|---|
1 | "W" |
2 | "L" |
3 | "S" |
4 | "B" |
5 | "M" |
To determine the RDB record's string name, concatenate the seven-digit ASCII string representation of the BlockNumber field to the letter implied by the BlockIndex value. Ex: BlockIndex of 0 and BlockNumber of 0x13 implies "N0000019.RDB"
There are no RDB files that begin with "L" and there are no Dungeon Blocks that refer to L via a BlockIndex value of 2.