source-vmf
A straightforward, high-performance library for parsing, manipulating, and serializing Valve Map Format (VMF) files used in Source Engine games.
It provides a strongly-typed representation of map geometry, entities, visgroups, cameras, and cordons, while preserving unknown keys and custom blocks for lossless round-tripping.
Key Features
- Lossless Round-tripping: Preserves unknown properties and custom vendor blocks across parse and serialize cycles.
- Complete Map Coverage: Strongly-typed structures for version info, visgroups, view settings, world geometry (solids, sides), point and brush entities, cameras, and cordons.
- Fast Entity Lookups: Search entities across visible and hidden blocks by targetname or name prefix using
EntityIndex. - Entity I/O Connections: Ergonomic API for reading, modifying, and creating entity logic connections.
- Atomic Saving: Writes safely to a temporary
.partfile before replacing the target file on disk. - Map Merging: Built-in helper to merge geometry, entities, visgroups, and cordons from multiple VMF files.
- Serde Support: Optional
serializationfeature for serializing and deserializing VMF structures.
Feature Flags
serialization— Enables SerdeSerializeandDeserializeimplementations for VMF data structures.
Quick Start
1. Reading, Modifying, and Saving a Map
use *;
2. Fast Lookups with EntityIndex
use *;
3. Adding Logic Connections
use *;
let mut button = new;
button.add_connection;
4. Merging Maps
use *;
License
MIT License.