So here's the situation :
I'm currently played as Louis II Karling of Italy 867, snapping Sicily by doing invite and push claim thingy, and then going to conquer Bavaria to finally form the Italian Empire.
What's stupid of me is that I'm not patient enough to wait for Legalism level 3, change into Late Feudal Administration and then go for Primo from Agnatic Gavelkind, while still a King of Italy. I'm now old, stressed and chance of living the 10 years to change the succesion law in the Empire is literally slim. My only son, Karl have 4 kids, all GIRLS which frustate me, and worse, he is now depressed as his wife cheated on him and gave birth to baby boy with the Prince-Bishop of Trent
So I checked the inheritance, and found that King of East Francia is second in inheritance, followed by his 1,2 and his third sons, and then after that King of West Francia as the last pretender to the throne. Which means if my son died which is totally possible atm, he's close to become Kaiser of HRE.
I don't really worried about the inheritance as its still goes to the member of dynasty, but out of curiosity,
how does the game determine who's going to inherit outside the direct descendant of the current ruler (son, daughter and grandsons) in Agnatic Gavelkind? Because King of East Francia was descended from my uncle, Ludwig (his grandson), and King of West Francia was descended from my cousin, Louis of Aquitane (his sons) which means he's direct blood to my other uncle too, Charles the Bald.