It was fairly common for monarchs in the medieval era (and even beyond — i.e. Elizabeth I and James VI-and-I) to adopt someone as their heir if it seemed clear they were going to die childless, particularly if they or their court were leery of who the title would pass to by the normal rules of succession. Obviously in adopting non-family members this should still cause a game over, but sometimes there are unlanded family members floating around who aren't eligible for the succession but would otherwise allow for the continuation of the dynasty. The AI, on the other hand, might choose to adopt a non-family member since it wouldn't end the game for them.
This should probably cost a large amount of prestige (or whatever the equivalent will be in CK3) and like any succession change give opinion maluses to anyone in line for the throne, to prevent it being used frivolously. It should probably also require the assent of the majority of your most influential vassals.
This should probably cost a large amount of prestige (or whatever the equivalent will be in CK3) and like any succession change give opinion maluses to anyone in line for the throne, to prevent it being used frivolously. It should probably also require the assent of the majority of your most influential vassals.