MCPcopy Index your code
hub / github.com/TCA166/CK3-history-extractor

github.com/TCA166/CK3-history-extractor @v2.4.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.4.7 ↗ · + Follow
391 symbols 1,358 edges 37 files 119 documented · 30% updated 15d agov2.4.7 · 2026-03-13★ 587 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CK3-history-extractor

GitHub Downloads (all assets, all releases) Example Tests

A program for generating a wikipedia of your CK3 playthrough. It goes through the lineage of every player in the save file and extracts data about every character, title, religion, culture, etc. it encounters. It even renders cool graphs that depict your history. You can preview how you can expect the result to look like in your browser here

Usage

You need to get the executable first. There are a few ways to do that. The way I recommend, is to use the precompiled binaries that I release on GitHub. This is the easiest way to get the program up and running.

You can also of course compile the program yourself. This is also openly supported and I have a makefile that should help you with that. If you are not familiar with compiling Rust programs, I recommend you check out the official Rust book. The program is written in Rust and should run on any platform that supports Rust.

You can also use the legacy Python version of the program, but I do not recommend it. You can find it here

Having made your choice and downloaded the program, you then need to find your save file of choice.

Obtaining the save file

Your save files are most likely located in your documents directory, more specifically in %USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\save games\. Having located the save file, ideally copy it over to the directory where you placed the executable. This is not strictly necessary, but it will make your life easier.

Running the program

You can run the program either from the command line or by double-clicking it. If you run it without any arguments, the program will prompt you for the save file path and the game path. Within the console interface, the program should automatically pre-fill these paths based on your system. You can modify these pre-filled paths if needed. Note that on some systems, this feature might not work as expected.

Important: Ensure that the game path you provide points to the /game subdirectory within your Crusader Kings III folder. Failing to do so will result in errors when running the program.

The tool can also be used as a command line utility. Running the tool with the --help flag will document that interface.

Mod support

This program should work just fine on modded save files. Some specific aspects may be represented inaccurately to the in game state, but that can be alleviated by providing the tool with the mods you used to play the game. The tool should automatically discover installed Steam mods and allow you to select them.

Should you use mods outside the comfy confines of Steam Workshop, your only way of loading them using command line arguments, the details of which you can learn by providing the --help flag.

Load order

Internally all provided paths (those added via include and game-path) are handled in the same way. Iteratively these paths are searched for localization and a valid map definition, with the first path provided being searched almost last. Once a valid map definition is found this definition is used and is expected to be entirely valid. The game path is loaded last. The tool shouldn't have a problem with encountering multiple map definitions, but that really should never happen.

Other similar tools

  • CK2-history-extractor is a tool like this for CK2
  • pdx_unlimiter is a tool like this, but less focused on CK3 and the history aspect. It is more of a general purpose tool for extracting data from Paradox games.

Problems

If you encounter any problems please do let me know. The best way to do that is by creating a new issue on GitHub, this will let me track them better. This also applies to feature suggestions and general feedback.

Features

  • Each in game entity will get it's own HTML page with data and links to other related entities. Characters will link to their Faith, Culture etc...
  • Faith and Culture pages will display graphs showing the amount of deaths of their members through time, which allows for rough tracking of trends within your game
  • Dynasty pages will display family trees
  • Titles will display de facto maps of their extent if applicable and the game path is provided
  • A timeline page with a graphic will display the lifespans of empires and notable events like conquests and falls of notable cities
  • A timelapse gif will show the de jure growth of the importance of your line

Development status

The tool has been rewritten using Rust. Currently I'm working on new features and bugfixes. Be sure to star this repository or watch it to get regular updates regarding the process. If you want to contribute feel free to do so! Plenty of things to be done, just read this.

License

This work is licensed under the MIT license. The text of the license is fairly self explanatory, you can find it here

Extension points exported contracts — how you extend this code

ProceduralPath (Interface)
An object whose rendered output is meant to be placed in a certain subdirectory. [GameObjectDerived], [FromGameObject] s [6 …
lib/src/display/renderer.rs
Renderable (Interface)
Trait for objects that can be rendered into a html page. Since this uses [minijinja] the [serde::Serialize] trait is als [8 …
lib/src/display/renderer.rs
Finalize (Interface)
Needs to be finalized before being used. Meant to to be implemented for different variants of [GameObjectEntity] ## Imp [6 …
lib/src/save_file/structures/mod.rs
FromGameObject (Interface)
For [GameObjectDerived] structs that are derived from a single [GameObjectMap]. [10 implementers]
lib/src/save_file/structures/mod.rs
GameObjectDerived (Interface)
A trait for objects that come from a SaveFile. Currently these include: [Character], [Culture], [Dynasty], [Faith], [Mem [12 …
lib/src/save_file/structures/mod.rs

Core symbols most depended-on inside this repo

clone
called by 169
lib/src/save_file/parser/types.rs
get
called by 140
src/args.rs
into
called by 118
lib/src/save_file/parser/section.rs
get_internal
called by 92
lib/src/save_file/parser/types.rs
push
called by 91
lib/src/save_file/parser/section.rs
as_map
called by 81
lib/src/save_file/parser/game_object.rs
inner
called by 68
lib/src/save_file/structures/mod.rs
as_object
called by 60
lib/src/save_file/parser/game_object.rs

Shape

Method 250
Function 69
Class 30
Enum 26
Interface 16

Languages

Rust100%

Modules by API surface

lib/src/save_file/game_state.rs34 symbols
lib/src/save_file/parser/game_object.rs28 symbols
lib/src/save_file/structures/title.rs23 symbols
lib/src/game_data/localizer.rs23 symbols
lib/src/save_file/parser/section.rs22 symbols
lib/src/save_file/structures/character.rs20 symbols
lib/src/display/renderer.rs20 symbols
lib/src/save_file/structures/mod.rs18 symbols
lib/src/save_file/parser/section_reader.rs14 symbols
lib/src/game_data/map.rs13 symbols
lib/src/save_file/structures/house.rs12 symbols
lib/src/save_file/structures/culture.rs12 symbols

For agents

$ claude mcp add CK3-history-extractor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact