Repository navigation
feat: flag mods that ship outdated .vdata_c copies - #47
Merged
Merged
Conversation
A mod that ships a game .vdata_c overrides the whole file, so anything Valve added since the mod was built is deleted in game. check_vdata diffs each shipped copy against pak01 as KV3 and reports missing, extra and changed paths. Exposed as `vpkmerge vdata-check`.
- Arrays that grew or shrank now count as structure: plain-value arrays are matched by value (`path[=value]`) since Valve inserts mid-array, object arrays report the tail by index. The 2026 hero batch added a stat inside every hero's m_vecDisplayStats, which used to read as `modified`. - `--json` exits 0 when a mod fails to open; the error stays in that mod's entry, so one bad file no longer discards the whole batch. - VdataChecker opens the base pak once, only when a mod ships a .vdata_c, and reads and decodes each game file once. 68 mods: 2.5s to 0.1s. - A failed entry read is reported per entry instead of aborting the mod.
Slush97
marked this pull request as ready for review
October 4, 2026 10:48
This was referenced Oct 4, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A mod that ships a game
.vdata_c(scripts/heroes.vdata_c,scripts/abilities.vdata_c) replaces the whole file in game, so anything Valve added after the mod was built is gone. This adds a check for that.vpkmerge_core::check_vdata(mod, pak01)decodes each.vdata_cthe mod ships and the game's copy as KV3 and diffs the trees. OneVdataReportper entry:missing: paths the game has and the mod lacks (what the mod deletes), shallowest first so a whole missing hero comes before its fieldsextra: paths only the mod has (the game dropped them)changed: leaf values that differArrays count as structure. Equal-length arrays diff by index. When lengths differ, arrays of plain values are matched by value and reported as
path[=value], because Valve inserts mid-array (the 2026-09-29 batch addedEHeroSpiritLifestealEffectivenessinside every hero'sm_vecDisplayStats). Arrays of objects report the tail aspath[i].Status is
outdated(any missing or extra),modified(values only),current,not-in-game(compiler leftovers likepanorama/image_compiler.vdata_c) orundecodable.modifiedis not proof a mod is current: it can't separate the mod's intended edits from values Valve rebalanced since. That needs the build the mod was made against.VdataCheckerchecks many mods against one pak: it opens the pak only once a mod actually ships a.vdata_c, and reads and decodes each game file once.check_vdatawraps it for a single mod.CLI:
--jsonprints the full untruncated reports. A mod that fails to open gets anerrorfield and the exit code stays 0, so one bad file never hides the rest of a batch. Text mode exits non-zero if any mod failed to open.Testing
tests/vdata_check_live.rsagainst the real pak (gated onDEADLOCK_PAK). Both pass, along with clippy (lib/bins/tests) and fmt.heroes.vdata_cpredates the 2026-09-29 hero batch (104 missing, including Rat King's ability slots and the new lifesteal stat in every hero) and a Plague Doctor Graves skin missing 9 whole heroes.kv3/patch.rs,reader.rs,rewrap.rs,model/glb.rs), same as main since fix: open VPKs that omit the optional v2 MD5 section #45. Nothing in this PR trips clippy.Notes
scripts/fetch-vpkmerge.mjs.mcp-serverbranch. That commit also wires the check into the MCPinspect_modtool. That part stays with the MCP server work, sincevpkmerge-mcpisn't on main.