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

Turn Actions #9

Open
rweber89 opened this issue Sep 8, 2018 · 7 comments
Open

Turn Actions #9

rweber89 opened this issue Sep 8, 2018 · 7 comments

Comments

@rweber89
Copy link

rweber89 commented Sep 8, 2018

Hello,

so I took a look at the source code - and I didn't see support for parsing specific turn actions. Given the increasing size of savegames as the game goes on I assume turn actions are saved, or atleast end of turn data for statistical reasons.

I am wondering if you are working on trying to parse those?

@mrosack
Copy link
Member

mrosack commented Sep 8, 2018

There's two types of data in the civ save files, some simple key/type/value information (which is what this library currently parses), and large chunks of compressed data. I haven't figured out how to read the compressed parts, and I'd assume data like you're looking for is in the compressed areas. If I knew how to read the compressed areas I'd definitely try to add that information.

@rweber89
Copy link
Author

I assume this is the "Unknown Compressed Data" part? Does the parser currently parse everything else?

I saw that line come up twice in the command line and I'm not sure if those were all the occurences in the file? There's a huge block of data like this for most of the file, is that included?

Also currently the zlib part is never reading any zlib compressed information? Or maybe I just didn't have the right kind of save? I only used a normal Multiplayer save.

Are you able to decomrpess the compressed data part? Or do you not even know how it is compressed?
If it were possible to somehow display the decompressed version then I might be interested in taking a look.

@mrosack
Copy link
Member

mrosack commented Sep 10, 2018

Yes, currently the parser only parses the non-compressed data. You can look at the compressed data by using the --outputCompressed flag (there was just a bug fixed in master to make this work with more recent node versions).

@rweber89
Copy link
Author

By the bug you mean the part that's supposed to write to the filename.bin file? I had to remove the code because it wasn't working at all. If that's fixed then I'll update and remove my changes.

So does it just write the compressed data to the file or does it write it to file decompressed?

@mrosack
Copy link
Member

mrosack commented Sep 10, 2018

It writes decompressed.

@rweber89
Copy link
Author

I just updated and I am getting an error where it was previously running without errors.

Errror: invalid distances set at Unzip.zlibOnError (zlib.js:153:15) errno: -3, code: 'Z_DATA_ERROR'

Here's a link to the uploaded savefile: http://www.mediafire.com/file/vwfwfxn8cp7hux7/test.civ6save/file

@mrosack
Copy link
Member

mrosack commented Sep 13, 2018

I did a bit more cleanup and added some unit tests for compression in master, but some files just don't seem to decompress correctly (including the one you uploaded to mediafire). Out of the 13 files in the test/saves directory, 2 of them fail to decompress. I tried using pako as well to see if it was an issue with node's zlib, but I get similar errors.

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

No branches or pull requests

2 participants