Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Database Formats

Database formats store game data in structured, tabular formats.

Supported Formats

DBC Format

DataBase Client - Client-side database files containing game data.

  • Fixed-size records
  • String block for text data
  • Indexed by ID
  • Localization support

DBC Structure

DBCs are binary tabular files with a header:

Header (20 bytes)
Records (n × record_size)
String Block (variable)

Common DBC Files

Core Game Data

  • Item.dbc - Item definitions
  • Spell.dbc - Spell data
  • CreatureDisplayInfo.dbc - Creature models
  • Map.dbc - Map definitions

Display Data

  • ItemDisplayInfo.dbc - Item visuals
  • CharSections.dbc - Character customization
  • CreatureModelData.dbc - Model parameters

Game Mechanics

  • Talent.dbc - Talent trees
  • SkillLine.dbc - Skills and professions
  • Achievement.dbc - Achievement data

Usage Patterns

Reading DBC Files

#![allow(unused)]
fn main() {
use wow_cdbc::DbcParser;
use std::io::BufReader;
use std::fs::File;

let file = File::open("DBFilesClient/Item.dbc")?;
let mut reader = BufReader::new(file);
let parser = DbcParser::parse(&mut reader)?;

let header = parser.header();
println!("Records: {}", header.record_count);
println!("Fields per record: {}", header.field_count);
}

Schema-Based Parsing

#![allow(unused)]
fn main() {
use wow_cdbc::{DbcParser, Schema, SchemaField, FieldType};

let parser = DbcParser::parse(&mut reader)?;

// Define a schema for the DBC file
let mut schema = Schema::new("SpellItemEnchantment");
schema.add_field(SchemaField::new("ID", FieldType::UInt32));
schema.add_field(SchemaField::new("Charges", FieldType::UInt32));
schema.add_field(SchemaField::new("Description", FieldType::String));
schema.set_key_field("ID");

// Apply the schema and parse records
let parser = parser.with_schema(schema)?;
let record_set = parser.parse_records()?;

for record in record_set.iter() {
    println!("{:?}", record);
}
}

Localization

WoW supports 16 locales in DBC files:

IDLocaleDescription
0enUSEnglish (US)
1koKRKorean
2frFRFrench
3deDEGerman
4zhCNChinese (Simplified)
5zhTWChinese (Traditional)
6esESSpanish (Spain)
7esMXSpanish (Mexico)
8ruRURussian

Tools

The CLI provides DBC operations:

warcraft-rs dbc info Item.dbc
warcraft-rs dbc export Item.dbc --format csv

See Also