#ironman #imperator

bin+lib imperator-save

Ergonomically work with Imperator Rome saves (debug and ironman)

11 releases

0.2.7 Jul 4, 2021
0.2.6 May 29, 2021
0.2.4 Apr 29, 2021
0.2.2 Mar 14, 2021
0.1.0 Sep 17, 2020

#272 in Game dev

Download history 106/week @ 2021-05-27 60/week @ 2021-06-03 54/week @ 2021-06-10 44/week @ 2021-06-17 43/week @ 2021-06-24 79/week @ 2021-07-01 50/week @ 2021-07-08 56/week @ 2021-07-15 56/week @ 2021-07-22 67/week @ 2021-07-29 64/week @ 2021-08-05 62/week @ 2021-08-12 44/week @ 2021-08-19 43/week @ 2021-08-26 27/week @ 2021-09-02 25/week @ 2021-09-09

289 downloads per month

MIT license

30KB
644 lines

ci Version

Imperator Save

Imperator Save is a library to ergonomically work with Imperator Rome saves (debug + standard).

use imperator_save::{ImperatorExtractor, Encoding};
use std::io::Cursor;

let data = std::fs::read("assets/saves/observer1.5.rome")?;
let reader = Cursor::new(&data[..]);
let (save, encoding) = ImperatorExtractor::extract_save(reader)?;
assert_eq!(encoding, Encoding::Standard);
assert_eq!(save.header.version, String::from("1.5.3"));

ImperatorExtractor will deserialize standard Imperator saves as well as those saved saved with -debug_mode (plaintext).

Ironman

By default, standard saves will not be decoded properly.

To enable support, one must supply an environment variable (IMPERATOR_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.7–2.4MB
~54K SLoC