CLI tool for building and validating WoW 3.3.5a client patch MPQ files
Project description
build-mpq
A lightweight wrapper around mpqcli for building and validating World of Warcraft 3.3.5a client patch MPQ files. This tool's main goal is to create canonical staging areas and package them with mpqcli while resolving symbolic links so the resulting MPQ contains the real file data and valid WoW directory paths. Tested on Linux-first โ other platforms may work but are less tested.
โ ๏ธ๐ค Warning: This project and parts of this README were created with AI assistance.
Main features:
- Create a skeleton structure to allow easily setting up a valid MPQ directory for development.
- Wrap
mpqclipackaging to allow symbolic links in the staging tree: symlinks are resolved during packaging sompqclicreates a valid MPQ containing the real file data.
Features
- โ Create staging areas with the canonical WoW 3.3.5a directory structure
- โ Package MPQ files from staging areas using mpqcli
- โ Validate MPQ structure to ensure client compatibility
- โ Type-safe with full type hints
- โ Well-tested with comprehensive test coverage
- โ Cross-platform using pathlib
Requirements
- Python 3.14+
- mpqcli - Must be available in PATH
Installation
# Clone or navigate to the project directory
cd build_mpq
# Install in development mode
pip install -e .
# Or install with dev dependencies for testing
pip install -e ".[dev]"
Usage
1. Create a Staging Area
Create the canonical WoW 3.3.5a directory structure:
build-mpq create ./my-patch-staging
This creates all 48 required directories for a complete patch.
Create only specific categories to avoid overwhelming directory structures:
# Create only Interface directories (27 dirs)
build-mpq create ./ui-patch --interface
# Create multiple categories (37 dirs)
build-mpq create ./custom-patch --dbc --interface --sound
# Create only DBC directory (1 dir)
build-mpq create ./dbc-patch --dbc
Available categories:
--dbc- DBC files (DBFilesClient/)--interface- UI, icons, addons (Interface/*)--fonts- Font files (Fonts/)--sound- Audio files (Sound/*)--textures- Environment textures (Textures/*)--models- Character, creature, item models--world- Map data (World/*)--cameras- Camera files
Note: Empty directories are automatically excluded during MPQ packaging, so there's no bloat concern.
Force recreation if it already exists:
build-mpq create ./my-patch-staging --force
2. Add Your Files
Place your custom files in the appropriate directories within the staging area.
Option A: Copy files (simple, but duplicates data):
# Copy files into staging area
cp my_spell_icon.blp ./my-patch-staging/Interface/Icons/
cp MyCustom.dbc ./my-patch-staging/DBFilesClient/
cp my_music.mp3 ./my-patch-staging/Sound/Music/
Option B: Use symbolic links (recommended for development):
# Link to your asset library (no duplication!)
ln -s ~/wow-assets/custom/icons/*.blp ./my-patch-staging/Interface/Icons/
ln -s ~/wow-assets/custom/Spell.dbc ./my-patch-staging/DBFilesClient/
ln -s ~/wow-assets/music/*.mp3 ./my-patch-staging/Sound/Music/
# Symlinks are automatically resolved during packaging
# The MPQ will contain the actual file data, not broken links
Benefits of symlinks:
- โ No file duplication - saves disk space
- โ Edit assets in place - changes reflected immediately
- โ Multiple staging areas can reference same assets
- โ Symlinks are resolved during packaging - MPQ contains real data
- โ Broken symlinks are detected and skipped with warnings
Note: By default packaging will dereference symlinks โ we copy symlink targets into a temporary staging tree and invoke mpqcli from that copy so the MPQ contains the expected relative file paths. If you prefer to keep symlinks intact, use --no-dereference to disable this behavior. Broken symlinks are reported (warning) and skipped.
3. Package the MPQ
Create an MPQ file from your staging area:
build-mpq package ./my-patch-staging ./patch-1.MPQ
With different compression:
# zlib compression (default, recommended)
build-mpq package ./my-patch-staging ./patch-1.MPQ -c z
# bzip2 compression (better compression, slower)
build-mpq package ./my-patch-staging ./patch-1.MPQ -c b
# No compression (faster, larger files)
build-mpq package ./my-patch-staging ./patch-1.MPQ -c n
4. Validate the MPQ
Check that all files in the MPQ are in valid WoW 3.3.5a directories:
build-mpq validate ./patch-1.MPQ
Verbose output (shows each file):
build-mpq validate ./patch-1.MPQ --verbose
Complete Workflow Examples
Example 1: Custom Spell Icons (UI Only)
# 1. Create staging area with only Interface directories
build-mpq create ./spell-icons-patch --interface
# 2. Add your custom icon
cp spell_custom_fireball.blp ./spell-icons-patch/Interface/Icons/
# 3. Package into MPQ (empty directories automatically excluded)
build-mpq package ./spell-icons-patch ./patch-icons-1.MPQ
# 4. Validate the structure
build-mpq validate ./patch-icons-1.MPQ
# 5. Deploy to your WoW client
cp ./patch-icons-1.MPQ /path/to/wow/Data/
Example 2: Full Custom Patch (All Categories)
# 1. Create full staging area
build-mpq create ./custom-patch
# 2. Add your custom files
cp spell_custom_fireball.blp ./custom-patch/Interface/Icons/
cp Spell.dbc ./custom-patch/DBFilesClient/
cp custom_music.mp3 ./custom-patch/Sound/Music/
# 3. Package into MPQ
build-mpq package ./custom-patch ./patch-custom-1.MPQ
# 4. Validate the structure
build-mpq validate ./patch-custom-1.MPQ
# 5. Deploy to your WoW client
cp ./patch-custom-1.MPQ /path/to/wow/Data/
Directory Structure
The tool creates the following canonical WoW 3.3.5a directory structure:
staging/
โโโ DBFilesClient/ # Database files (.dbc)
โโโ Interface/
โ โโโ AddOns/ # Custom AddOns
โ โโโ Buttons/ # Button textures
โ โโโ Icons/ # Spell/item icons
โ โโโ Glues/ # Login screen UI
โ โโโ ... # Many more UI directories
โโโ Fonts/ # Font files
โโโ Sound/
โ โโโ Music/ # Background music
โ โโโ Spells/ # Spell sound effects
โ โโโ Creature/ # Creature sounds
โ โโโ ... # More sound categories
โโโ Textures/
โ โโโ Minimap/ # Minimap textures
โโโ Character/ # Character models (.m2)
โโโ Creature/ # NPC models
โโโ Item/ # Item models
โโโ Spells/ # Spell effect models
โโโ World/
โ โโโ Maps/ # ADT, WDT, WMO files
โ โโโ wmo/ # World model objects
โโโ Cameras/ # Camera files
Why This Structure Matters
The WoW 3.3.5a client has hard-coded directory scanning. Files placed in incorrect locations will be silently ignored by the client. This tool ensures:
- โ All directories follow the exact structure the client expects
- โ Validation catches misplaced files before deployment
- โ No guesswork - the structure is canonical and complete
Development
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=build_mpq --cov-report=html
# Run specific test file
pytest tests/test_structure.py
Project Structure
build_mpq/
โโโ build_mpq/
โ โโโ __init__.py # Package initialization
โ โโโ cli.py # CLI entry point
โ โโโ operations.py # Core MPQ operations
โ โโโ structure.py # WoW directory definitions
โโโ tests/
โ โโโ test_cli.py # CLI tests
โ โโโ test_operations.py # Operations tests
โ โโโ test_structure.py # Structure validation tests
โโโ pyproject.toml # Project configuration
โโโ README.md # This file
Troubleshooting
"mpqcli not found in PATH"
Install mpqcli following the instructions in the Requirements section above.
"Validation failed: X file(s) in invalid locations"
Your MPQ contains files in directories that the WoW client won't read. Common issues:
- โ
CustomFolder/myfile.dbcโ โDBFilesClient/myfile.dbc - โ
Icons/spell.blpโ โInterface/Icons/spell.blp - โ
Music/song.mp3โ โSound/Music/song.mp3
Use build-mpq validate --verbose to see which files are problematic.
"Staging area already exists"
Use --force to recreate: build-mpq create ./staging --force
Broken Symbolic Links Warning
If you see warnings about broken symbolic links during packaging:
โ Warning: 2 broken symbolic link(s) detected:
- Interface/Icons/missing.blp -> ~/assets/missing.blp (target not found)
Cause: Symlink points to a file that doesn't exist or has been moved.
Solution:
- Check that the target file exists:
ls -l staging/Interface/Icons/missing.blp - Fix the symlink:
ln -sf ~/assets/correct.blp staging/Interface/Icons/missing.blp - Or remove broken links:
find staging -xtype l -delete
Broken symlinks are automatically skipped during packaging.
Contributing
Contributions are welcome! Please ensure:
- All tests pass:
pytest - Type hints are used throughout
- Code follows the existing style
- New features include tests
References
Made with โค๏ธ for the AzerothCore community
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file build_mpq-0.1.0.tar.gz.
File metadata
- Download URL: build_mpq-0.1.0.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c35b9a30494f88dfd8acbbb59ff4d5795da9ca079efca8c8fe7610eeb28576b0
|
|
| MD5 |
dbab935cb7114dec9609d576cbf0ed66
|
|
| BLAKE2b-256 |
93810cdda478c90a69b9d9ef4d1bfb379e84cff0c34e8e40f707534dea989593
|
File details
Details for the file build_mpq-0.1.0-py3-none-any.whl.
File metadata
- Download URL: build_mpq-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e75fd6267b1204705f460df8aa35a1802a877c67abd39d13fb12bf837c235db1
|
|
| MD5 |
05417558387ac940ddf8e3ce3931b68a
|
|
| BLAKE2b-256 |
9d47f5ae11bfecbfd194cad9e3e41d8676a60c61560b429a0450a50ed43d8500
|