Opening VPK Archives
Use thePackage class from SteamDatabase.ValvePak to open VPK files:
Finding Files in VPK
ThePackage.FindEntry method locates files within the archive:
Reading File Contents
Extract file data from VPK entries:GameFileLoader Integration
TheGameFileLoader class automatically handles VPK packages and file system lookups:
GameFileLoader automatically searches:- Current package
- Additional game packages (found via gameinfo.gi)
- Loose files on disk
- Workshop dependencies
Loading from Multiple VPKs
TheGameFileLoader can search across multiple VPK packages:
Package Entry Streams
For efficiency, you can get a stream directly from a package entry:Finding Shaders
Load shader collections across multiple packages:Extracting All Files
Iterate through all entries to extract files:Compiled File Suffix
When loading compiled resources, use theCompiledFileSuffix constant:
Cleanup
Always dispose of packages and file loaders:Next Steps
Reading Resources
Learn about resource file structure
Exporting Models
Export models to glTF format