3

I've just noticed that some .ck2 savegames take more or less 10x of some others, during the same match (~45MB vs ~4.5MB).

I've tried to compress them, and the bigger one compresses down to a little smaller than the smaller one (~4MB), while the smaller one stays the same. This is a very strong indication that the smaller one is compressed.

Now… why are some of them compressed and some others aren't. Which causes that? Is that a "quick save" vs. "regular save" behaviour?

Can I somehow compress the uncompressed ones, so that they are still directly readable by the game?


I've noticed that the uncompressed ones are text files, while the compressed ones start with the code "PK", so I've listed its content using unzip and it gave a somewhat promising result:

-rw-------  1 lohoris  wheel  46122334 Dec 26 16:25 Eire1127_08_25.ck2
-rw-------  1 lohoris  wheel   4498940 Dec 26 16:25 Eire1125_08_17.ck2
lohoris@Pirenne:/tmp$ unzip -l Eire1125_08_17.ck2
Archive:  Eire1125_08_17.ck2
  Length     Date   Time    Name
 --------    ----   ----    ----
 45466533  00-00-80 00:00   Eire1125_08_17.ck2
      109  00-00-80 00:00   meta
 --------                   -------
 45466642                   2 files

However I wasn't able to uncompress them from command line:

lohoris@Pirenne:/tmp$ unzip Eire1125_08_17.ck2
Archive:  Eire1125_08_17.ck2
   skipping: Eire1125_08_17.ck2      need PK compat. v4.6 (can do v2.1)
   skipping: meta                    need PK compat. v4.6 (can do v2.1)

At this point I got lost trying to uncompress it, so before investigating further I'll just wait to see if someone already has some answer.


So, let's recap, questions:

  • in which circumstances does the game sometimes create compressed files, sometimes uncompressed?
  • can I turn the uncompressed ones into compressed, so that the game natively reads them correctly (obviously I can compress and decompress them, that's not what I'm asking)
  • This would require developer knowledge to know why en when it compresses a savegame. – Arperum Dec 26 '14 at 16:23
  • 2
    @Arperum nope, totally doesn't require such knowledge: it could easily have already been tested by users by trial and error. And the savegame format could have been reverse-engineered. So it's definitely answerable. – o0'. Dec 26 '14 at 16:29
  • 1
    Also, in a slightly less on-topic vein: have you tried installing and using p7zip to decompress the saves? – Schism Dec 26 '14 at 19:40
  • 3
    Ugg... you don't need to speculate about developer intent to answer this question. If you're going to close questions like this you might as well just ban any question with the word "why" in it. – Ross Ridge Dec 26 '14 at 23:00
  • 1
    @Schism doing the reverse-engineering may be out of scope, but using available data reverse-engineered by others definitely isn't. Same thing for the trial-and-error. Anyway I got my answer, which proves my question was ok, but if you want to keep it closed, suit yourselves… – o0'. Dec 28 '14 at 11:48
8

By default Crusader Kings 2 compresses (a) ironman games and (b) non-ironman games saved using the "Save Game" menu item. There is an unlabeled checkbox (checked by default) that controls the latter.
CK2 manual save UI showing unlabeled checkbox

It does not compress non-ironman games saved by other means. That is, games saved using "Quick Save", "Save & Quit" and auto saves aren't compressed. Enabling "Compress Autosaves" setting in the "Game" options will compress any future auto saves, but "Quick Save" and "Save & Quit" will still create uncompressed saves.

To compress an existing uncompressed save simply load it in the game and then save it again using "Save Game". You can also create compressed save files on the command line, but you'll need a a version of the zip command that supports bzip2 compression. Something like this:

zip -m -Z bzip2 -X mysave.ck2 autosave.ck2

The -m option causes zip to delete autosave.ck2 after it compresses the file. Don't try give the compressed save game the same file name as the uncompressed save. If you want it to have the same name just rename it after compressing it. The -X option tells zip not to include file meta data (eg. permissions) that seem to confuse Crusader Kings 2, at least on Windows.

Another option, if you're using Windows, is to enable NTFS folder compression on the game's save game directory. Windows will then automatically compress all files in the folder automatically, though not as well the game would. There might be similar functionality available for Mac OS X and Linux.

  • Want to point out that there's an (unlabeled) checkbox in the save game menu to compress or not compress manual saves. – Affine Dec 27 '14 at 21:25
  • @affine Yah, I noticed that late last night, but didn't have time to update the post. Thanks for the edit. – Ross Ridge Dec 27 '14 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.