• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Beauclerc

Captain
37 Badges
Aug 26, 2004
398
5
  • Crusader Kings II: Reapers Due
  • Sengoku
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
  • Crusader Kings III
  • Deus Vult
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
I have been developing a Savegame editor for the last couple of weeks. I’m a professional Software Engineer and I wanted to make the transition from C++ to C#... and this seemed like a good way to mix business with pleasure.

I have written my own Parser for CK game files, partly to help with the learning process and partly because I wanted more control than a third-party parser could bring. The Parser converts the savefile into a class library representing the game entities, and it writes it all back in the CK format (incorporating any changes made to the data).

I heard that some people were having problems with Character Pruners in 1.05, so tonight I thought I’d extend my library and create some pruning functionality. I managed to complete it, and lo and behold it seems to work. I pruned a file, and it ran in CK without any problems (I let it run on for a bit).

This is what it does:

1/ Deletes any character who is dead, and never produced any children
2/ Deletes characters who’s only children are those that have been deleted during the processing
3/ Deletes marriages involving the characters deleted
4/ Retains characters who are Attackers or Defenders in any wars stored in global data

I’m not sure about this final rule. The game may remove any wars involving dead characters, and if anyone knows if this is the case then please let me know. If no-one knows I will try and work this out myself by examining the files. I do not check Alliances and Truces because I assume the game removes them when a character dies.

Does anyone know of any other potential cross-references that I may not have accounted for?

I reduced a savegame file I had that was 22mb down to 13mb (I don’t wipe out white space) and pruned about 8000 of the 14000 dead characters. It’s pretty quick too… taking about 12 seconds on my pc (that includes the parsing of the file... the pruning on it's own takes about 2 seconds).

I haven’t written an interface for the Pruner yet, and when I do I will add an additional feature that allows you to exclude any characters belonging to a particular dynasty. This will allow your own Dynasty within the game to remain intact, in case you want to create full family trees (it will still destroy characters descending from the female line though… sorry but that would be very tough to implement).

The bad news with all this is that when I release this application (after some more testing) anyone who wants to use it will need to have the .NET Architecture version 2.0 installed on their machine. It’s a massive download… but useful for more than just this app I guess.

If anyone is interested in this application, let me know and I will try and get a verstion released. You might also like to provide some suggestions for some features you might find useful.
 
Oct 27, 2002
1.075
0
Visit site
Do you do it recursively?
I mean do you repeat steps 1-4 until there are no childless dead characters?
I seem to remember that someone used such a technique...

Anyway, good work!
 

Beauclerc

Captain
37 Badges
Aug 26, 2004
398
5
  • Crusader Kings II: Reapers Due
  • Sengoku
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
  • Crusader Kings III
  • Deus Vult
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Fat: Yes it does do it recursively. However, it doesn't need to go through a series of passes... it only needs one.

Drachenfire: this is a character pruner. It removes all extraneous characters from the game that litter the savegame file. This reduces the size of the files, speeds up loading/saving times and hopefully speeds the game up too. So no, you won't be able to create queens with it! :eek:

My Savegame editor is still a little way off...
 
Oct 27, 2002
1.075
0
Visit site
Ah, so it works something like this:

Check if character is dead and has no children.
If so, remove him and check if his parent fills the same criteria.
If so, remove the parent and check his parents...

I was thinking it works like this:
Remove characters that are dead and have no children.
Was anyone removed?
If so, do it again.

The second method is sort of horizontal and the first one is vertical, if you know what I mean. :rolleyes:
 

Beauclerc

Captain
37 Badges
Aug 26, 2004
398
5
  • Crusader Kings II: Reapers Due
  • Sengoku
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
  • Crusader Kings III
  • Deus Vult
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Basically, I set a counter for all the characters, determining how many children they have. I then enumerate through the dead characters, and if they have no children, set them as deleted and decrement their parents' child counters by one. If the parent now has no children, repeat the process until I find a parent who survives... then I work back to the next dead character, and so on...

Very fast... and seems to be very thorough.
 

gigau

Imperare Orbis Universi
Moderator
218 Badges
May 4, 2005
43.560
8.243
47
www.twitch.tv
  • Imperator: Rome Deluxe Edition
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • Victoria 3 Sign Up
  • Hearts of Iron IV: Colonel
  • Stellaris: Galaxy Edition
  • 200k Club
  • 500k Club
  • Paradox Order
  • PDXCON 2017 Gold Ticket holder
  • PDXCON 2018 "The Emperor"
  • PDXCon 2019 "King"
  • PDXCon 2017 Awards Winner
Looking forward having it :cool:
 

Sarmatia1871

Field Marshal
56 Badges
Mar 22, 2004
3.889
352
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: El Dorado
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Deus Vult
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Hearts of Iron II: Armageddon
  • Europa Universalis IV: Wealth of Nations
  • Heir to the Throne
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
:D Sounds very good!

Another thing which would be very useful would be a programme which deletes claims -> As these are continually inherited and maintained throughout the game at present, after 150-200 or so years of playing the number held by each major character gets to such truely ridiculous levels that I often find myself going through the savegame and deleting all of them manually!
 

binTravkin

Annoying Latvian
29 Badges
Aug 18, 2004
3.243
19
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • 500k Club
  • Victoria 2: A House Divided
  • Victoria 2
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Crusader Kings II
  • Heir to the Throne
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
Wow, I just corruptedmy savegame with the old ck-purge, so it's really cool, you're making a new one. :)

Being a software engineer myself, I'd like to have a look at the code too, if you ever decide to make it public. :)
 

Beauclerc

Captain
37 Badges
Aug 26, 2004
398
5
  • Crusader Kings II: Reapers Due
  • Sengoku
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
  • Crusader Kings III
  • Deus Vult
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Sarmatia1871 said:
:D Sounds very good!

Another thing which would be very useful would be a programme which deletes claims -> As these are continually inherited and maintained throughout the game at present, after 150-200 or so years of playing the number held by each major character gets to such truely ridiculous levels that I often find myself going through the savegame and deleting all of them manually!
I do delete the claims for the characters being deleted. Not sure about the option you suggest though... as surely the claim inheritance is intended?

How would the application choose which claims to wipe out? Once the claim is passed on to the heir, the game then attaches the claim to the new character's id - so their inherited claims can't be distinguished from the ones they've created themselves.

If you can think of an algorithm to perform this task, then I'll look to put it in.
 

Beauclerc

Captain
37 Badges
Aug 26, 2004
398
5
  • Crusader Kings II: Reapers Due
  • Sengoku
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
  • Crusader Kings III
  • Deus Vult
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
I have used this application on my own save game a number of times now, and I've yet to have a problem with it ingame. CK has always loaded the pruned file without any problems, and the game has contuinued happily. Of course, there may be some nasties lurking in there somewhere... but so far things are encouraging.

Still to write an interface for it... but will do this soon. I have also written the processing for a BrideFinder for 1.05 now as well.
 

gigau

Imperare Orbis Universi
Moderator
218 Badges
May 4, 2005
43.560
8.243
47
www.twitch.tv
  • Imperator: Rome Deluxe Edition
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • Victoria 3 Sign Up
  • Hearts of Iron IV: Colonel
  • Stellaris: Galaxy Edition
  • 200k Club
  • 500k Club
  • Paradox Order
  • PDXCON 2017 Gold Ticket holder
  • PDXCON 2018 "The Emperor"
  • PDXCon 2019 "King"
  • PDXCon 2017 Awards Winner
Beauclerc said:
I do delete the claims for the characters being deleted. Not sure about the option you suggest though... as surely the claim inheritance is intended?

How would the application choose which claims to wipe out? Once the claim is passed on to the heir, the game then attaches the claim to the new character's id - so their inherited claims can't be distinguished from the ones they've created themselves.

If you can think of an algorithm to perform this task, then I'll look to put it in.



All claims have a specific id. If i'm correct, the smallest ids are for the first claims to be grabbed.
So, i don't know if it's possible, but the application could wipe out the claims with the X smallest ids.
 

Reveilled

Intermittant poster
70 Badges
Sep 14, 2004
1.067
0
  • Stellaris Sign-up
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Stellaris: Nemesis
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
Beauclerc said:
I'll see about getting the interface done this week. I have to find spare time to do it... :)

j00 are t3h r0xxor. :cool:

As to the claims thing, I think that after a few hundred years, when lots of claims have built up, some people just like to wipe the slate clean and continue with no claims by anyone on anything.

If you can do it, I would suggest that a savegame editor should be able to wipe claims of a particular person, a particular tag (so everyone in that tag's court loses claims), a particular tag as well as all that tag's lieges (so this sort of wipe for SCOT would remove all claims of Scotland's king, his court, his vassals, his vassal's courts, etc.), a particular religion, or a particular culture. Similarly, it should be able to do it in reverse, and remove all claims on a person (the provinces they own, really), tag, tag and liege, religion or culture. Finally, it should probably be able to do those, but make exceptions for claims involved in wars (so if England and Scotland are in a war, and you wipe the claims of the whole of Scotland, you should be able to wipe everything except their claims on places in England).

I'm not sure how practical any of that is, not being a programmer. :)
 

binTravkin

Annoying Latvian
29 Badges
Aug 18, 2004
3.243
19
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • 500k Club
  • Victoria 2: A House Divided
  • Victoria 2
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Crusader Kings II
  • Heir to the Throne
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
Still to write an interface for it... but will do this soon. I have also written the processing for a BrideFinder for 1.05 now as well.
You could also release commandline version for those who are so eager they are ready to use it on cmd :)