Daggerfall:BSA file formats
The UESPWiki – Your source for The Elder Scrolls since 1995
This is a description of the format of the various .BSA files found in the ARENA2 directory of Elder Scrolls: Daggerfall by Bethesda. The information here is not complete or 100% percent accurate, although the basic formats appears to be well understood.
Contents |
[edit] Contributors
Significant contributors to these formats include:
- Michael (subproperty@hotmail.com)
- Dungeon Pre/Postrecords
- Location types
- BLOCKS.BSA RDB format
[edit] General BSA Files
There are five BSA files in Daggerfall's ARENA2 directory (ARCH3D, MAPS, MONSTER, MIDI, and BLOCKS). Although they contain different data, their overall structure is the same. This format has been derived from all these five files. The following description appears to be complete.
[edit] General File Layout
- BSA Header
- ...BSA Records...
- BSA Directory
[edit] BSA Header
This is the first 4 bytes found at the start of a BSA file and gives information about the BSA directory at the end of the file.
[Bytes 0-1] short DirectoryCount;
Gives the number of entries in the directory at the end of the
file.
[Bytes 2-3] short DirectoryType;
Gives the type of directory at the end of the BSA file (See
BSA Directory below).
0x0100 = Directory has records of 18 bytes in size
consisting of a 14 byte filename and a long
record length.
0x0200 = Directory has records of 8 bytes in size
consisting of long ID and a long record size.
[edit] BSA Records
This data will depend on the actual BSA file. The basic contents for the five known BSA files are as follows:
- ARCH3D
- 3D Object Information
- BLOCKS
- Dungeon/town block information
- MAPS
- Location information (towns, dungeon, houses, temples, etc...)
- MONSTER
- Monster data (no images)
- MIDI
- HMI formatted music
[edit] BSA Directory
The directory contains the information needed to access the various data records in the BSA file. The contents of each record depends on the BSA file. In general, the directory gives an identification number/string and a record length for each record. There are two known types of directories identified by the DirectoryType bytes in the BSA header (0x0100 and 0x0200).
[edit] BSA 0x0100 Directory (Name)
The 0x0100 type directory consists of records 18 bytes in size and give a record size and 13 byte name for each BSA record.
[Bytes 0-13] char FileName[14];
The filename which identifies this data section. Filenames
are in the usual DOS 8.3 format.
[Bytes 14-17] long DataSize;
The size of the data in bytes. The first record starts at
offset 4 in the file, ignoring the 4 bytes of the BSA Header.
The subsequent section offsets can be calculated from this.
[edit] BSA 0x0200 Directory (Number)
The 0x0200 type directory consists of records 8 bytes in size and give a record size and long identifier for each BSA record.
[Bytes 0-3] long RecordID;
A long number which assumbly identifies the record somehow.
[Bytes 4-7] long DataSize;
The size of the data in bytes. The first entry starts at
offset 4 in the file, ignoring the 4 bytes of the BSA Header.
The subsequent section offsets can be calculated from this.
[edit] Files using the BSA format
[edit] MAPS.BSA
Main article: Daggerfall:MAPS.BSA
See also:
[edit] ARCH3D.BSA
Main article: Daggerfall:ARCH3D.BSA
[edit] BLOCKS.BSA
Main article: Daggerfall:BLOCKS.BSA
See also:
- Appendix C (to be added)
[edit] MIDI.BSA
Contains MIDI data stored in the proprietary HMI format in a type 0x0100 directory.
[edit] MONSTER.BSA
Contains ASCR####.ANC and ENEMY###.CFG files in a type 0x0100 directory.
[edit] DAGGER.SND
Contains raw audio data (8-bit unsigned, mono, ~11025 samples per second) in a type 0x0200 directory.
[edit] MAPSAVE.SAV
Contains MAPSAVE.0## files for each region in a type 0x0100 directory.

![[Content is available under Attribution-ShareAlike]](http://www.uesp.net/w/images/Somerights.png)