• 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.
The log doesn't give me anything more than "getting opinion modifiers". How would I go about identifying the problem modifier?

There are two stages that log "Getting opinion modifiers" (was that a bad idea? YES!). Is it the first one or the second one?

The first one (just after "Getting traits") reads the opinion_modifiers files from your CK2 installation; if it's crashing there, it's probably a parser crash, and I'd check out those files in your install and see if there's anything suspicious that jumps out at you.

The second one (just after "Creating family trees") reads the opinion modifiers from every rel_NNNN block in your save. If ANYTHING goes wrong there, you should get an additional error logged (either "bad LHS character ID" or "bad relationship modifier"), or the modifier will just be set to 0 value. I don't see anything there that could cause a crash.

If you can't figure out where the problem is coming from, let me know which "Getting opinion modifiers" is causing problems, and I'll see if I can put some additional logging in a special build for you.
 
I'm surprised that you didn't fix the bug regarding the name tags for republics (In all both my games that I have converted Genoa has become York)

I hadn't had time to make the changes for the new titles added in 0.9 (k_genoa, k_hansa, k_pisa, and d_gotland). I have done so now; did I miss any (k_venice already existed)?
 
As far as I can tell (from the only save I converted) government conversion works much better now. Feudal monarchy is widespread, there are some despotic monarchies, Byz is an empire, the hordes are hordes etc

I general, the converted save is perfectly playable! The things on the roadmap (armies, navies, buildings, CoT:s, wars etc.) will of course make continuity from ck2 better, but it still works decently. (You can build armies and buildings yourself and CoT:s show up eventually, although not in places I would've put them.)

There's one pet peeve of mine that I think needs more tweaking, though: tech groups. If I read the converter log right, 191 tags were assigned when converting aforementioned save. Out of these 115 had no provinces (and all of these were set to western tech). For the remaining 76 that are actually playable: one had western tech, five had eastern tech, four had ottoman tech, 63 had muslim tech, and the three hordes had the nomad/horde tech.

In my opinion, far more countries should be higher up on the scale. I recall some posts about this from before, so I think I'm not the only one with this problem. Do you have any internal diagnostics that show distribution of tech groups in the saves in the test suite?

Now, I'm not sure exatcly how tech groups are handled, but I assume it's something along the lines of what DasGuntLord01 outlined way back.

The easiest fix then would be to adjust the thresholds for who goes in what tech group. Exactly what those thresholds should be is hard to say without knowing the distribution of the tech scores of the countries.

I'm also curious about those assigned tags with no provinces. Are they automatically given western tech, or are they too involved in the scoring system outlined in the link above? If the latter, they could skew the distribution as they are typically small (otherwise they would have had provinces assigned?) and thus have an easier time getting a good tech bulding/province ratio.
 
As far as I can tell (from the only save I converted) government conversion works much better now. Feudal monarchy is widespread, there are some despotic monarchies, Byz is an empire, the hordes are hordes etc

I general, the converted save is perfectly playable! The things on the roadmap (armies, navies, buildings, CoT:s, wars etc.) will of course make continuity from ck2 better, but it still works decently. (You can build armies and buildings yourself and CoT:s show up eventually, although not in places I would've put them.)

There's one pet peeve of mine that I think needs more tweaking, though: tech groups. If I read the converter log right, 191 tags were assigned when converting aforementioned save. Out of these 115 had no provinces (and all of these were set to western tech). For the remaining 76 that are actually playable: one had western tech, five had eastern tech, four had ottoman tech, 63 had muslim tech, and the three hordes had the nomad/horde tech.

In my opinion, far more countries should be higher up on the scale. I recall some posts about this from before, so I think I'm not the only one with this problem. Do you have any internal diagnostics that show distribution of tech groups in the saves in the test suite?

Now, I'm not sure exatcly how tech groups are handled, but I assume it's something along the lines of what DasGuntLord01 outlined way back.

The easiest fix then would be to adjust the thresholds for who goes in what tech group. Exactly what those thresholds should be is hard to say without knowing the distribution of the tech scores of the countries.

I'm also curious about those assigned tags with no provinces. Are they automatically given western tech, or are they too involved in the scoring system outlined in the link above? If the latter, they could skew the distribution as they are typically small (otherwise they would have had provinces assigned?) and thus have an easier time getting a good tech bulding/province ratio.

Good observations! That is the technique we use, with the EU3 tech rates defining the thresholds for each groups. The only modification is that it goes down to sub sharan tech.

I hadn't gone beyond a quick search of a converted save to see how many nations were in each tech group, and the numbers seemed reasonable at first (though I hadn't compared them to a new game, though). I certainly hadn't thought to compare them to landed nations! You certainly have uncovered a problem.

I guess we can adjust the thresholds, as you suggest. But I'm now curious to get the shapes of the various distributions, both EU3 tech groups in a new game, and the tech rate numbers from CK2. Both are easy to get, but I'm not so good at analysis. :-(
 
Just had a quick read of DasGuntLord01's threshold system and johnjohansson's description of his game. Please confirm that I'm understanding this right.

-191 EU3 tags were assigned to various CK2 powers
-115 were CK2 minors too small to rate an entire EU3 province, but they all had at least one school, resulting in an infinte school to province ratio and them being assigned western tech.
-The EU3 tag with the highest # of schools/unis and at least one EU3 province became the gold standard for western tech.
-5 EU3 tags had >85% of that gold standard and got assigned eastern tech
-4 had 80%<x<85% and got assigned Ottoman tech
-63, or the vast majority of playables, had 50%<x<80% and got Muslim tech
-the 3 hordes were handled appropriately
-no one fell into the lowest 0-20% bucket to get subsaharan
-you prohibit any CK2 realm from falling into the new world tech group (which I wholly endorse. Even the most isolated backwater of europe would have at least subsaharan levels of contact with the med basin).

Fundamentally I think the problem may be that you're grading on a curve, which can give extreme results in extreme cases. It *might* be better to open CK2 at the latest possible start date (as close to an overlapping date with EU3 as possible if not actually overlapping, which would be much better), run the converter to find the benchmark realm, and hardcode tech thresholds to correspond with the actual learning ratios of realms in the base games. Where there's overlap, split the difference. Find the EU3 eastern tech realm with the highest CK2 learning ratio, the western realm with the lowest, and set the threshold halfway between them.

If you're determined / committed to grading on a curve versus hardcoding, then just go a step further and compute the historical tresholds above as ratios of the highest learning western realm.

However, since CK2 provinces never retrogress no matter how hard plagues and wars hit them, a CK2 game will probably end with ahistorically high tech levels and learning. Since western is the highest EU3 tech group, I think it's better to lock the standard at historical levels and give more cultures A's than to grade on a curve and force cultures to be even more behind Europe than they normally would be in EU3. Helps create a greater challenge.
 
Just had a quick read of DasGuntLord01's threshold system and johnjohansson's description of his game. Please confirm that I'm understanding this right.

-191 EU3 tags were assigned to various CK2 powers
-115 were CK2 minors too small to rate an entire EU3 province, but they all had at least one school, resulting in an infinte school to province ratio and them being assigned western tech.
-The EU3 tag with the highest # of schools/unis and at least one EU3 province became the gold standard for western tech.
-5 EU3 tags had >85% of that gold standard and got assigned eastern tech
-4 had 80%<x<85% and got assigned Ottoman tech
-63, or the vast majority of playables, had 50%<x<80% and got Muslim tech
-the 3 hordes were handled appropriately
-no one fell into the lowest 0-20% bucket to get subsaharan
-you prohibit any CK2 realm from falling into the new world tech group (which I wholly endorse. Even the most isolated backwater of europe would have at least subsaharan levels of contact with the med basin).

Fundamentally I think the problem may be that you're grading on a curve, which can give extreme results in extreme cases. It *might* be better to open CK2 at the latest possible start date (as close to an overlapping date with EU3 as possible if not actually overlapping, which would be much better), run the converter to find the benchmark realm, and hardcode tech thresholds to correspond with the actual learning ratios of realms in the base games. Where there's overlap, split the difference. Find the EU3 eastern tech realm with the highest CK2 learning ratio, the western realm with the lowest, and set the threshold halfway between them.

If you're determined / committed to grading on a curve versus hardcoding, then just go a step further and compute the historical tresholds above as ratios of the highest learning western realm.

However, since CK2 provinces never retrogress no matter how hard plagues and wars hit them, a CK2 game will probably end with ahistorically high tech levels and learning. Since western is the highest EU3 tech group, I think it's better to lock the standard at historical levels and give more cultures A's than to grade on a curve and force cultures to be even more behind Europe than they normally would be in EU3. Helps create a greater challenge.

Quite close, good work observations!

I actually coded the converter slightly differently from DasGuntLord01's description. First of all, I use the number of baronies instead of EU3 provinces, so there's no possibility of infinite tech.

And the ratios I use are
0.00 - 0.20: sub_saharan
0.20 - 0.75: muslim
0.75 - 0.80: ottoman
0.80 - 0.85: eastern
0.85 - 1.00: western

If understand you correctly, you're recommending I change those thresholds by attempting to reverse-engineer the thresholds that would convert a hypothetical 1453 CK2 game (which we can't get, so we use the latest game we can get instead) to fresh 1453 EU3 game. It's a wonderful idea, I love it!

Here's the thing though. I'm a programmer, and figuring out those numbers take away a lot of time I could be using to fix crash bugs or add new features. Since you've got a lovely idea, it'd be helpful if you could do the appropriate number crunching. If you (or really, anyone) is willing to do so, it's about a five line change to make the converter spit out the learning rates for all EU3 nations it converts. I'd gladly extract those numbers and pass them on to a willing analyst.
 
Also, I think that only counting nations that get land in the tech category algorithm will help.
 
Also, I think that only counting nations that get land in the tech category algorithm will help.

Probably. Still, these landless nations might need a tech group assigned too. I would guess they are all potential revolters/released vassals, and a quick search indicates they need to have a tech group assigned. (This thread, although a bit dated, is the best info a very quick search revealed. The wiki is not helping, for once.)

As for further analysis, if no one beats me to it (crossing my fingers :p) I might have a look later. More people with more input is always better, though. (Also, the figures I presented above are from manually checking the converted save, so the "five line change" you mentioned would be very helpful.)
 
I actually coded the converter slightly differently from DasGuntLord01's description. First of all, I use the number of baronies instead of EU3 provinces, so there's no possibility of infinite tech. And the ratios I use are
0.00 - 0.20: sub_saharan
0.20 - 0.75: muslim
0.75 - 0.80: ottoman
0.80 - 0.85: eastern
0.85 - 1.00: western
CK2 baronies, just to be perfectly clear? 'Cause as the Mythbusters would say, well there's your problem! Castles can't have schools no matter how developed they get. So in a maxed out 3 holding province, 66% of holdings have schools, unless you're somehow testing for the level of the schools instead of just presence like I suspect. To escape the muslim tech grouping, a CK2 province has to have at least 4 holdings with only 1 castle. Even a 7 slot with 2 castles can never get higher than muslim. Depending on how you handle the 75% cutoff, it may need to have 5 with only one castle, which would catapult it right over ottoman and into eastern. Unless it's lucky enough to become an EU3 province all by its lonesome, its neighbors also have to pass this test for the EU3 province to get higher than muslim tech. To get western tech, it needs to have 7 built holdings with only one castle. So Venice, Constantinople, maybe somewhere in Flanders, and maybe one or two others in corners of the map I haven't memorized yet are the only ones that even have a *chance* at becoming western, and even then only if they stand alone in the province mapping.
If understand you correctly, you're recommending I change those thresholds by attempting to reverse-engineer the thresholds that would convert a hypothetical 1453 CK2 game (which we can't get, so we use the latest game we can get instead) to fresh 1453 EU3 game. It's a wonderful idea, I love it!
Almost exactly. I want to take the latest CK2 start we can (actually the latest info in the history files, whichever is later, mod the allowable start date if we need to) and use the EU3 expansion that allows earlier start dates (forget the name atm, but I own it) to get as close as possible to an overlapping unplayed setup as close as we can get to 1453. Then compare those two to hardcode a tech mapping system that gets used for all conversions whether that EU3 expansion is present or not. If actually played games result in a greater fraction of the world getting western tech than vanilla EU3, I'm ok with that as it increases the challenge ROW poses to the CK2 area.
Here's the thing though. I'm a programmer, and figuring out those numbers take away a lot of time I could be using to fix crash bugs or add new features. Since you've got a lovely idea, it'd be helpful if you could do the appropriate number crunching. If you (or really, anyone) is willing to do so, it's about a five line change to make the converter spit out the learning rates for all EU3 nations it converts. I'd gladly extract those numbers and pass them on to a willing analyst.
Go ahead and make that change. It ALWAYS helps to have data on how the system is performing, and that will make it vastly easier to find the dumbest western and smartest eastern realms and so on. I'm going to ponder a minimal change barony based system that avoids both things going NAN/infinite and the problems I outlined above. Watch this space for further brainstorming.

Edit: went back and checked, and 4 countries had ottoman tech, which shouldn't be possible based on my understanding. So clearly I misunderstand :) You probably are testing for the level of the schools, which changes things a bit. I'm going to go think more before I open my keyboard mouth again.
 
Last edited:
@Pode: I believe the mentioned ratios are indexed so that 1.0 is the ratio tech buildings/baronies of the country with the highest such ratio. (That was a clumsy sentence, hope you understand what I mean.)

I'm going to go think more before I open my keyboard mouth again

While thinking is good, please keep posting thoughts and comments. The more viewpoints get aired the better the end result will be. (Also, I'm hoping more discussion will spur the programmers on... I'm nearing the end of a very enjoyable ck2 game that I'd like to continue ;))
 
I was playing as the Empire of Brittania. I wasn't a republic, though. I got my save on google drive. https://docs.google.com/file/d/0B7usBFtlgtWQcjlPS0doc3V3WHc/edit?usp=sharing

Idhrendur: The root problem with this save (and probably many other 1.09 saves) is that the holder of d_genoa holds no baronies that are in any provinces. He holds d_genoa titularly (as a vassal of k_genoa, which coincidentally doesn't actually hold c_genoa at all), and b_grimaldi, which is a family palace, and as such is NOT in any province. Basically 1.09 introduced "titular holdings" - they have no physical location, but count as a holding inasmuch as they prevent higher titles from being stripped.

The crash occurs because we don't set the primary holding for d_genoa's holder, then we try to figure out his relationship with his liege.

As I see it, we have two possible solutions:
1. Treat family palaces as holdings. This means writing code to read the "settlement" block from the title, and create baronies from them. The baronies would have a null province, so we'd have to protect every access of the barony's province to prevent further crashes. And these holdings wouldn't count for culture/religion/tech determination like all the others do (since they have no physical location). This would also require that we write code to handle dynamic baronies (which don't exist as potential titles in the CK2 install), otherwise we'll have even more crashes.
2. Treat family palaces as titles only. This means protecting every access of primary_holding and capital (and probably others), since some holders (like the one in this game) have no "real" primary holding, and it might have some ancillary impact on title merging (since some titles would exist with a valid holder, but have no holdings whatsoever).

No matter what, we can't keep both of these assumptions that we make now (that every titleholder has a primary holding, and that every holding exists in a province), and that'll have pretty wide-reaching impact on a conceptual level, so I wanted to see what your thoughts were before I ran off and broke things :)

EDIT: To some extent I suspect this is a bug (or maybe "unexpected feature") in CK2. For one thing, the holder of d_genoa is called a "Duke" ingame despite not holding any castles, and being a patrician. And it permanently prevents d_genoa from EVER being destroyed by attrition (since there's no way for anyone to destroy the titular barony).
 
Last edited:
@Pode: I believe the mentioned ratios are indexed so that 1.0 is the ratio tech buildings/baronies of the country with the highest such ratio. (That was a clumsy sentence, hope you understand what I mean.)
I think I do. You're saying that, for example, a maxed out Venice gets a castle, a church, and 5 cities, all 6 schools present, for a ratio of 6/7 or ~86%. That gets defined as the standard 1.0, then the tech thresholds above apply.

The other thing I just realized is that if 2 maxed out single castle CK2 provinces were averaged together to make an EU3 province, one with 4 slots and 1 with 5, that'd create an ottoman EU3 province based on my original understanding. So I may have been wrong about being wrong.
 
dtremenak said:
Family palace handling, options 1 and 2, both of which sound like major changes
Might option 3 be to assume that all family palace holdings are in the capital of the republic? Can you check for holdings without a province (they exist in the savegame file in the form of b_dynastyname), then assign them to #capitalprovince of #topliege, then proceed with your existing code?
There will be some cases where this doesn't quite match the CK2 game, but CK2 has fully developed mansions teleporting around Europe when the holder's capital changes, so in some ways this would be more realistic. Every great family builds their mansion where they have easy access to the doge's court.
 
Last edited:
Probably. Still, these landless nations might need a tech group assigned too. I would guess they are all potential revolters/released vassals, and a quick search indicates they need to have a tech group assigned. (This thread, although a bit dated, is the best info a very quick search revealed. The wiki is not helping, for once.)

As for further analysis, if no one beats me to it (crossing my fingers :p) I might have a look later. More people with more input is always better, though. (Also, the figures I presented above are from manually checking the converted save, so the "five line change" you mentioned would be very helpful.)

Ah, that's good info. And my quick code analysis last night showed that I was a bit off on my description. I look at the EU3 land provinces a nation has, then trace that back to the CK2 provinces, then to the CK2 baronies. Non-landed EU3 nations get a score of negative infinity, which means they get the default tech group: western.

There are quite a few things I need to fix in that system.

After I've done the easy tweaks, I'll try to do a minor release that gives output on how that processing is happening for analysis.
 
CK2 baronies, just to be perfectly clear? 'Cause as the Mythbusters would say, well there's your problem! Castles can't have schools no matter how developed they get. So in a maxed out 3 holding province, 66% of holdings have schools, unless you're somehow testing for the level of the schools instead of just presence like I suspect. To escape the muslim tech grouping, a CK2 province has to have at least 4 holdings with only 1 castle. Even a 7 slot with 2 castles can never get higher than muslim. Depending on how you handle the 75% cutoff, it may need to have 5 with only one castle, which would catapult it right over ottoman and into eastern. Unless it's lucky enough to become an EU3 province all by its lonesome, its neighbors also have to pass this test for the EU3 province to get higher than muslim tech. To get western tech, it needs to have 7 built holdings with only one castle. So Venice, Constantinople, maybe somewhere in Flanders, and maybe one or two others in corners of the map I haven't memorized yet are the only ones that even have a *chance* at becoming western, and even then only if they stand alone in the province mapping.Almost exactly. I want to take the latest CK2 start we can (actually the latest info in the history files, whichever is later, mod the allowable start date if we need to) and use the EU3 expansion that allows earlier start dates (forget the name atm, but I own it) to get as close as possible to an overlapping unplayed setup as close as we can get to 1453. Then compare those two to hardcode a tech mapping system that gets used for all conversions whether that EU3 expansion is present or not. If actually played games result in a greater fraction of the world getting western tech than vanilla EU3, I'm ok with that as it increases the challenge ROW poses to the CK2 area. Go ahead and make that change. It ALWAYS helps to have data on how the system is performing, and that will make it vastly easier to find the dumbest western and smartest eastern realms and so on. I'm going to ponder a minimal change barony based system that avoids both things going NAN/infinite and the problems I outlined above. Watch this space for further brainstorming.

Edit: went back and checked, and 4 countries had ottoman tech, which shouldn't be possible based on my understanding. So clearly I misunderstand :) You probably are testing for the level of the schools, which changes things a bit. I'm going to go think more before I open my keyboard mouth again.

CK2 baronies, yes, but the converter is pretty smart at handling buildings. It actually loads all the CK2 building data, so it can look up just how much any given building adjusts the tech growth rate. So the bonus from each building in the entire nation is summed, then that sum is divided by the number of baronies in the nation.

Later, every nation's sum is divided by the highest sum in the CK2 area, normalizing the world to some extent.
 
Idhrendur: The root problem with this save (and probably many other 1.09 saves) is that the holder of d_genoa holds no baronies that are in any provinces. He holds d_genoa titularly (as a vassal of k_genoa, which coincidentally doesn't actually hold c_genoa at all), and b_grimaldi, which is a family palace, and as such is NOT in any province. Basically 1.09 introduced "titular holdings" - they have no physical location, but count as a holding inasmuch as they prevent higher titles from being stripped.

The crash occurs because we don't set the primary holding for d_genoa's holder, then we try to figure out his relationship with his liege.

As I see it, we have two possible solutions:
1. Treat family palaces as holdings. This means writing code to read the "settlement" block from the title, and create baronies from them. The baronies would have a null province, so we'd have to protect every access of the barony's province to prevent further crashes. And these holdings wouldn't count for culture/religion/tech determination like all the others do (since they have no physical location). This would also require that we write code to handle dynamic baronies (which don't exist as potential titles in the CK2 install), otherwise we'll have even more crashes.
2. Treat family palaces as titles only. This means protecting every access of primary_holding and capital (and probably others), since some holders (like the one in this game) have no "real" primary holding, and it might have some ancillary impact on title merging (since some titles would exist with a valid holder, but have no holdings whatsoever).

No matter what, we can't keep both of these assumptions that we make now (that every titleholder has a primary holding, and that every holding exists in a province), and that'll have pretty wide-reaching impact on a conceptual level, so I wanted to see what your thoughts were before I ran off and broke things :)

EDIT: To some extent I suspect this is a bug (or maybe "unexpected feature") in CK2. For one thing, the holder of d_genoa is called a "Duke" ingame despite not holding any castles, and being a patrician. And it permanently prevents d_genoa from EVER being destroyed by attrition (since there's no way for anyone to destroy the titular barony).

I'll have to double-check the code, but I'm pretty sure most of those assumptions are from me trying to get something to work quickly, rather than correctly (see also how I far too frequently don't check pointer validity at all). They're probably worth fixing in any case. I think I like the first possibility better though.

And if my brain isn't just being too tired, either choice should produce an identical result, right? Either way they don't really affect anything we care about, we're just avoiding data states we implicitly assumed would never arise.