Skip to content

Rework decompile output paths - #1406

Open
w1tcherrr wants to merge 19 commits into
ValveResourceFormat:masterfrom
w1tcherrr:decompile-paths
Open

w1tcherrr wants to merge 19 commits into
ValveResourceFormat:masterfrom
w1tcherrr:decompile-paths

Conversation

@w1tcherrr

@w1tcherrr w1tcherrr commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Every decompiled file is now written at its content path below an output root, so vmdl, vmat and vmap references resolve after decompiling. Before this, only CLI VPK input into a folder kept paths consistent; every other mode flattened or split files (#1389 among them).

  • New ContentExporter and ContentPaths in the library decide where every file goes and do all writing. The CLI and GUI pass a root and options.
  • A picked output folder inside an addon or mod snaps to its root. Elsewhere, trailing folders that match the content path are dropped.
  • Sub files (DMX, images, LUTs, vcds, vfx includes) are written where the parent references them. NM clips and skeletons go to their authored source path.
  • The same content is written once. Different content at the same path gets a numbered name and the parent is re-pointed.
  • DMX element IDs and vnmgraph GUIDs are derived from content instead of random.
  • Maps are written as maps/<map>_d.vmap. Compiled map containers (world, world nodes, manifests, entity lumps) and baked lightmaps, cubemaps and light probes are skipped, since recompiling writes them again; their content stays in the vmap. Only map-internal props are extracted.
  • Identical files are written once; texture images compiled twice from one source keep the highest resolution, and resources the compiler generated from another (+non_additive clips, graph variations) are skipped.
  • Opt-in "Include dependencies" (--decompile_dependencies) also decompiles referenced files from the same package, skipping textures the compiler generates.
  • The GUI asks once per export what to do with existing files; the CLI has --skip_existing.
  • GUI decompile asks for a root folder; glTF keeps Save As.
  • ContentFile.KeepFullPath is removed and FileName is always content-relative.
  • Export runs on every core. ContentExportQueue exports a resource only after every earlier resource that reaches it through references, a generated resource after the one it was generated from, and files in a map's folder after the map, so the output is the same as a single-threaded run. The CLI and GUI both use it and --threads is removed.
  • glTF exports write their textures, buffers and _physics files through ContentExporter. Textures are named after their source texture and channel mapping, so the same texture is written once and different ones never share a name.
  • --vpk_cache keeps its manifest in the output folder, ignores it for another version, package or options, and records a file only once it was exported.
  • Loose files under one addon or mod share one game file loader instead of mounting the game for every file.

Times with 16 threads, output identical in every run:

1f9d7a9 This PR One thread
CS2 core/pak01_dir.vpk -d 19.1 s 4.1 s 19.8 s
CS2 ar_baggage.vpk -d 10.8 s 10.0 s 20.2 s
chicken.vmdl with --decompile_dependencies 9.9 s 5.4 s 11.1 s

A map is one long item that the files in its folder wait for, so a single map is not faster.

#1399 is stacked on top of this.

Closes #1389

@github-actions github-actions Bot added Renderer Related to the 3D/2D rendering viewer Exporting Related to exporting files or data Animation Related to animations, animation graphs and choreo Maps Related to maps, worlds and entities Shaders Related to compiled shader (vcs) parsing and decompiling labels Oct 12, 2026
@w1tcherrr
w1tcherrr marked this pull request as draft October 12, 2026 16:11
@w1tcherrr w1tcherrr mentioned this pull request Oct 12, 2026
@w1tcherrr
w1tcherrr requested a review from xPaw October 12, 2026 16:25
@w1tcherrr
w1tcherrr marked this pull request as ready for review October 16, 2026 22:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Animation Related to animations, animation graphs and choreo Exporting Related to exporting files or data Maps Related to maps, worlds and entities Renderer Related to the 3D/2D rendering viewer Shaders Related to compiled shader (vcs) parsing and decompiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect VNMskel/VNMclip DMX decompile location and name

1 participant