Tes2Mod: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)
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
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: 



Temple Logic

If the BlockIndex specifies either of the two Temple strings above, then the record name is decoded via special case logic.  

Temple Letters
If 0x07 is less-than the BlockCharacter value, then the Letters will be "GA"; otherwise they will be "AA".

Temple Numbers

To compute the Number portion for the RMB record's name, logically and the BlockCharacter value with 0x07 and consult the following indexes table: 



Default Logic

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  .  Set this equal to the BlockCharacter value divided by 16, dropping all fractions.  Ex: if the BlockCharacter value is 32,   will have a value of 2.  Ex: if the BlockCharacter is 17, then   will have a value of 1.  

Decoding Wayrest Letters
When decoding a "CUST" record, set   to 0; otherwise if   is positive (greater-than 0) then decrement  .  

Decoding Sentinel Letters
When decoding a "CUST" record, set   to 8.  

Decoding Default Letters
When decoding a "CUST" record for any region other than Wayrest or Sentinel, set   to 0.  

Using Q
Now that we have established a value for  , we determine the Letters portion of the RMB record's string name by consulting the following table: 



Reconciling Missing Records

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)
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: 



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.