localcc / gvas

GVAS file format parsing library for rust
MIT License
19 stars 2 forks source link

Unable to open save file from Journey to the Savage Planet #44

Closed qwandor closed 6 months ago

qwandor commented 8 months ago

I'm trying to figure out why my save files from Journey to the Savage Planet on Stadia aren't working on the Steam version, and so being able to compare them would be useful. I tried using the gvas2json tool, which uses this library. Unfortunately there seems to be a bug:

$ gvas2json save.bin 
Error: Invalid property TextProperty only supported in arrays at position 20489

I've attached a zip containing the save file. Journey to the Savage Planet_1001_gamesave.zip

scottanderson commented 8 months ago

Thank you for the report @qwandor, and for sharing your save file. I can see that TextProperty is being used in a way that we have not seen previously in the test cases we have. I think we can add support for this with a little bit of effort.

scottanderson commented 8 months ago

I started a PR with some progress on this, however I'm having trouble making sense of the TextProperty @ 0x9fea

00009fe0:                               11 00 00 00 53 68            ....Sh
00009ff0: 6f 72 74 44 65 73 63 72 69 70 74 69 6f 6e 00 0d  ortDescription..
0000a000: 00 00 00 54 65 78 74 50 72 6f 70 65 72 74 79 00  ...TextProperty.
0000a010: a2 00 00 00 00 00 00 00 00 01 00 00 00 03 02 00  ................
0000a020: 00 00 ff 01 00 00 00 53 00 00 00 55 73 65 20 79  .......S...Use y
0000a030: 6f 75 72 20 73 63 61 6e 6e 65 72 20 74 6f 20 64  our scanner to d
0000a040: 6f 63 75 6d 65 6e 74 20 74 68 65 20 70 6c 61 6e  ocument the plan
0000a050: 65 74 27 73 20 65 63 6f 73 79 73 74 65 6d 0a 0a  et's ecosystem..
0000a060: 4b 69 6e 64 65 78 20 70 72 6f 67 72 65 73 73 3a  Kindex progress:
0000a070: 20 7b 70 72 6f 67 72 65 73 73 7d 20 25 00 01 00   {progress} %...
0000a080: 00 00 09 00 00 00 70 72 6f 67 72 65 73 73 00 04  ......progress..
0000a090: 01 00 00 00 04 02 bc 9c 82 42 01 00 00 00 00 00  .........B......
0000a0a0: 00 00 01 00 00 00 04 01 00 00 00 44 01 00 00 00  ...........D....
0000a0b0: 00 00 00 00 00 00 00 00 00 00 00                 ...........
scottanderson commented 8 months ago

47 resolves the issue with TextProperty. The library still fails to parse the NameProperty @ 0x1c051 because we're treating property length as a 64bit value, but it appears to actually be a 32bit value. The meaning of nonzero values in the second 32bit value is unknown.

0001c050:    0d 00 00 00 4e 61 6d 65 50 72 6f 70 65 72 74   ....NamePropert
0001c060: 79 00 1d 00 00 00 01 00 00 00 00 19 00 00 00 51  y..............Q
0001c070: 55 39 31 5f 49 6e 76 65 73 74 69 67 61 74 65 54  U91_InvestigateT
0001c080: 6f 77 65 72 5f 42 32 00 05 00 00 00 4e 6f 6e 65  ower_B2.....None
0001c090: 00                                               .
scottanderson commented 8 months ago

This is partially resolved with #50, in that you can now load the attached save file. However, some of the TextProperty values will be corrupted if you try to export the file back to binary format.

scottanderson commented 6 months ago

This issue applies to save files from ACRES as well.