| Crates.io | wow-wdl |
| lib.rs | wow-wdl |
| version | 0.3.2 |
| created_at | 2025-06-14 01:36:11.001343+00 |
| updated_at | 2025-08-29 03:58:57.050622+00 |
| description | Parser for World of Warcraft WDL (World Detail Level) low-resolution terrain files |
| homepage | https://github.com/wowemulation-dev/warcraft-rs |
| repository | https://github.com/wowemulation-dev/warcraft-rs |
| max_upload_size | |
| id | 1712020 |
| size | 129,833 |
Parser for World of Warcraft WDL (World Detail Level) files - low-resolution terrain data for continents.
✅ Production Ready - Complete WDL parser with support for all WoW versions
WDL files contain low-resolution heightmap data for entire WoW continents. They provide:
These files enable:
Add to your Cargo.toml:
[dependencies]
wow-wdl = "0.3.0"
Or use cargo add:
cargo add wow-wdl
use wow_wdl::parser::WdlParser;
use std::fs::File;
use std::io::BufReader;
# fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load a WDL file
let file = File::open("World/Maps/Azeroth/Azeroth.wdl")?;
let mut reader = BufReader::new(file);
// Parse the file
let parser = WdlParser::new();
let wdl = parser.parse(&mut reader)?;
// Access heightmap data
if let Some(tile) = wdl.heightmap_tiles.get(&(32, 48)) {
println!("Tile (32,48) has {} height values", tile.outer_values.len());
}
// Check for holes
if let Some(holes) = wdl.holes_data.get(&(32, 48)) {
if holes.has_hole(8, 8) {
println!("Chunk (8,8) has a hole!");
}
}
# Ok(())
# }
WDL files use a chunk-based structure:
| Chunk | Description | Required |
|---|---|---|
| MVER | Version number | ✅ |
| MAOF | Map area offset table (64x64 grid) | ✅ |
| MARE | Map area heightmap data (545 heights per tile) | ✅ |
| MAHO | Map area hole bitmasks | ❌ |
| MWMO | WMO filename list | ❌ |
| MWID | WMO filename offsets | ❌ |
| MODF | WMO placement data | ❌ |
| ML* | Legion+ model chunks | ❌ |
Height interpolation features are planned for future implementation:
These features will be available in a future version:
let height = wdl.get_height_at(1234.5, 5678.9)?;
let (dx, dy) = wdl.get_height_gradient(1234.5, 5678.9)?;
# use wow_wdl::types::WdlFile;
# let mut wdl = WdlFile::new();
# let tile_x = 32u32;
# let tile_y = 48u32;
# let chunk_x = 8;
# let chunk_y = 8;
// Check if a specific chunk has a hole
let has_hole = wdl.holes_data
.get(&(tile_x, tile_y))
.map(|h| h.has_hole(chunk_x, chunk_y))
.unwrap_or(false);
// Modify hole data
if let Some(holes) = wdl.holes_data.get_mut(&(32, 48)) {
holes.set_hole(8, 8, true); // Create a hole
holes.set_hole(9, 9, false); // Remove a hole
}
use wow_wdl::version::WdlVersion;
use wow_wdl::conversion::convert_wdl_file;
use wow_wdl::parser::WdlParser;
use std::fs::File;
use std::io::BufWriter;
# fn main() -> Result<(), Box<dyn std::error::Error>> {
# use wow_wdl::types::WdlFile;
# let wdl = WdlFile::new();
// Convert pre-Legion WDL to Legion format
let legion_wdl = convert_wdl_file(&wdl, WdlVersion::Legion)?;
// Save the converted file
let output = File::create("converted.wdl")?;
let mut writer = BufWriter::new(output);
WdlParser::with_version(WdlVersion::Legion)
.write(&mut writer, &legion_wdl)?;
# Ok(())
# }
| Feature | Status | Notes |
|---|---|---|
| MVER parsing | ✅ | All versions supported |
| MAOF parsing | ✅ | 64x64 offset grid |
| MARE parsing | ✅ | 17x17 + 16x16 heights |
| MAHO parsing | ✅ | Hole bitmasks |
| WMO chunks | ✅ | Pre-Legion support |
| ML** chunks | ✅ | Legion+ support |
| Version conversion | ✅ | Between all formats |
| Data validation | ✅ | Comprehensive validation |
| Error handling | ✅ | Robust error types |
| Height interpolation | 🚧 | Planned |
| Coordinate conversion | 🚧 | Planned |
| Minimap generation | 🚧 | Planned |
Licensed under either of
at your option.