-
Notifications
You must be signed in to change notification settings - Fork 0
Radoub Formats BIF
BIF files are binary archives containing game resources.
BIF (Binary Interleaved File) archives store the actual resource data indexed by KEY files. They contain two types of resources: variable-size resources (most common) and fixed-size resources (used for tiles).
Common Files: nwn_base.bif, xp1.bif, textures01.bif
| Offset | Size | Type | Description |
|---|---|---|---|
| 0 | 4 | char[4] | FileType ("BIFF") |
| 4 | 4 | char[4] | Version ("V1 ") |
| 8 | 4 | uint32 | VariableResourceCount |
| 12 | 4 | uint32 | FixedResourceCount |
| 16 | 4 | uint32 | VariableTableOffset |
Fixed table follows variable table.
| Offset | Size | Type | Description |
|---|---|---|---|
| 0 | 4 | uint32 | Id (matches ResId from KEY) |
| 4 | 4 | uint32 | Offset (to resource data) |
| 8 | 4 | uint32 | FileSize |
| 12 | 4 | uint32 | ResourceType |
| Offset | Size | Type | Description |
|---|---|---|---|
| 0 | 4 | uint32 | Id |
| 4 | 4 | uint32 | Offset |
| 8 | 4 | uint32 | PartCount |
| 12 | 4 | uint32 | PartSize |
| 16 | 4 | uint32 | ResourceType |
Total size = PartCount * PartSize
flowchart TB
Start[Extract Resource] --> GetIndex[Get variable table index from KEY]
GetIndex --> ReadEntry[Read variable resource entry]
ReadEntry --> SeekOffset[Seek to Offset in BIF]
SeekOffset --> ReadData[Read FileSize bytes]
ReadData --> Return[Return resource data]
using Radoub.Formats.Bif;
// Read BIF file (keeps buffer for extraction)
var bif = BifReader.Read(@"data\nwn_base.bif", keepBuffer: true);
Console.WriteLine($"Variable resources: {bif.VariableResources.Count}");
Console.WriteLine($"Fixed resources: {bif.FixedResources.Count}");
// Extract resource by index
byte[]? data = bif.ExtractVariableResource(123);
// Or by resource object
var resource = bif.GetVariableResource(123);
if (resource != null)
{
data = bif.ExtractVariableResource(resource);
}using Radoub.Formats.Key;
using Radoub.Formats.Bif;
var key = KeyReader.Read("nwn_base.key");
var entry = key.FindResource("mydialog", ResourceTypes.Dlg);
if (entry != null)
{
var bifEntry = key.GetBifForResource(entry);
var bif = BifReader.Read(bifEntry.Filename);
byte[]? data = bif.ExtractVariableResource(entry.VariableTableIndex);
}// Don't keep buffer if only reading metadata
var bif = BifReader.Read("large.bif", keepBuffer: false);
// bif.ExtractVariableResource() will return null
// Keep buffer for extraction (default)
var bif = BifReader.Read("data.bif", keepBuffer: true);
// bif.ExtractVariableResource() worksThe variable resource Id contains:
- Top 12 bits: BIF index (must match KEY)
- Bottom 20 bits: Index within this BIF's variable table
int variableTableIndex = (int)(id & 0xFFFFF);BIF files can be hundreds of MB. The keepBuffer parameter controls whether the entire file is kept in memory:
-
true(default): Keep buffer for fast extraction -
false: Release after parsing metadata
For very large BIFs, consider using GameResourceResolver which handles caching automatically.
Fixed resources are primarily used for tileset data. Most tools only need variable resources.
Page freshness: 2025-12-15
Getting Started
User Guide
Features
Help
- Manifest - Journal Editor
- Quartermaster - Creature/Inventory Editor (Coming Spring 2026)
- Fence - Merchant/Store Editor
- Trebuchet - Radoub Launcher
- Spell Check - Dictionary-based spell checking
- Token System - Dialog tokens and custom colors
Parley Internals
Manifest Internals
Quartermaster Internals
Fence Internals
Trebuchet Internals
Radoub.UI
Library
Low-Level Formats
High-Level Parsers
- JRL Format (.jrl)
- UTI Format (.uti) - Item blueprints
- UTC Format (.utc) - Creature blueprints
- UTM Format (.utm) - Store blueprints
- BIC Format (.bic) - Player characters
Original BioWare Aurora Engine file format specifications.
Core Formats
- GFF Format - Generic File Format
- KEY/BIF Format - Resource archives
- ERF Format - Encapsulated resources
- TLK Format - Talk tables
- 2DA Format - Data tables
- Localized Strings
- Common GFF Structs
Object Blueprints
- Creature Format (.utc)
- Item Format (.uti)
- Store Format (.utm)
- Door/Placeable (.utd/.utp)
- Encounter Format (.ute)
- Sound Object (.uts)
- Trigger Format (.utt)
- Waypoint Format (.utw)
Module/Area Files
- Conversation Format (.dlg)
- Journal Format (.jrl)
- Area File Format (.are/.git/.gic)
- Module Info (.ifo)
- Faction Format (.fac)
- Palette/ITP Format (.itp)
- SSF Format - Sound sets
Reference