CosmicHorrorDev / vdf-rs

VDF parsing and (de)serialization for Rust
Apache License 2.0
31 stars 3 forks source link

Missing support for qc #34

Closed DotWith closed 1 year ago

DotWith commented 1 year ago

Right now, parsing only works with a key (ex:

"QC"
{
        "$modelname"    ""
}

Their should be a function for to_string_without_key and the same for de-serializing.

CosmicHorrorDev commented 1 year ago

Do you have an example of a file that fails due to missing a key? VDF is very underspecified, so specific examples help

DotWith commented 1 year ago

Sorry, I don't want a key. This repo cannot parse qc files (without a key, variables have no parentheses, etc).

Example of qc

$modelname "Combine_camera\Combine_camera.mdl"

$bodygroup "studio"
{
    studio "combine_camera_reference.smd"
}

$surfaceprop "default"

$contents "solid"

...
CosmicHorrorDev commented 1 year ago

Are these files from a game I could look at? This is different from any VDF files I'm used to seeing where it's entirely based around key-value pairs :sweat_smile:

DotWith commented 1 year ago

Valve Wiki It's used for compiling models via blender, autodesk, etc. Here's the full example.

CosmicHorrorDev commented 1 year ago

Sorry for taking so long to get back. It took a little while for me to dig through things and I've been busy with holidays preparations


From what I can tell the format you listed is in KeyValues2 while this library only supports KeyValues

I mistakenly thought that VDF v1 and v2 was called KeyValues, but I now see that KeyValues2 and KeyValues3 are very distinct from KeyValues. I've updated all the READMEs to reflect that this only supports KeyValues

DotWith commented 1 year ago

Thank you, do you have any plans to add KeyValues2 and KeyValues3?

CosmicHorrorDev commented 1 year ago

Not at the moment. I've still got a lot of work I'm planning on doing to clean up the existing KeyValues impl along with adding support for the KeyValues binary format. I don't think I could take up even more work with the expectation that it would be finished anytime remotely soon

From what I can tell it looks like KeyValues2 is at least mostly forwards compatible, so it's possible that the parser could be reused for KeyValues, but rendering it back out to text would likely need significant changes

KeyValues3 is incredibly different, but I've also never seen it get used in practice