AI prompts
base on š¬ Valve's Source 2 resource file format parser, decompiler, and exporter. <h1 align="center"><img src="./Misc/Icons/source2viewer.png" width="64" align="center"> Source 2 Viewer</h1>
<p align="center">
<a href="https://github.com/ValveResourceFormat/ValveResourceFormat/actions">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/ValveResourceFormat/ValveResourceFormat/build.yml?logo=github&style=for-the-badge&branch=master">
</a>
<a href="https://www.nuget.org/packages/ValveResourceFormat/">
<img src="https://img.shields.io/nuget/v/ValveResourceFormat.svg?logo=nuget&style=for-the-badge">
</a>
<a href="https://app.codecov.io/gh/ValveResourceFormat/ValveResourceFormat">
<img src="https://img.shields.io/codecov/c/github/ValveResourceFormat/ValveResourceFormat/master?logo=codecov&logoColor=ffffff&style=for-the-badge">
</a>
</p>
*\* The library component of Source 2 Viewer is called ValveResourceFormat (VRF).*
Valve's Source 2 resource file format parser, decompiler, and exporter.
Source 2 files usually end with `_c`, for example `.vmdl_c`.
This repository is split into three components:
- **CLI Decompiler** - File data viewer, decompiler and a playground for testing new formats and features.
- **GUI Viewer** - A vpk archive viewer and extractor. Also supports viewing resources such as sounds, textures, models, maps, and much more.
- **Library** - Provides public API to parse resource files and some helpers.
ā [View the official website for downloads](https://valveresourceformat.github.io/).
## Join our Discord
[![Join our Discord](https://discord.com/api/guilds/467730051622764565/embed.png?style=banner2)](https://steamdb.info/discord/)
## Eye catchy screenshots
<table>
<tr>
<td><img src="https://valveresourceformat.github.io/static/screen_map.png"></td>
<td><img src="https://valveresourceformat.github.io/static/screen_texture.png"></td>
</tr>
<tr>
<td><img src="https://valveresourceformat.github.io/static/screen_package.png"></td>
<td><img src="https://valveresourceformat.github.io/static/screen_cli.png"></td>
</tr>
</table>
## What's supported?
- VPK viewer which supports opening and exporting files
- Creating new vpk archives
- Model viewer and decompiler to glTF and modeldoc
- Map viewer and decompiler to glTF and vmap
- Material decompiler to vmat
- Sound player
- Binary KeyValues3 parser
- NTRO support
## Limitations
This tool is based entirely on a reverse engineered effort because Valve does not provide any documentation or Source 2 code (SDK or engine code), while the Source 1 SDK and leaked engine code are helpful, a lot of systems and formats have changed.
The code contained in this repository is based on countless hours of reverse engineering Source 2 games and not all intricate details have been figured out.
If you are interested in helping, take a look at the open issues and join our Discord.
Not all formats are 100% supported, some parameters are still unknown and not fully understood.
## Supported resource types
Ext | Name | Support
-------- | ----------------------- | -------
vagrp | Animation Group | š
vanim | Animation | š
vanmgrph | Animation Graph | No
vcompmat | Composite Material | No
vcss | Panorama Style | š
vdata | Data | š
vents | EntityLump | š
vjs | Panorama Script | š
vmap | Map | š
vmat | Material | š
vmdl | Model | š
vmesh | Mesh | š
vmorf | MorphSet | š
vpcf | Particle System | š
vpdi | Panorama Dynamic Images | No
vphys | Physics Collision Mesh | š
vpost | Postprocessing Settings | š
vpsf | Particle Snapshot | No
vpulse | Pulse Graph Definition | No
vrman | ResourceManifest | š
vrmap | Resource Remap Table | No
vrr | Response rules | š
vseq | Sequence Group | No
vsmart | Smart Prop | Partially
vsnap | Particle Snapshot | š
vsnd | Sound | š
vsndevts | Sound Event Script | š
vsndstck | Sound Stack Script | š
vsurf | Surface Properties | No
vsvg | Panorama Vector Graphic | š
vtex | Compiled Texture | š
vts | Panorama TypeScript | š
vvis | WorldVisibility | No
vwnod | WorldNode | š
vwrld | World | š
vxml | Panorama Layout | š
| |
vpk | Pak (package) | š Handled by [ValvePak](https://github.com/ValveResourceFormat/ValvePak)
vcs | Compiled Shader | š Handled by `CompiledShader`
vfont | Bitmap Font | š Decrypts `VFONT1`, supported in Source 1 and Source 2.
dat | Closed Captions | š Handled by `ClosedCaptions`
bin | Tools Asset Info | š Handled by `ToolsAssetInfo`
vdpn | Dota Patch Notes | š
vdacdefs | DAC Game Defs Data | No
vfe | Flex Scene File | š Handled by `FlexSceneFile`
vcd | VCD | No
vcdlist | VCD list | š
## List of supported magics
Magic | Description
------------ | ------------
`0x03564B56` | VKV\x03 - First binary keyvalues 3 encoding with custom block compression
`0x4B563301` | KV3\x01 - Binary keyvalues 3 (version 1)
`0x4B563302` | KV3\x02 - Binary keyvalues 3 (version 2)
`0x4B563303` | KV3\x03 - Binary keyvalues 3 (version 3)
`0x4B563304` | KV3\x04 - Binary keyvalues 3 (version 4)
`0x4B563305` | KV3\x05 - Binary keyvalues 3 (version 5)
`0x564B4256` | VBKV - binary keyvalues 1 (handled by ValveKeyvalue)
`0x55AA1234` | VPK - valve package (handled by ValvePak)
`0x44434356` | VCCD - closed captions
`0xC4CCACE8` | tools asset info
`0xC4CCACE9` | tools asset info (newer version)
`0x32736376` | vcs2 - compiled shader
`0x31415926` | murmurhash2 seed used by StringToken
`0xEDABCDEF` | murmurhash64 seed used to encode resource IDs
`VFONT1` | "encrypted" font file
`0x00564645` | VFE - flex scene file
## Command-line options
Option | Description
----------------------------- | -----------
| **Input** | |
`--input` (or `-i`) | Input file to be processed. With no additional arguments, a summary of the input(s) will be displayed.
`--recursive` | If specified and given input is a folder, all sub directories will be scanned too.
`--recursive_vpk` | If specified along with `--recursive`, will also recurse into VPK archives.
`--vpk_extensions` (or `-e`) | File extension(s) filter, example: "vcss_c,vjs_c,vxml_c".
`--vpk_filepath` (or `-f`) | File path filter, example: "panorama\\" or "scripts/items/items_game.txt".
`--vpk_cache` | Use cached VPK manifest to keep track of updates. Only changed files will be written to disk.
`--vpk_verify` | Verify checksums and signatures.
| **Output** | |
`--output` (or `-o`) | Output path to write to. If input is a folder (or a VPK), this should be a folder.
`--all` (or `-a`) | Print the content of each resource block in the file.
`--block` (or `-b`) | Print the content of a specific block, example: DATA, RERL, REDI, NTRO.
`--vpk_decompile` (or `-d`) | Decompile supported resource files.
`--vpk_list` (or `-l`) | Lists all resources in given VPK. File extension and path filters apply.
`--vpk_dir` | Print a list of files in given VPK and information about them.
| **Type specific export** | |
`--gltf_export_format` | Exports meshes/models in given glTF format. Must be either 'gltf' (default) or 'glb'.
`--gltf_export_materials` | Whether to export materials during glTF exports.
`--gltf_textures_adapt` | Whether to perform any glTF spec adaptations on textures (e.g. split metallic map).
`--gltf_export_extras` | Export additional Mesh properties into glTF extras
`--tools_asset_info_short` | Whether to print only file paths for tools_asset_info files.
| **Other** | |
`--threads` | If higher than 1, files will be processed concurrently.
`--version` | Show version information.
`--help` | Show help information.
There are also `--stats` related options, but they are not listed here as they are not relevant to most users.
### Examples:
```powershell
# List all files in the vpk
# Use `--vpk_dir` to also print file metadata
./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --vpk_list
# Export the entire vpk as is
./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --output "pak01_exported"
# Export only the "panorama/layout" folder
./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --output "pak01_exported" --vpk_filepath "panorama/layout"
# Decompile and export all Panorama files to a folder named "exported"
./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" -e "vjs_c,vxml_c,vcss_c" -o "exported" -d
# Print resource blocks for a specific file similar to resourceinfo.exe in Source 2
# Use `--block DATA` to only print a specific block
./Source2Viewer-CLI.exe -i "file.vtex_c" --all
# Decompile a specific file on disk
./Source2Viewer-CLI.exe -i "file.vtex_c" -o exported.png
```
## License
Contents of this repository are available under [MIT license](LICENSE), except for `Tests/Files` folder contains files which have likely come from Valve's games.
## Code signing policy
Free code signing provided by [SignPath.io](https://about.signpath.io), certificate by [SignPath Foundation](https://signpath.org).
", Assign "at most 3 tags" to the expected json: {"id":"2758","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"