dream_archive
Read, extract and write Bethesda's BSA and BA2 archives in pure Rust, from Morrowind to Starfield.
One type opens all three generations: Morrowind's BSA, the TES4 BSA of Oblivion through Skyrim
SE, and the BA2 of Fallout 4 and Starfield. The same calls list, look up, read, stream and extract
any of them, and a builder writes each family it reads. Archive paths stay bytes, because the
formats never say which code page their names are in; the crate converts only when you name one.
With the luau feature, it is also an l3i extension
providing the Luau module @dream/archive.
Documentation, including the full Rust and Luau API reference: https://dreamweave-mp.github.io/dream_archive/
Install
Rust 1.88. The default features read and write every family; parallel adds parallel
extraction, and luau the Luau module.
Formats
| Family | Games | Read and extract | Write |
|---|---|---|---|
| TES3 BSA | Morrowind | yes | yes |
| TES4 BSA, versions 103 to 105 | Oblivion to Skyrim SE | yes, including hash-only archives | yes |
| BA2 GNRL | Fallout 4, Fallout 76, Starfield | yes | yes |
| BA2 DX10 | Fallout 4, Fallout 76, Starfield | yes, as DDS files | from DDS files or texture metadata |
| BA2 GNMF | console textures | metadata only | no |
Console layouts and XMem compression are refused with an error.
Usage
use Archive;
use Tes3BsaBuilder;
local dreamArchive = require("@dream/archive")
local archive = dreamArchive.openPath("Morrowind.bsa")
local entry = archive:get("textures/tx_wood.dds")
print(entry.size, entry.hashHex)
For a command line, see dream_archivetool, which is built on this crate.
Where to read next
- Start here: open, read, extract, build
- Formats: versions, names, hashes, compression, and what is refused
- Archive paths and hashes: lookups, legacy code pages, and hash-only archives
- Building archives and BA2 textures
- Embedding Luau: l3i setup, and
moving from the 0.2
mluabinding - Rust API and Luau API
- Changelog
Development
The luau feature needs l3i's toolchain, clang, lld and cross-language thin LTO, which
.cargo/config.toml sets; the test-only luau-analysis feature adds l3i's analysis frontend for
the typed tests, so cargo test --features luau builds without it. The site in content/ is a
DreamWeave Mod Template site; preview
it with zola serve.
License
GPL-3.0-only.
Support
Has dream_archive been useful to you? Consider amplifying the signal through ko-fi.