sourcepak

Crates.iosourcepak
lib.rssourcepak
version0.3.0
sourcesrc
created_at2024-02-22 19:47:01.6294
updated_at2024-06-22 14:59:23.943051
descriptionA library for reading and writing Source engine package files.
homepage
repositoryhttps://github.com/barnabwhy/sourcepak-rs/
max_upload_size
id1149662
size101,864
Barnaby (barnabwhy)

documentation

README

sourcepak

sourcepak is a Rust crate that provides support for working with VPK (Valve Pak) files. It allows you to read and write VPK files, as well as extract and pack their contents.

Features

  • Read and write VPK files
  • Extract files from VPK archives
  • Optionally memory-map archive files for faster speeds (with the mem-map feature)
  • Write VPK directory files (dir.vpk)

Supported formats

VPK v1 (Alien Swarm, Dota 2, L4D, L4D2, Portal 2, SFM)

  • Read directory files
  • Read file contents
  • Write VPK directories

VPK v2 (CS:GO, CS:S, DoD:S, HL:S, HL2, HL2:DM, Portal, TF2, Source 2)

  • Read directory files
  • Read file contents
  • Write VPK directories

Respawn VPK (Titanfall)

  • Read directory files
  • Read file contents
  • Read audio files (see here for why this is separate)
  • Write VPK directories

Documentation

Documentation can be found here

Why does this crate exist?

I originally created the TFVPKTool TypeScript library to support reading Respawn VPK files, along with Harmony VPK Tool using Electron.

I very quickly noticed the issue that these often resulted in high memory use due to language and ecosystem I had used.

With sourcepak I am aiming to fix that.

Commit count: 63

cargo fmt