SourcePP
Several modern C++20 libraries for sanely parsing Valve formats.
About the Libraries
Source Pretty Parsers (SourcePP) is an MIT-licensed open source collection of several libraries, which can read and write many Source engine file formats. Precompiled builds are distributed for Windows, Linux, and macOS, and should work without issue on any little-endian system (big-endian support is mostly untested, some libraries will not work). Bindings of varying completeness exist for C, C#, and Python, and bindings for JavaScript and Rust are planned. C++ and Python are the languages with the most support and development focus.
Created by craftablescience, with contributions from many lovely people.
Gallery
These are a list of tools and games using SourcePP that I know of, directly or indirectly. If you would like to be listed here, email me or join my Discord server, I'd love to hear from you!
First-Party
fgptool
A tool to crack the filepath hashes in The Orange Box PS3 file groups.
GodotSource
Load Source engine assets in the Godot engine. Heavily WIP.
MareTF
Replicates the functionality of Valve's vtex executable and VTFEdit and more.
QVTF++
A QImageIO plugin to load VTF textures in Qt applications.
Reloaded2PS3
Convert the PC version of Portal Reloaded to a playable PS3 game.
scryptor
Freely encrypt or decrypt Source engine file formats.
srcmatsearch
Search for models that reference a given material.
VPKEdit
Replicates the functionality of Valve's vpk executable and GCFScape and more.
VTF Thumbnailer
Creates thumbnails for VTF textures.
Third-Party
Aurora Source
A "branch" of the source engine, forked from SDK2013.
bsp-linux-fix
Patches maps on the server to fix missing models & textures on Linux.
CS2-EomVotesFix
Fix CS2 not displaying workshop map names and thumbnails during the End-of-Match vote.
dham
Modifies Dota 2 hero aliases and saves the changes.
gimp-vtf
A GIMP 3.0 plugin that reads and writes VTF textures.
gm_addon_optimization_tricks
A desktop tool to optimize Garry's Mod addons and maps from an easy-to-use interface.
Linux BSP Case Folding Workaround
Patches maps on the client to fix missing models & textures on Linux.
Myst IV: Revolution
Various fixes for Myst IV: Revelation.
PBR-2-Source
A Python-powered tool to convert PBR materials into Source Engine-compatible materials.
props_scaling_recompiler
An automatic asset recompiler that allows you to scale props and/or convert them to prop_static within Hammer.
RectMaker
A freeware tool by "just wax" to create and modify hotspot definitions used in Hammer.
rock:sail
Use paid skins, music, and agents for free in CS2.
SourceRadiant
The open-source, cross-platform level editor for Source Engine-based games.
Verifier
Builds an index of files to validate file contents later.
vpk2wad_nd
Ports VTF textures into Narbacular Drop WADs.
VTF Forge
A modern multi-platform recreation of VTFEdit, using the Qt UI framework.
Games
Portal 2: Community Edition
- Local addon assets are packed with SourcePP.
- Verifier and VPKEdit are shipped with the game.
Momentum Mod
- Some bundled textures are created and/or compressed with MareTF.
- Some bundled assets are packed with VPKEdit.
Nightmare House: The Original Mod
- Game assets are packed with VPKEdit.
Supported Formats
| Library | Supports | Read | Write |
|---|---|---|---|
bsppp
|
BSP v17-27
|
✅ | ✅ |
| fspp* | Source 1 filesystem accessor | ✅ | ✅ |
gamepp
|
Get Source engine instance window title/position/size | ✅ | ❌ |
| Run commands in a Source engine instance remotely | ❌ | ✅ | |
kvpp
|
✅ | ❌ | |
| KeyValues v1 Binary | ✅ | ✅ | |
| KeyValues v1 Text† | ✅ | ✅ | |
| mdlpp* | MDL v44-49 | ✅ | ❌ |
| VTX v7 | ✅ | ❌ | |
| VVD v4 | ✅ | ❌ | |
| sndpp* | WAV | ✅ | ❌ |
| XWV v0-1, v4 | ✅ | ❌ | |
steampp
|
Find Steam install folder | ✅ | ❌ |
| Find installed Steam games | ✅ | ❌ | |
| Find Steam game library assets | ✅ | ❌ | |
toolpp
|
FGD (Source 1)
|
✅ | ✅ |
WC (CmdSeq) v0.1-0.2
|
✅ | ✅ | |
vcryptpp
|
VICE encrypted files | ✅ | ✅ |
| VFONT encrypted font | ✅ | ✅ | |
vpkpp
|
007 v1.1, v1.3 (007 - Nightfire) | ✅ | ❌ |
| FGP v2-3 (PS3, Orange Box) | ✅ | ✅ | |
| FPX v10 (Tactical Intervention) | ✅ | ✅ | |
| GCF v6 | ✅ | ❌ | |
| GMA v1-3 (Garry's Mod) | ✅ | ✅ | |
| HOG (Descent) | ✅ | ❌ | |
| OL (Worldcraft Object Library) | ✅ | ❌ | |
| ORE (Narbacular Drop) | ✅ | ❌ | |
| PAK (Quake, WON Half-Life) | ✅ | ✅ | |
| PCK v1-2 (Godot Engine) | ✅ | ✅ | |
VPK pre-v1, v1-2, v54
|
✅ | ✅ | |
| VPK (Vampire: The Masquerade - Bloodlines) | ✅ | ✅ | |
| VPP v1-3 (Red Faction) | ✅ | ❌ | |
| WAD v3 | ✅ | ✅ | |
| XZP v6 (Xbox, Half-Life 2) | ✅ | ❌ | |
| ZIP | ✅ | ✅ | |
vtfpp
|
APNG | ✅ | ❌ |
| BMP | ✅ | ✅ | |
| EXR v1 | ✅ | ✅ | |
| FRAMES (PS3, Orange Box) | ✅ | ❌ | |
| GIF | ✅ | ❌ | |
| HDR | ✅ | ✅ | |
| JPEG | ✅ | ✅ | |
| PIC | ✅ | ❌ | |
| PNG | ✅ | ✅ | |
| PNM (PGM, PPM) | ✅ | ❌ | |
| PPL v0 | ✅ | ✅ | |
| PSD | ✅ | ❌ | |
| QOI | ✅ | ✅ | |
| SHT v0-1 | ✅ | ✅ | |
| TGA | ✅ | ✅ | |
| TTX (TTH, TTZ) v1.0 | ✅ | ✅ | |
| VBF v3 | ✅ | ❌ | |
VTF v7.0-7.6
|
✅ | ✅ | |
| WebP | ✅ | ✅ |
* These libraries are incomplete and still in development. Their interfaces are unstable and will likely change in the future. Libraries not starred should be considered stable, and their existing interfaces will not change much if at all. Note that wrappers only exist for stable libraries.
† Many text-based formats in Source are close to (if not identical to) KeyValues v1, such as VMT and VMF.
Special Thanks
-
bsppp
- Partial library redesign, lump compression and game lump parsing/writing support contributed by @Tholp.
-
dmxpp
- Support for srctools formats was contributed by @TeamSpen210.
-
steampp
- Library is based on the SteamAppPathProvider library by @Trico Everfire and Momentum Mod contributors.
-
vpkpp
- 007 parser is based on reverse-engineering work by Alhexx.
- GCF parser was contributed by @eepycats and @ymgve.
- HOG parser was contributed by @erysdren.
- OL parser is based on reverse-engineering work by @erysdren.
- ORE parser is based on reverse-engineering work by @erysdren.
- VPP parser was contributed by @erysdren.
- WAD3 parser/writer was contributed by @ozxybox.
- NICE/Lanczos-3 resize filter support was contributed by @koerismo.
- SHT parser/writer was contributed by @Trico Everfire.
-
vtfpp
- Initial VTF write support was loosely based on work by @Trico Everfire.
- HDRI to cubemap conversion code is modified from the HdriToCubemap library by @ivarout.