• 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.

Idhrendur

Keeper of the Converters
108 Badges
Feb 27, 2009
11.995
4.212
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II
  • Hearts of Iron IV: By Blood Alone
  • Victoria 3 Sign Up
  • Stellaris: Nemesis
  • Sengoku
  • Pillars of Eternity
  • Tyranny: Archon Edition
  • Europa Universalis IV
  • March of the Eagles
  • Victoria 2
  • 500k Club
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Colonel
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Crusader Kings III: Royal Edition
  • Commander: Conquest of the Americas
  • Darkest Hour
Continuing a long tradition of mine on the forums, I am creating the CK2 to EU3 converter project. This converter will allow you to take a game from the end of CK2 and convert it into a playable EU3 save, continuing your game. It should be compatible with the EU3 to Vic2 converter.

This project is now abandoned, though if any ambitious people want to try to update it, I can direct them appropriately. It was last known to work with saves before RoI.

What we need:
Programmers - the project is in C++, and I can think of some analysis that'd be easy in something like python (or perl, or other very high level languages). If you're skilled in those, we could use you!
Modders - we've some cool ideas for the converter mod, but we need people to implement them.
Province Mappings - Everything is mapped, but needs review.
Other mappings - Culture mappings could use expertise from non-Americans!

Important Links:
Github Page
Download Link
Converter Mod
CK2+ modifications
Flavourful Titular Titles modifications

Frequently Asked Questions
Q: Will this work with CK2 mod X or EU3 mod Y?
A: There are updated data files for CK2+, see the link above. As for other mods, maybe. We aren't developing the converter with mods in mind, so few will likely work out of the box. However, much of the raw data is pulled from the game installations or our rule files, so it could be adapted for many mods. Any of this work will be left to the creators or the fans of those mods, though we will gladly provide guidance.

Q: Why do most of the country names turn out funny?!
A: There simply aren't enough nations in EU3 to cover all the potential nations that might exist by the end of a CK2 game. Short of making an EU3 that includes over 1000 new nations, there's nothing much to do but assign a CK2 nation an unused EU3 nation. Nations that have direct EU3 versions will convert correctly (So England should become England, France should become France and so on). While we will be improving the converter so that you will at least gain a nation of the correct culture or region, this issue will probably never be completely solved. Fear not, as all gameplay-relevant values will be converted correctly (names are largely cosmetic). (from this post).

Q: The converter didn't work. What's wrong?
A: The converter is a work in progress, so there's a good chance you found a bug. Please post about it. Include a description of what did or didn't happen, the versions of CK2 and EU3 you are running, the information in log.txt (copy and paste it, but wrap it in [ code ] [ /code ] tags), and if possible, a link to the save you're trying to convert. These will help us determine what happened.

Q: I'm getting an error that says "Too many CK2 nations". What's wrong?
A: There are fewer EU3 tags available than there are CK2 titles. In this case, your save has more independent titles than there are available tags. That means there's no way for us to map countries properly, and we can't convert. While long-term we may be able to ease this a little, this will be a possibility even when the converter is complete. If it's not 1453 yet in your save, try playing for longer in the hope nations consolidate a bit more.

Q: The converter can't open 'adjacencies.bin'. What do I do?
A: Regenerate your map cache.

Q: I get an error that says "Error: Could not open C:\Program Files (x86)\Steam\steamapps\common\europa universalis iii - complete/mod/Converter/common/religion.txt". What does that even mean?
A: The converter is trying to check the converter mod's religions file. If you don't have the mod, you'll see this error. However, it causes no harm. You can just ignore it.
 
Last edited:
Important discussions

Being Able To Submit Code/Data Changes
How to interact with the source code repository
Merging Changes to the Repository
Mapping various items
Province Mapping

Code Examples:
Importing Data
Outputting a Portion of a Save

File Formats:
Characters and Dynasties
Titles
Advisors
Adjacencies.bin

Useful Tools
Province Mapping Tool
Map of CK2 Province Numbers

Conversion Methods
Province Ownership
Character Stat Conversion
Advisor Conversion
Cultural Conversion
Culture Mapping Rules
Religious Conversion
Trade Good Conversion
Province and Capital City Names Conversion
Determining Heirs
Primary Culture Conversion
Accepted Culture Conversion
National Religion Conversion
Legitimacy
Infamy
Starting Agents
Stability
Cores
Vassal Independence
Converting Governments
HRE Conversion
Population, Base Tax, and Manpower conversion
Horde Conversion

Open Questions
ROTW provinces historically owned by CK2 nations ( 1 2 )
Sliders ( 1 2 3 4 )
Technology Conversion ( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 )
CoT Conversion ( 1 2 3 4 5 6 7 )
Army Conversion ( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)
Trade Leagues ( 1 2 3 )
Tradition [Army/Navy/Culture] Conversion ( 1 2 3 4 5 6 )
Prestige ( 1 2 3 4 )
Money ( 1 2 3 4 5 6 7 8 9 )
Relationships ( 1 2 3 )
IN Support ( 1 2 3 )
Manpower ( 1 )
Off-map Horde Provinces ( 1 2 3 4 5 )
Vassals at war with their lieges ( 1 2 3 )
Merchant Republics: ( 1 2 3 4 5 )
Buildings: ( 1 2 3 )

Converter Mod Ideas
Auto-generate tags ( 1 2 3 4 5 6 7 )
Events for Heresies ( 1 )
Update Colors for Religions ( 1 )
Adjust Missions and Events ( 1 )
Include Kingdoms and Empires in Mod ( 1 2 3 4 5 6 7 8 )
Adjust Flags and Country Names ( 1 )

Frontend
Overall discussion ( 1 2 3 4 5 6 7 8 9 10 11 )

Unresolved Bugs/Crashes/Oddities
When converting provinces, trying to set distant overseas before owner capital is determined?
Incorrectly importing province history
HRE territory assigned, even if HRE title no longer exists
HRE members don't get cores on disputed territory?
Papacy sometimes converts with wrong government (if vassal, perhaps?)
Advisors start in no tech group

Todo For Next Release

Todo Soon
Add 'ensure remains independent' converter option?
De jure shift counts towards getting cores

Todo at Relevant Release

Last Linked Post (for updating this post)
http://forum.paradoxplaza.com/forum...er-Project&p=15428164&viewfull=1#post15428164
 
Last edited:
Glad to see you are at it Idhrendur! =)
I won't commit because I know there won't be enough time, but I do wish you best of luck because I know I will be using this a lot. =)
By the way, I'm assuming you'll be converting to DW, right?
 
Is there any plans for converting to Magna Mundi when it comes out?
 
I can help you with saves. I'll upload one now from 1453.

I can probably also help with culture mappings, province mappings and so on.


edit: http://www.gamefront.com/files/21346762/Ostergotland.rar.

Your save is now part of my automated tests. Not that they do much at the moment other than prove the tests run, but it'll be useful soon enough.

As for the mappings, I'll write up some instructions in just a bit. For now, it'd be helpful if you get a sourceforge account and install some type of Mercurial tool (I prefer Tortoise Hg) so you'll be able to make changes to the repository itself. I'll likely include instructions about all that, too.

Glad to see you are at it Idhrendur! =)
I won't commit because I know there won't be enough time, but I do wish you best of luck because I know I will be using this a lot. =)
By the way, I'm assuming you'll be converting to DW, right?

Yep, aiming for DW, at least at first. It may be possible to downgrade the conversions at some point, but we'll have to see.

Committed analyst reporting. Point in the direction of a problem, and let me at it! :D

Glad to have you on board! I've added you to the SourceForge project. I guess a good start is to determine the minimal EU3 save we can construct and have it load up in game. The sooner we can check our work by loading it up, the better.

Is there any plans for converting to Magna Mundi when it comes out?

Not as such, but it may be doable. We'll have to see in the end.
 
As for the mappings, I'll write up some instructions in just a bit. For now, it'd be helpful if you get a sourceforge account

I have done so, under the name of "tamius".

and install some type of Mercurial tool (I prefer Tortoise Hg) so you'll be able to make changes to the repository itself. I'll likely include instructions about all that, too.

You've lost me. :confused:
 
Instructions for working with the source repository

Preparing a local repository
First of all, go download and install Mercurial Hg. Install the version that's correct for your system.

Next, create a folder. This is where your local copy of the source code will be.

Right-click on the folder. You should see some new options.
Select TortoiseHg, then Clone
A dialog will open.

In the dialog, enter ssh://hg.code.sf.net/p/ck2toeu3/source for the source.
Make sure the destination points to your folder.
Click Clone.
Input your sourceforge username and password when asked.

Everything from the SourceForge repository will be downloaded.


Making changes
You can just directly edit files in your local folder. When they're the same as your last commit, they'll have a green check-mark on them. If you've made changes, they'll have a red exclamation point.

If you create new files, you'll need to right-click them, select TortoiseHg, then Add Files.
In the Add Files dialog, make sure they're all selected, then click Add.
These files will have a blue plus on them until you commit them.

If you need to rename or delete files, use the appropriate options in the right-click menu (all under TortoiseHg).

Until you commit your files, you can use the Revert Files option to revert them to the last committed version.


Committing Changes
When you've completed a 'section of work', you can commit your changes.

First, make sure to go to data files and add a line with a description to the changelog.
Then, go outside your folder and right-click on it.
Choose Hg Commit.
A dialog will open.

Make sure all files you want to commit are selected on the left.
In the upper area, add a description (preferably the same one as in the changelog).
Click Commit.
Click Close.
After a few moments, all the overlays on your files should update to the green checkmark.


Synchronizing with the main repository
Your changes just far are just committed on your local machine. No-one else has them yet. And you lack any changes others have committed.

Right-click on your folder.
Select TortoiseHg
Select Synchronize.
A dialog will open.

Start by selecting ssh in the drop-down menu. The remote repository settings should be filled in from your initial setup.
There are four buttons that matter on the dialog:
The one on the left will tell you which changes from the central repository you can get.
The next one over will download those changes to your computer.
The next one will preview changes you can upload.
The final one will upload those changes.

Final Notes
If someone else has made changes and committed them to the SourceForge repository, you'll need to do a merge. Read all about that process here.

Also, I'm really hoping to find a way to not have to enter username and password each time. If I find out, I'll note it here.

There's also a good overall introduction to what's going on with all of these steps here.
 
Last edited:
Mappings

Mappings will be of this form (borrowed from the EU3 to Vic2 Converter):

Code:
cultureMap = {

link = { vic = north_german eu3 = pommeranian eu3 = prussian eu3 = hannoverian eu3 = saxon  }
link = { vic = swiss eu3 = rheinlaender owner = SWI }
link = { vic = south_german eu3 = rheinlaender }

}

Each type of mapping will be in its own file, and these files should all be placed in the Data Files directory.

Cultures should map one EU3 culture to one or more CK2 cultures. If it works out that one CK2 cultures needs to split into multiple EU3 cultures, then find something that will distinguish them, and include, as with Swiss in the code snippet above. For now, just put a meaningful name to any such distinguishing item. I'll make sure the converter supports them later on. Also, in these cases, make sure you put the rules in the order you want them evaluated. If the two Rheinlaender lines above were swapped, you would never see the Swiss culture, because everything would become South German first. But with this order, anything that can become Swiss will do so, and everything that remains then become South German.

Tags should map one EU3 tag to many CK2 tags. Each EU3 tag should be listed multiple times throughout the file. The first time, it should be the preferred mapping: the one that will always be given if the CK2 tag is independent (or whatever such rules we eventually develop). After that, there should be mappings that group leftover tags by region. So if Leon is independent but Castille is not, Leon should have a chance to get the Castille tag. It will probably be best to do this multiple times. Edit: any EU3 tag that corresponds to a nation completely outside Europe should be explicitly listed in a rule that has no CK2 tag.

Religion mappings should map one EU3 religion to multiple CK2 religions. If it turns out one CK2 religion should become multiple EU3 religions, let me know right away.

Province mappings will be the subject matter of another post.
 
Last edited:
Province Mapping

Province mapping is normally the brutal and unforgiving, yet absolutely necessary task of the conversion process. Fortunately, dtremenak wrote a tool that has been used on both the EU3 to Vic2 converter and the Vic2 to HOI3 converter.

Download it from here.

When you've got it, copy province_mappings.txt (from the Data Files directory in the repository) into the same directory as the province mapper tool. Then run the tool. It'll ask for some data right away.

Source Map should be the directory named map under your CK2 install, something like D:\Paradox Interactive\Crusader Kings II\map
Target Map should be the directory named map under your EU3 install, something like D:\Paradox Interactive\Europa Universalis III\map
Source tag should be ck2
Target tag should be eu3
Select Use names from localization

The left side shows the existing mappings and comments. Click Create New Comment for a new comment (useful for specifying a region you're working on). Click Create New Mapping for a new mapping. Once you've done that, click the appropriate provinces to map in each map, and they will be added to the mapping. You can click an existing mapping to edit it. A selected mapping will be shown with hashing on the map. The Show Unmapped button on the toolbar will darken all mapped provinces, making it easier to see what still needs to be done.

When you've done a region, save, and commit your province_mappings.txt to the repository.

Now, we'll have to map all EU3 provinces to something that lets us know there is no corresponding CK2 province. Edit: dtremenak tells me you can just select the EU3 provinces and select no corresponding CK2 provinces, and a rule will be added. That's enough for me to work with.

Other than that, just pick a region, announce it here so others will know not to bother with it, and go for it! I've done Iceland so we have something to start with.
 
Last edited:
Things I have deleted from a default Grand Campaign save, but didn't result in a crash.

My preliminary testing shows that almost everything can be deleted without crash! Province and ID entries can remain empty (in fact, I should not be surprised if the game loaded with no province or nation entries at all, but I didn't test that since it is un-important).

Detailed notes on my process are hidden in the spoiler under my conclusions.

Firstly, the head of the save game must contain some basic data, which looks a bit like this:

Code:
monarch=6840
cardinal=16
leader=1184
advisor=1889
rebel=41
unit=1541

id=
{
	id=3001
	type=4713
}

Monarch, cardinal, leader, advisor, rebel, and unit all point to either the last (or next acceptable) index for IDs of that unit type (so here, the next cardinal would be either id 16 or 17).
I have no idea what the savegame id does, but its type is always 4713, it's id changes, and the save needs to have it or it will crash. I do not remember what it does, though.

Everything else before province entries can be deleted safely.


Province Entries

it seems that everything in a province entry can be deleted and there will not be a crash.


Nation entries

it seems that everything in a nation's entry can be deleted and the game will not crash.


The tail end of the save

Finally, everything after the nation entries can be deleted, and there still won't be a crash! What kind of monster is this?! :p


Detailed notes:
First, some opening global stuff that occurs before province data.

- Current date, player nation, flags, gameplay settings, start date, before
Code:
id=
{
	id=3001
	type=4713
}

Deleting monarch, cardinal, leader, advisor, rebel, and unit data leads to a crash about a month in. Do these mark indexes of the next available id for those types? The 1399 GC values are
Code:
monarch=6840
cardinal=16
leader=1184
advisor=1889
rebel=41
unit=1541

- Rebel factions

- HRE entries, which look like this:
Code:
emperor="HAB"
imperial_influence=1.000
internal_hre_cb=yes
revoke_reform=yes
old_emperor=
{
	id=1076
	country="BOH"
	date="1378.11.29"
}
Effectively disables HRE mechanics, though.

- Religion entries, which are used to keep track of religion specific information (especially defender of the faith).
- the papacy entry, which clears the papacy of all cardinals (which are all appointed at the turn of the year).
- Trade entries, which keep track of CoTs, their value, and their merchants.


This takes care of all date before province information. What we are left with is:
Code:
monarch=6840
cardinal=16
leader=1184
advisor=1889
rebel=41
unit=1541

id=
{
	id=3001
	type=4713
}



I will now delete information from province 1 (stockholm) and see if any causes an immediate crash. The things I delted were

- flags and variables entries
- name (which, curiously, defaults to stockholm anyway)
- owner, controller, and core tags
- culture and religion
- capital
- citysize and garrison values (Turns province in to colony if owner tags still present)
- trade goods
- buildings
- history
- patrol and disovery dates. (Makes the province terra incognita, and too inhospitable to colonise immediately).

And... well, that's actually everything. A province entry can be completely empty and still not result in a crash.

Code:
1= {

}



And now, nation entries. I will be deleting data from England and see what I can keep around. What I've deleted is:

- History (Interestingly, tells us who the current king is?)
- flags, hidden flags, and variables.
- capital (interestingly, capital is automatically moved to london anyway...)
- National focus
- Cultures and religions
- Tech group (funnily enough results in the tech group "notechgroup" with a research efficiency of 1%)
- Unit type
- Tech levels
- Last election, autosend merchants, precise prestige
- Stability, stab investment, and treasury
- Current income, estimated monthly income, inflation, last_bankrupt, wartax date, war_exaustion
- Land, naval, colonial, missionary maintenence
- Army, navy, and cultural tradition
- Distribution (whatever that is)
- Ledger data
- Cancelled loans, load size, badboy, papal influence, legitimacy (Legitimacy defaults to 100?)
- an "advisor" entry, that looks like this:
Code:
advisor=
	{
		id=216
		type=39
	}
I assume that this is an advisor that england has employed at game start.

- Government type
- colonists, merchants, missionaries, spies, bereaucrats.
- Last policy change
- Government sliders (all default to 0)
- manpower
- unit and ship types
- mercenaries
- armies and navies
- Diplomatic relations
- Leader, monarch (distinction?), and heir
- Active mission, last mission cancel date (immediately gives you a mission).
- AI, slider locks, and traded bonuses.

Well I'll be damned. That's everything again, and with an empty england I did not crash (at least before scotland finished eating me).

Code:
ENG=
{

}



Next, stuff that occurs after the nation entries. The things I can delete are:

- active advisors (clears the world of clever men).
- Diplomacy
- Combats
- Active wars
- previous wars
- Income, nation size, and inflation statistics.
- Shogunate and daimyos.
- "nr=" entries, whatever they are. They look like this:
Code:
nr="BUILD_TO_FORCELIMIT"
nr="PURE_CAPITALISM"
nr="CONQUER_AZTECS_INCAS"
nr="TEN_THOUSAND_KILLED"
nr="ALL_ABOUT_THE_MONEY"
nr="RESPECTED"
nr="TRULY_DIVINE_RULER"
nr="CONTROL_CARRIBEAN"
nr="MASTER_OF_INDIA"
nr="INVINCIBLE_ARMIES"
nr="THE_WOODEN_WALL"
nr="WORLD_DISCOVERER"
nr="MARKET_CONTROL"
nr="INVINCIBLE_NAVY"
nr="ALL_ABOUT_LUCK"
nr="TRADITIONAL_PLAYER"
nr="AT_EVERY_CONTINENT"
nr="REGENCY_WAR"
nr="EAST_AND_WEST"
nr="FIVE_MONOPOLIES"
nr="CONQUER_THE_WORLD"
nr="UNITE_THE_EMPIRE"
nr="CAN_HE_BE_TRUSTED"

- AND FINALLY at the end, what looks like a hash: 812c8bd604b9a17db8328bb502aa77ae


This, once again, is everything!
 
I'll be happy to lend a hand, but in the immediate term Vic2ToHoI3 is a bit more pressing for me.

'Course that might change when the folks I've been playing with realize how blasted awesome CK2 is...

And that's a perfectly fine attitude. And there have been people waiting for the Vic2ToHoI3 converter for nearly as long as he combined project was around. That is, since October 2010.

Re, non-eruope provinces.

Surely it would be trivial to have the converter simply ignore provinces that have no mapping? Or am I misunderstanding the problem...

True, but I prefer to handle things explicitly rather than implicitly.
Things I have deleted from a default Grand Campaign save, but didn't result in a crash.

My preliminary testing shows that almost everything can be deleted without crash! Province and ID entries can remain empty (in fact, I should not be surprised if the game loaded with no province or nation entries at all, but I didn't test that since it is un-important).

Well, I tried testing with no province or nation entries, and it works! The converter now outputs a minimal yet functional EU3 save (well, functional in that you can select it in-game. There are no nations, so you can't load it).

- "nr=" entries, whatever they are. They look like this:
Code:
nr="BUILD_TO_FORCELIMIT"
nr="PURE_CAPITALISM"
nr="CONQUER_AZTECS_INCAS"
nr="TEN_THOUSAND_KILLED"
nr="ALL_ABOUT_THE_MONEY"
nr="RESPECTED"
nr="TRULY_DIVINE_RULER"
nr="CONTROL_CARRIBEAN"
nr="MASTER_OF_INDIA"
nr="INVINCIBLE_ARMIES"
nr="THE_WOODEN_WALL"
nr="WORLD_DISCOVERER"
nr="MARKET_CONTROL"
nr="INVINCIBLE_NAVY"
nr="ALL_ABOUT_LUCK"
nr="TRADITIONAL_PLAYER"
nr="AT_EVERY_CONTINENT"
nr="REGENCY_WAR"
nr="EAST_AND_WEST"
nr="FIVE_MONOPOLIES"
nr="CONQUER_THE_WORLD"
nr="UNITE_THE_EMPIRE"
nr="CAN_HE_BE_TRUSTED"
- AND FINALLY at the end, what looks like a hash: 812c8bd604b9a17db8328bb502aa77ae

I'm pretty sure those are the potential achievements you can get, and the hash is some kind of digital signature that verifies the save is a valid achievement-gaining one. Both are unimportant to us.
 
So, I guess the next step is to try to figure out how to create a mimimal save with a selectable nation.

I'd say start by putting the header into a save file:

Code:
monarch=6840
cardinal=16
leader=1184
advisor=1889
rebel=41
unit=1541

id=
{
	id=3001
	type=4713
}

and then try to add a single country and a single province owned by that country.

If we can select the save in the loadign screen w/o crashing, that's suffiecient. If we can select the country w/o crashing, even better. And if we can actually load the save, I'll be a happy happy man.

If we can figure that out, I can start making the converter reconstruct the rest of the world. And then we'll need some analysis of CK2 saves to start doing some really basic conversion of the CK2 in-game area.
 
Ew, when I use the province mapper, the maps appear to be upside-down. It hurts my brain! Anyone else get this?

Yep! It's because that's how Paradox stores the maps. We could probably get an option to reverse that into the mapper…