#ironman #ck3

bin+lib ck3save

Ergonomically work with all CK3 saves (regular and ironman)

13 releases

new 0.2.7 May 4, 2021
0.2.6 May 3, 2021
0.2.5 Apr 29, 2021
0.2.2 Mar 14, 2021
0.1.1 Sep 12, 2020

#175 in Game dev

Download history 64/week @ 2021-01-13 98/week @ 2021-01-20 133/week @ 2021-01-27 185/week @ 2021-02-03 74/week @ 2021-02-10 96/week @ 2021-02-17 48/week @ 2021-02-24 50/week @ 2021-03-03 91/week @ 2021-03-10 49/week @ 2021-03-17 62/week @ 2021-03-24 52/week @ 2021-03-31 57/week @ 2021-04-07 74/week @ 2021-04-14 115/week @ 2021-04-21 117/week @ 2021-04-28

344 downloads per month
Used in ck3json

MIT license

41KB
867 lines

ci Version

CK3 Save

CK3 Save is a library to ergonomically work with Crusader Kings III (CK3) saves (ironman + regular).

use ck3save::{Ck3Extractor, Encoding};
use std::io::Cursor;

let data = std::fs::read("assets/saves/Jarl_Ivar_of_the_Isles_867_01_01.ck3")?;
let reader = Cursor::new(&data[..]);
let (save, encoding) = Ck3Extractor::extract_save(reader)?;
assert_eq!(encoding, Encoding::TextZip);
assert_eq!(save.meta_data.version, String::from("1.0.2"));

Ck3Extractor will deserialize both plaintext (used for mods, multiplayer, non-ironman saves) and binary (ironman) encoded saves into the same structure.

Ironman

By default, ironman saves will not be decoded properly.

To enable support, one must supply an environment variable (CK3_IRONMAN_TOKENS) that points to a newline delimited text file of token descriptions. For instance:

0xffff my_test_token
0xeeee my_test_token2

In order to comply with legal restrictions, I cannot share the list of tokens. I am also restricted from divulging how the list of tokens can be derived.

Dependencies

~1.5–2.2MB
~48K SLoC