Oliver Guinnes
07.08.04, 14:01
Ein Regent in den Paradoxhallen hat ein auch hier schon gefordertes Programm zur Bereinigung der Savegames geschrieben:
Thread (http://www.europa-universalis.com/forum/showthread.php?t=160571)
Zur Downloadseite (http://www.lysator.liu.se/~klas/CK/)
I finally finished a program (called ck-clean) that cleans out some unnecessary people from a CK save file. Since CK holds all characters in memory the game may run slowly on computers without lots of memory late in the game. This program can hopefully help to solve that problem.
The program works by removing characters that fulfills all of the following conditions:
- The character is dead
- The character doesn't have a living parent
- The character was never married or was married only to characters who will also be deleted
- The character doesn't have any living children
- The character doesn't have any living siblings
- The character doesn't hold a title (yes, dead people can hold titles savegame-wise)
The current version of ck-clean can't check if a character is the ruler of a country. I hope that there are no dead characters that are rulers and holds no titles.
The marriage structures that includes deleted people are also deleted from the save file. There are some marriages where one or both of the married people doesn't exist. Marriages like that are also removed by ck-clean. Claims held by a deleted character are also deleted.
It may be a good idea to run the program directly after scenario start because the buggy marriages in the scenario setup may stop some characters from getting married.
The program has an option to exclude one dynasty from deletion, so you can keep your own family tree intact on the male side.
Some results from running ck-clean on a 17.4 Mb save file from 1139 (started 1066 of course):
- 2275 of 19845 characters removed
- 565 of 4413 marriages removed (of which 7 are buggy)
- 97 of 4742 claims removed
- 4.1 Mb saved by removing whitespace
- 1.2 Mb saved by removing characters, marriages and claims
- Running time was 35 seconds on a 166 MHz Pentium
The program was written in C under Linux, but it should be easy to compile it under UNIX and BSDs (including MacOS X) too. There is probably more work involved if you want to compile it under Windows. My best bet is that you can use Cygwin. You need the gcc, make, flex and bison tools or non-GNU equivalents. I will not port the program to Windows but I would be happy if someone else tried to. I will not provide binaries of the program, only source code.
Just to be 100% clear: This program does not work under any version of Microsoft Windows.
It would be really neat if someone with a lot of bandwidth to spare could set up some sort of web script (CGI/PHP/whatever) so that people could upload their save file and get a cleaned file back. I belive that would be easier to do than creating a GUI and port the program to Windows.
The program is distributed under the GPL license. That roughly means that you can use it, modify it and distribute it freely. If you distribute modified versions you MUST however also distribute the modified source code and you must distribute it under GPL.
I intended the program to be easy to modify, so other projects that deals with reading (parsing) and writing CK savegame files can be based upon it. Please feel free to create your own bride finder, EU2 exporter or whatever you like based on this program. I suggest you announce your work in this thread (and possibly elsewhere) so that everyone can find it.
I will not do much support for the program. If you can't make it work don't expect me to answer your questions (feel free to ask though). If I find any good bug reports or patches in this thread I may perhaps fix them. Don't expect me to. If you want to actively maintain, support or host the program, instead of me, please do that. You don't need to ask me for permission before you do, it's free software.
Since I haven't done a lot of testing and only used a very limited set of save files there is a big chance that things won't work properly for you. Don't throw away your original file before you have seen that the cleaned file loads (and then saves!) properly and doesn't cause any crashes for a in-game human lifetime or something.
The betas may be intrested in the ck-errors program that is included in the same package. It looks for errors origin from scenario startup files.
Coming later: A program that looks for inheritance opportunities.
You can download the package from http://www.lysator.liu.se/~klas/CK/
:gluck:
p.s.: Scheint nur unter Linux zu laufen.
Thread (http://www.europa-universalis.com/forum/showthread.php?t=160571)
Zur Downloadseite (http://www.lysator.liu.se/~klas/CK/)
I finally finished a program (called ck-clean) that cleans out some unnecessary people from a CK save file. Since CK holds all characters in memory the game may run slowly on computers without lots of memory late in the game. This program can hopefully help to solve that problem.
The program works by removing characters that fulfills all of the following conditions:
- The character is dead
- The character doesn't have a living parent
- The character was never married or was married only to characters who will also be deleted
- The character doesn't have any living children
- The character doesn't have any living siblings
- The character doesn't hold a title (yes, dead people can hold titles savegame-wise)
The current version of ck-clean can't check if a character is the ruler of a country. I hope that there are no dead characters that are rulers and holds no titles.
The marriage structures that includes deleted people are also deleted from the save file. There are some marriages where one or both of the married people doesn't exist. Marriages like that are also removed by ck-clean. Claims held by a deleted character are also deleted.
It may be a good idea to run the program directly after scenario start because the buggy marriages in the scenario setup may stop some characters from getting married.
The program has an option to exclude one dynasty from deletion, so you can keep your own family tree intact on the male side.
Some results from running ck-clean on a 17.4 Mb save file from 1139 (started 1066 of course):
- 2275 of 19845 characters removed
- 565 of 4413 marriages removed (of which 7 are buggy)
- 97 of 4742 claims removed
- 4.1 Mb saved by removing whitespace
- 1.2 Mb saved by removing characters, marriages and claims
- Running time was 35 seconds on a 166 MHz Pentium
The program was written in C under Linux, but it should be easy to compile it under UNIX and BSDs (including MacOS X) too. There is probably more work involved if you want to compile it under Windows. My best bet is that you can use Cygwin. You need the gcc, make, flex and bison tools or non-GNU equivalents. I will not port the program to Windows but I would be happy if someone else tried to. I will not provide binaries of the program, only source code.
Just to be 100% clear: This program does not work under any version of Microsoft Windows.
It would be really neat if someone with a lot of bandwidth to spare could set up some sort of web script (CGI/PHP/whatever) so that people could upload their save file and get a cleaned file back. I belive that would be easier to do than creating a GUI and port the program to Windows.
The program is distributed under the GPL license. That roughly means that you can use it, modify it and distribute it freely. If you distribute modified versions you MUST however also distribute the modified source code and you must distribute it under GPL.
I intended the program to be easy to modify, so other projects that deals with reading (parsing) and writing CK savegame files can be based upon it. Please feel free to create your own bride finder, EU2 exporter or whatever you like based on this program. I suggest you announce your work in this thread (and possibly elsewhere) so that everyone can find it.
I will not do much support for the program. If you can't make it work don't expect me to answer your questions (feel free to ask though). If I find any good bug reports or patches in this thread I may perhaps fix them. Don't expect me to. If you want to actively maintain, support or host the program, instead of me, please do that. You don't need to ask me for permission before you do, it's free software.
Since I haven't done a lot of testing and only used a very limited set of save files there is a big chance that things won't work properly for you. Don't throw away your original file before you have seen that the cleaned file loads (and then saves!) properly and doesn't cause any crashes for a in-game human lifetime or something.
The betas may be intrested in the ck-errors program that is included in the same package. It looks for errors origin from scenario startup files.
Coming later: A program that looks for inheritance opportunities.
You can download the package from http://www.lysator.liu.se/~klas/CK/
:gluck:
p.s.: Scheint nur unter Linux zu laufen.