Skip to content

Decompile fixes - #1399

Draft
w1tcherrr wants to merge 10 commits into
ValveResourceFormat:decompile-pathsfrom
w1tcherrr:decompile-fixes
Draft

w1tcherrr wants to merge 10 commits into
ValveResourceFormat:decompile-pathsfrom
w1tcherrr:decompile-fixes

Conversation

@w1tcherrr

@w1tcherrr w1tcherrr commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on #1406, review that first.

Models

  • Write body markup for physics bodies without a bone so prop mass survives a recompile
  • Decompile break commands, break piece authoring keys, more game data classes and disabled sticker and keychain markup
  • Decompile hull and view bounds, the model archetype and model configs
  • Decompile ragdoll break pieces as is_ragdoll
  • Emit model doc sequence nodes in the model's sequence order
  • Keep the identifier of a model's first AnimGraph2 reference
  • Compile decompiled physics hulls without simplification
  • Write models with cloth stiffen events as ModelDoc version 30 so their speeds survive the upgrade
  • Decompile a morph set with no morph targets as model level morph controls and rules
  • Decompile per-triangle physics mesh surfaces as one mesh node per surface in compiled node order

Textures

  • Write clamp and no-LOD flags into reconstructed vtex configs
  • Reconstruct vtex configs for cubemaps, texture arrays and volume textures
  • Write material cubemaps as one strip and texture arrays as numbered slices under the names the vmat references

Maps

  • Weld referenced meshes of map-compiled models into decompiled Hammer geometry
  • Rebuild physics spheres and capsules as collision hulls in decompiled maps
  • Decompile CS2 clutter as clutter instance static props
  • Drop the compiler-generated model key from map entities rebuilt as Hammer meshes
  • Rebuild overlays from merged nsoverlay and agg_overlay meshes
  • Use the compiler's back facing threshold when lifting overlay receiver triangles

CLI output

  • Keep the resource paths of a decompiled map's files in CLI output and refuse paths outside the output folder
  • Write a decompiled resource's side files at their resource paths when the CLI outputs to a folder
  • Write vcdlist scenes at the relative path the list names
  • Keep extracted vcdlist scene paths inside the output folder

Output

  • Resolve hashed names in decompiled files only from built-in names, the game's surface properties and the file itself, so the output does not depend on what was decompiled before
  • Read embedded meshes, morph data and external mesh data of a model once when several threads use it
  • Dispose the textures a material extract loads
  • Look up clutter models once per map

@github-actions github-actions Bot added Exporting Related to exporting files or data Animation Related to animations, animation graphs and choreo Maps Related to maps, worlds and entities labels Oct 9, 2026
@w1tcherrr
w1tcherrr force-pushed the decompile-fixes branch 2 times, most recently from 5182f49 to 2c7c4f9 Compare October 12, 2026 16:17
@w1tcherrr
w1tcherrr changed the base branch from master to decompile-paths October 12, 2026 16:18
@w1tcherrr
w1tcherrr force-pushed the decompile-fixes branch 2 times, most recently from 6ad13f5 to 9db59d3 Compare October 16, 2026 21:59
@w1tcherrr
w1tcherrr marked this pull request as draft October 16, 2026 22:07
@w1tcherrr
w1tcherrr force-pushed the decompile-fixes branch 2 times, most recently from 86c8319 to b174b86 Compare October 16, 2026 22:23
@w1tcherrr
w1tcherrr force-pushed the decompile-fixes branch 2 times, most recently from 7a2b8f2 to 6cd212e Compare October 16, 2026 23:17
@LionDoge

Copy link
Copy Markdown
Contributor

I have some suggestions.
So far the user has no idea where the files will end up, since it works like the batch export now. The user might choose a directory inside their addon, and not the root - as it would be intended in that case, and it will end up being invalid in regards to any other decompiled references obviously.

Also, it would be good if the user also could choose whether to preserve the original directory structure or extract directly to a chosen one (so like it is now for single files). Additionally, it may be possible to correct some references to match the directory automatically (although it might get a bit complex with all the asset types). I think it's still good to have though.

Moreover for the directory export it would be neat to have an option to add a prefix or use regex for all the extracted files. My use case (and probably a lot of other user's) is to often edit an existing asset, but not override it. If I extract it into the addon it will be automatically overridden, and I have to rename all of them manually, then delete the compiled files manually if I had tools open. On top of that I often have to restart tools too in case of materials since it bugs out and it will show me an error material instead even after removing the game file.

Also not sure what 'Include dependencies' does fully. Since for materials it still tries to extract vtex files - which I assume should be the dependencies, but even with it unchecked it still extracts the vtex files, maybe its somehow dependent on the vmat extractor code. We can maybe show the user how many dependencies, or even which ones will be extracted. Because it might be just one or like a 1000, and the user has no idea.

I had prepared this dialog concept before when working on my own version before, it is made for a single file popup though, it can probably be easily adapted for multi-file export too.

img

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants