I've been developing the Imperator:Rome to CK II converter from the ground up for a few months, and the current version is now uploaded to GitHub.
Design:
Independent countries in Imperator:Rome are converted as dynamically generated kingdom tier realms, and regional governorships are converted as duchy titles underneath the main country.
CK II Province ownership, culture, religion, and buildings are determined by the combined amount of pops that make up the territories which fill up that CK II province. If the majority of pops of a group of territories that make up a CK II province are Hellenic Romans ruled by Rome, for example, that province in CK II will be Hellenistic, Roman, and owned by Rome, even though there might have been be a few Etruscans or Druidic Lepontic Gauls living there. If no country owns any of the land in Imperator, an independent one province tribal chiefdom will be generated there for CK II.
CK II's economy is based off of buildings and holdings, so pops are translated as buildings. If a combined CK II province has reached a threshold of Imperator pops, a building will be built. I arbitrarily made these numbers, but because pop totals can range from 0-1,000 in Imperator, the threshold for each holding and empty holding get's higher then the last.
There are two starting dates that are generated: 100 AD and 1066 AD. Unfortunately CK II's engine can't handle characters born before 1 AD, and the earliest I could set it without worrying about having to change most characters' ages was 100 AD. 100 AD is still enough time to simulate the spread of Christianity, the migration era, and the rise of Islam. Countries outside of Imperator's map will be filled with what was historically there, although creating still needs to be done. Because 100-1400 AD is a long time to play the game, I've added a second start date at the game's vanilla start, right at the onset of the crusades. Countries outside of the map are filled with their 1066 counterpart.
Implementation:
The converter is programmed in Java. The Main class is the primary call for the program, and will store and process much of the information needed to convert. There is currently no GUI for the converter, but until one is developed all commands are entered through the console when the converter asks for them.
Imperator:Rome saves are massive when compared to most other Paradox games, sometimes going as high as 9 million lines, which would take hours or days to parse through and get the information needed to create a conversion mod. This problem has been bypassed by having the TempFiles class going through the original file and breaking it up into smaller, more manageable pieces stored in the main program folder as temporary text files. These temporary text files are tempCharacters.txt for the characters, tempDynasty.txt for the character dynasties, tempCountries.txt for countries, and tempProvinces.txt for the provinces.
Once the temp files are created, Importer.java can go through and import information from each temp file, and then send that information over as string arrays. Importer.java will also import information from conversion tables, such as cultureConversion.txt and religionConversion.txt
Directories.java deals with creating the directories and .mod files required for a CK II mod in the documents/mod folder. Processing.java deals with most tasks related to processing that aren't handled by main, such as localisation and which Imperator provinces belong to a governorship. Characters.java deals with processing characters. The method which creates characters calls on itself recursively whenever it finds a family member, so if a ruler is converted, they'll have all of their relatives converted as well.
Output.java will output the stored information directly to the CK II mod directories, such as country information and character information. Determined by main, only the countries and characters(and their families) which have land when will be converted to the mod. If the country of Olbia fully annexes Rome, for example, the title k_ROM will not be generated. This is to save performance, since those titles would never be accessible in-game either way.
TestQ.java is just for random testing and for converting HSV colors used in Imperator files (such as culture and religion) to RGB, which makes it more convenient to create the new cultures and religions.
Problems/TODO:
Not all of the provinces, religions, and cultures have been mapped yet.
There's a bug on the 1066 start date which causes a crash to desktop after running for a few days. I suspect it's because of characters at war with armies who have become landless by the converter, but I haven't investigated it.
All governments are converted as feudal or tribal, and republics should have a custom playable government type.
Images and flags don't convert, Imperator:Rome generates flags in-game from several .tga and .dds files, but sadly I haven't been able to figure out how to manipulate images in Java.
Governorship titles beneath the main country show up as independent countries in the start screen. I suspect that they need to be listed under the country in common\landed_titles, but I haven't been able to test it.
There aren't any completed events for the rise of Christianity, the great migrations, rise of Islam, or other occurrences to simulate the era.
The GUI interface hasn't been worked on.
The children of converted characters don't have a religion, and sometimes have a mismatched dynasty.
Compatibility:
The converter is currently compatible with Imperator:Rome versions 1.3-1.5, and the final version of CK II. It should be compatible with future versions of Imperator:Rome unless the save structure changes