11 releases (7 breaking)

Uses new Rust 2024

0.8.2 Mar 4, 2025
0.7.0 Mar 2, 2025
0.6.0 Aug 29, 2024
0.5.0 Dec 27, 2023
0.1.0 Feb 18, 2022

#199 in Game dev

Download history 5/week @ 2024-12-03 43/week @ 2024-12-10 6/week @ 2024-12-17 8/week @ 2025-01-21 19/week @ 2025-02-04 75/week @ 2025-02-11 54/week @ 2025-02-18 328/week @ 2025-02-25 305/week @ 2025-03-04 20/week @ 2025-03-11 4/week @ 2025-03-18

669 downloads per month
Used in 2 crates (via tf-asset-loader)

MIT license

97KB
3K SLoC

VBSP

Rust parser for valve bsp files.

Currently supports bsp files from Counter Strike Source and Team Fortress 2, other source games using bsp version 19 or 20 might also work. Adding other sourcemod variants should be fairly straight forward and pull requests for them are welcome.

Example usage

fn main() -> Result<(), vbsp::BspError> {
    let data = std::fs::read("maps/cp_steel.bsp")?;
    let bsp = vbsp::Bsp::read(&data)?;
    println!("{:?}", bsp);

    Ok(())
}

See vbsp-to-gltf or vbspviewer for some more examples of how to use the bsp data.

TODO

  • smooth normals for displacements
  • smooth normals for faces

Credits

This project is adapted from the quake bsp parser and wouldn't be possible without information from the source engine wiki.

Dependencies

~12MB
~183K SLoC