Expand description
Battle Map Definition (BMD) file format support.
BMD files (.bmd) are FASTBIN0-format files that define battle map layouts for Total War
games. They contain comprehensive 3D scene data including buildings, terrain, lighting,
vegetation, deployment zones, AI hints, and other gameplay-critical map elements.
§File Format
BMD files use the FASTBIN0 binary format with a version-specific structure:
[8 bytes] FASTBIN0 signature
[u16] serialise_version
[...] version-specific data§Supported Versions
All currently supported versions are:
- Version 23
- Version 24
- Version 25
- Version 26
- Version 27
§File Contents
BMD files contain numerous specialized data lists:
§Buildings & Structures
BattlefieldBuildingList- Buildings inside the battlefield areaBattlefieldBuildingListFar- Buildings outside the battlefield areaPrefabInstanceList- Prefab object instancesPropList- Small decorative props
§Terrain & Outlines
TerrainOutlines- Terrain boundary definitionsNonTerrainOutlines- Non-terrain area boundariesGoOutlines- Traversable areas (where units can go)WaterOutlines- Water body boundaries
§Gameplay Elements
DeploymentList- Unit deployment zonesCaptureLocationSet- Groups of capture locationsPlayableArea- Playable map boundariesAIHints- AI pathfinding and behavior hints
§Lighting & Visual Effects
PointLightList- Point light sourcesSpotLightList- Spotlight sourcesLightProbeList- Global illumination probesParticleEmitterList- Particle effect emitters
§Vegetation
TreeListReferenceList- Tree placement referencesGrassListReferenceList- Grass placement references
§Other
CameraZones- Camera constraint zonesSoundShapeList- 3D audio zonesCompositeSceneList- Composite scene referencesCustomMaterialMeshList- Custom material meshes- And 20+ more specialized lists
§Usage
ⓘ
use rpfm_lib::files::bmd::Bmd;
use rpfm_lib::files::Decodeable;
// Decode a BMD file
let bmd = Bmd::decode(&mut reader, &None)?;
println!("BMD version: {}", bmd.serialise_version());
// Access building list
for building in bmd.battlefield_building_list().list() {
println!("Building: {:?}", building.key());
}
// Export to Terry (CA's editor format)
bmd.export_prefab_to_raw_data("map_name", Some(&vegetation), &output_path)?;§Terry Export
BMD files can be exported to Terry (Creative Assembly’s map editor) format using
Bmd::export_prefab_to_raw_data(). This generates:
.terryproject file.layerscene layer file with entities and associations
§File Location
BMD files are typically found in:
terrain/battles/*.bmd
terrain/tiles/*.bmdModules§
- common
- Common data structures shared across BMD format files.
Structs§
- Bmd
- Represents a complete Battle Map Definition file decoded in memory.
Constants§
- EXTENSIONS
- File extension for Battle Map Definition files.
- SIGNATURE
- FASTBIN0 file signature.
Traits§
- ToLayer
- Trait for converting BMD data structures to Terry
.layerXML format.