Skip to content

Replace stale metadata-resources.zip with compressed usedhashes.kark#3

Open
oBusk wants to merge 2 commits intorfuzzo:mainfrom
oBusk:wolvenkit-kark
Open

Replace stale metadata-resources.zip with compressed usedhashes.kark#3
oBusk wants to merge 2 commits intorfuzzo:mainfrom
oBusk:wolvenkit-kark

Conversation

@oBusk
Copy link

@oBusk oBusk commented Feb 18, 2026

I'll freely admit that while I do a lot of development, I don't do a lot of Rust and have been helped by copilot in implementation, but not in ideation.

So I was using red4-conflicts and was seeing paths that was not resolved, and I figured there would probably be some paths changed with the updates to cyberpunk since the last metadata-resources.zip was checked into this lib. I understand the zip that this repo contains used to be provided on https://www.cyberpunk.net/en/modding-support, but is no longer.

I then looked at how WolvenKit deals with the same issue, and found that they have a usedhashes.kark which they produce from the gamefiles. I realize this is something that red4lib and red4-conflicts in turn should be able to use as a replacement for metadata-resources.csv.

At first, I tried to recreate the csv from the kark at buildtime, to fully replicate existing behaviour, but the build process became so complex because we needed a runtime to decompress the kark with and stuff. See main...oBusk:red4lib:d118f286fed9c02754249cd5b9e524ad048da3f0

This PR replaces the static zip by inserting WolvenKit as a git submodule, including the compressed usedhashes.kark in the executionable, and on demand decompress, calculate all the hashes into a hashmap. A nice bonus that the lib is reduced from 163 MB to 5 MB, but obviously comes at the cost that we need to unpack with oogle and calculate hash once per runtime.

From it's usage in red4-conflicts I believe that should be fine, and just a part of the startup process, and for it's usage in the other parts of red4lib I hope it's doable.

As an alternative to this more complex solution, I've also made a PR for just updating the zip to match the latest version of usedhashes.kark, see #2

…lvenKit

The zip is no longer produced and/or updated. WolvenKit keeps a "usedhashes.kark" file in their repo which is updated with all the files in the game, so we can get that as a submodule and include that file instead.

A bonus is that we can include the compressed file (<4mb) instead of a uncompressed csv (140mb). But this means we need to decompress the file at runtime of course.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments