Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement StringPool for binary kv1 used by Steam #99

Closed
wants to merge 1 commit into from

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Jun 27, 2024

@yaakov-h how do we implement this sanely? They invented this and used by appinfo.vdf in Steam.

KV3 does the same thing, there's a string array for the keys. The only difference is that for kv1 they put the string pool separate from the KV1 data, so the parser can't parse it on its own.

Ref: SteamDatabase/SteamAppInfo@56b1fec#diff-97374b6129341b7a97d4a8056e32c8865a2553ad49aa9a70c841058fbccdfb2f

xPaw added a commit to SteamDatabase/SteamAppInfo that referenced this pull request Jun 27, 2024
@yaakov-h
Copy link
Member

What happened here?

Looking over the code, it sounds like:

  • They added a string table which gets shipped out-of-band (i.e. not in the actual KV1 binary structure)
  • When parsing KV1 binary you need the same string table used to serialize
  • KV1-with-string-table uses the string table for keys, but not for values

?

@xPaw
Copy link
Member Author

xPaw commented Jun 28, 2024

That's correct. The method I saw being used is CKeyValuesSystem::AddStringToPool.

For ref, same thing in binary kv3: https://github.com/ValveResourceFormat/ValveResourceFormat/blob/25ac2246fed63e0321eaecef0e419e3fc0456aed/ValveResourceFormat/Resource/ResourceTypes/BinaryKV3.cs#L643-L647

terrymacdonald added a commit to terrymacdonald/DisplayMagician that referenced this pull request Jul 1, 2024
This is a partial update of SteamAPpInfoParser. This does the main part of this, but it is still waiting for StringPool support from the underlying ValveKeyValue library. See here for more info: ValveResourceFormat/ValveKeyValue#99
@terrymacdonald
Copy link

Hi,

I'm developer of DisplayMagician (https://github.com/terrymacdonald/DisplayMagician) and some users asked me to investigate why DisplayMagician can't detect games within the latest Steam Families Beta client appinfo.vdf. It looks like you are both all over the changes (thank you so, so much), but I was wondering how much work is left before this update could be supported in ValveKeyValue?

Will it be months, or is it fairly imminent? I can tell my users to stay on the current version until this is all ready.

Also, I just wanted to thank you both for your awesome work on this. I am amazed at how well you can keep this in step with Valves file format. Its very inspiring.

Thanks
Terry

@yaakov-h
Copy link
Member

yaakov-h commented Jul 2, 2024

I've had a look and gone with a slightly different approach in #100. This passes the string table around, avoiding changes to other internal interfaces.

I kinda suspect we may eventually need to pass the whole Options object around, but for now I'm passing around just the string table.

@xPaw xPaw closed this Jul 3, 2024
@yaakov-h yaakov-h deleted the steam-binary-kv-stringpool branch July 3, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants