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

ShepherdOfCats

First Lieutenant
Sep 28, 2020
275
920
Well wagon I've been testing it, so I landed my two children (1 daughter and one son) to see what they would do if I gave them the freedom to marry (testing it to the limit I guess). Surprising the first issue came from my son's branch of the family. He died as a young adult and only had one daughter, who inherited his county, and thus she became my new heir. I allowed her to make her own decisions on marriage, and she promptly betrothed herself for a regular-marriage with the son of an opposing duke. :(

I'm afraid that the AI still values alliances and marriage status (even weak ones) more than continuing the dynasty, which is something that is probably beyond the reach of modders to fix, and is going to continue to be a problem so long as the devs think that it isn't important that the AI continues its dynasty.

I'll give a try to the one mediocre doctor posted above to see if there is any difference, but I appreciate all the work.

EDIT: I will add that I was using the one that monkbel put into a downloadable mod, so if his code is different from yours somehow maybe that is why I had issues.
 
Last edited:

Tatterhood

Conscientious Objector
29 Badges
Jun 9, 2016
1.569
1.470
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Jade Dragon
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
I'm afraid that the AI still values alliances and marriage status (even weak ones) more than continuing the dynasty, which is something that is probably beyond the reach of modders to fix, and is going to continue to be a problem so long as the devs think that it isn't important that the AI continues its dynasty.
This is controlled by defines, so it shouldn't be out of reach. We have SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE at -500 by default while SPOUSE_SCORE_HIGHER_TIER_ALLIANCE is +1000, so it's no surprise this happens, but the former number could be made bigger.
 
  • 1
Reactions:

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
EDIT: I will add that I was using the one that monkbel put into a downloadable mod, so if his code is different from yours somehow maybe that is why I had issues.
Haven't looked at his code. I've been using th code I posted in the first post and it has been working, at least partially, as I have seen the AI make matri marriages for the oldest daughters. Gonna check if it also does it for female rulers.
But it at least does consider them.
 

Monkbel

Lt. General
101 Badges
Oct 21, 2009
1.227
535
  • Crusader Kings II
  • Cities in Motion
  • Victoria 2: A House Divided
  • Majesty 2
  • Hearts of Iron III
  • BATTLETECH: Flashpoint
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Conclave
  • Stellaris: Distant Stars
  • 500k Club
  • Cities: Skylines - Parklife
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Steel Division: Normandy 44
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Shadowrun Returns
  • Stellaris: Apocalypse
  • BATTLETECH: Season pass
  • Prison Architect
  • Surviving Mars
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Cities: Skylines - Campus
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Shadowrun: Dragonfall
  • BATTLETECH
  • Imperator: Rome
  • Victoria 2
  • Imperator: Rome Deluxe Edition
  • Warlock 2: The Exiled
  • BATTLETECH - Digital Deluxe Edition
Well wagon I've been testing it, so I landed my two children (1 daughter and one son) to see what they would do if I gave them the freedom to marry (testing it to the limit I guess). Surprising the first issue came from my son's branch of the family. He died as a young adult and only had one daughter, who inherited his county, and thus she became my new heir. I allowed her to make her own decisions on marriage, and she promptly betrothed herself for a regular-marriage with the son of an opposing duke. :(

I'm afraid that the AI still values alliances and marriage status (even weak ones) more than continuing the dynasty, which is something that is probably beyond the reach of modders to fix, and is going to continue to be a problem so long as the devs think that it isn't important that the AI continues its dynasty.

I'll give a try to the one mediocre doctor posted above to see if there is any difference, but I appreciate all the work.

EDIT: I will add that I was using the one that monkbel put into a downloadable mod, so if his code is different from yours somehow maybe that is why I had issues.

thank you! in my test of my mod (with wagon's code), I see all female rulers (that I checked manually) in matrilineal marriages, so I am quite confident it works as it should. Of course there might be some cases when they don't do it but those regular marriages are rare now
 

Monkbel

Lt. General
101 Badges
Oct 21, 2009
1.227
535
  • Crusader Kings II
  • Cities in Motion
  • Victoria 2: A House Divided
  • Majesty 2
  • Hearts of Iron III
  • BATTLETECH: Flashpoint
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Conclave
  • Stellaris: Distant Stars
  • 500k Club
  • Cities: Skylines - Parklife
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Steel Division: Normandy 44
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Shadowrun Returns
  • Stellaris: Apocalypse
  • BATTLETECH: Season pass
  • Prison Architect
  • Surviving Mars
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Cities: Skylines - Campus
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Shadowrun: Dragonfall
  • BATTLETECH
  • Imperator: Rome
  • Victoria 2
  • Imperator: Rome Deluxe Edition
  • Warlock 2: The Exiled
  • BATTLETECH - Digital Deluxe Edition
Was it my original code version you used?

And yeah, good idea to make it a mod. I had contemplated that, but I've only ever made personal mods, so wasn't sure exactly how to do it.
I used the code that I quoted in my post. Didn't change anything. I tested - it works well, female rulers are all (or almost all) married matrilineally
 

SHAFT!

Sergeant
3 Badges
Sep 2, 2020
95
493
  • Crusader Kings II
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
Has this been uploaded to Paradox?

BTW thanks to everyone for contributing to this thread. I stopped a Daurama playthrough because the only Matri-marriages for my daughters, and daughter's daughters, were the ones I could directly arrange.
 
  • 1
Reactions:

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
Should not 'is_close_family_of = root' been used instead of 'is_heir_of = root' ?
It happens that an old ruler's primary heir is his grandchild and then the secondary heir is the great grandchild. Great grandchildren aren't considered close family, so if both of those are women then only the primary heir is matri mattied. If she dies then it's poof, whereas the is_heir_of argument should take care of a situation like that.
 

Willem IV

Alexander
70 Badges
Aug 4, 2008
2.196
1.328
  • Victoria 3 Sign Up
It happens that an old ruler's primary heir is his grandchild and then the secondary heir is the great grandchild. Great grandchildren aren't considered close family, so if both of those are women then only the primary heir is matri mattied. If she dies then it's poof, whereas the is_heir_of argument should take care of a situation like that.
Maybe adding the 'is_close_or_extended_family_of ' to the OR (so 2nd heir and the larger family is covered). Would make sense for female dominated faiths
 

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
Maybe adding the 'is_close_or_extended_family_of ' to the OR (so 2nd heir and the larger family is covered). Would make sense for female dominated faiths
Wouldn't extended family just mean the entire dynasty?

And the is heir thing should work for female dominated faiths too.
 

SauronGorthaur

Captain
On Probation
24 Badges
Jun 4, 2014
462
1.677
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
Found out how to get matri back.

I grepped the files for the new argument and found it in common/scripted_rules/00_rules.txt
If you enter that file then you'll find the following at the very bottom of the file.

Code:
# Will AI for this character try to arrange matrilineal marriages?
# Note that the AI can still arrange patrilineal marriages based on the SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE AI define
# root: the arranging AI character
# scope:secondary_actor: the character to be married
ai_wants_matrilineal_marriage = {
    scope:secondary_actor = {
        is_female = yes
    }
    OR = {
        has_realm_law = female_only_law
        has_realm_law = female_preference_law
        faith = {
            has_doctrine_parameter = female_dominated_law
        }
    }
}

Change that to this and both agnatic-cognatic and equal should have the AI do matri marriages again!
Code:
# Will AI for this character try to arrange matrilineal marriages?
# Note that the AI can still arrange patrilineal marriages based on the SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE AI define
# root: the arranging AI character
# scope:secondary_actor: the character to be married
ai_wants_matrilineal_marriage = {
    scope:secondary_actor = {
        is_female = yes
    }
    OR = {
        has_realm_law = female_only_law
        has_realm_law = female_preference_law
        has_realm_law = male_preference_law
        has_realm_law = equal_law
        faith = {
            has_doctrine_parameter = female_dominated_law
        }
    }
}

Out of curiosity, but shouldn't the fixed version also include
Code:
faith = {
     has_doctrine_parameter = gender_equal_law
}

For the record, I don't know why the base version include the female_dominated_law parameter in the first place, because under a female dominated religion you have either female only law or female preference law, which are already included in the code separately. But assuming that line is there for a reason, if one was to extend it to other religious gender rules, particularly the equality one, shouldn't it be also included?


Haven't looked at his code. I've been using th code I posted in the first post and it has been working, at least partially, as I have seen the AI make matri marriages for the oldest daughters. Gonna check if it also does it for female rulers.
But it at least does consider them.

I've also been using the code from the first post and I've had weird results. For the most times, the AI does marry matrilineally. But sometimes it doesn't. Even when it's not marrying up. I also had the opposite results where male rulers married matrilineally. Including the king of West Francia, who matri married some utter nobody.
 

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
Out of curiosity, but shouldn't the fixed version also include
It should. Just didn't think about the equal faiths really, when I wrote things up.

I also had the opposite results where male rulers married matrilineally. Including the king of West Francia, who matri married some utter nobody.
Weird.
 

ShepherdOfCats

First Lieutenant
Sep 28, 2020
275
920
I will try this mod when I get home, sounds great.

I've been using it and no problems so far. The problem with that one is that it seems all the children get married off matrilineally, when ideally under equal succession the oldest daughters would be married off matrilineally and the youngest ones would be married off regularly. Otherwise I think it won't be very balanced.

I'm still following Wagonlitz's mod as well. I've only been testing w/ equal faiths. But to keep from messing things up I'm only using one mod at a time.

In any mod, there still will need to be a way to not let the AI destroy their dynasty for the sake of an alliance. Players would not do that. I could marry off my oldest daughter in regular marriages to the Byzantine emperor and have the best alliance in the game but obviously it wouldn't matter because my game would end when my grandchildren inherit. Whereas the AI just doesn't care.
 
Last edited:
  • 1
Reactions:

Monkbel

Lt. General
101 Badges
Oct 21, 2009
1.227
535
  • Crusader Kings II
  • Cities in Motion
  • Victoria 2: A House Divided
  • Majesty 2
  • Hearts of Iron III
  • BATTLETECH: Flashpoint
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Conclave
  • Stellaris: Distant Stars
  • 500k Club
  • Cities: Skylines - Parklife
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Steel Division: Normandy 44
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Shadowrun Returns
  • Stellaris: Apocalypse
  • BATTLETECH: Season pass
  • Prison Architect
  • Surviving Mars
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Cities: Skylines - Campus
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Shadowrun: Dragonfall
  • BATTLETECH
  • Imperator: Rome
  • Victoria 2
  • Imperator: Rome Deluxe Edition
  • Warlock 2: The Exiled
  • BATTLETECH - Digital Deluxe Edition
I've been using it and no problems so far. The problem with that one is that it seems all the children get married off matrilineally, when ideally under equal succession the oldest daughters would be married off matrilineally and the youngest ones would be married off regularly. Otherwise I think it won't be very balanced.

I'm still following Wagonlitz's mod as well. I've only been testing w/ equal faiths. But to keep from messing things up I'm only using one mod at a time.

In any mod, there still will need to be a way to not let the AI destroy their dynasty for the sake of an alliance. Players would not do that. I could marry off my oldest daughter in regular marriages to the Byzantine emperor and have the best alliance in the game but obviously it wouldn't matter because my game would end when my grandchildren inherit. Whereas the AI just doesn't care.

in my mod (based on Wagonlitz's code) only heirs will get married matrilineally.