Developer diary

Developer Diary #20: Family Trees and Succession Laws

MKA Engine helps games find family relationships and title order. A game's succession law ranks heirs; the game decides who receives the title.

Contents
A family tree with a crown passed along its branches and a separate title hierarchy

In short: MKA Engine helps a game find family relationships and the order between titles using information supplied by the game. If the game chooses to use its own succession law with the engine, the engine can order heir candidates. The game decides what the law means and who receives the title.

What was the problem?

When a ruler dies, the game has several different questions to answer: Who is related? How are titles—offices or ranks tracked in the game—arranged above and below one another? Which candidate comes first under the succession law? These questions are connected, but they are not the same decision. A family tree describes relationships between people; a title hierarchy describes how offices relate; a succession rule describes the game's choice.

MKA Engine helps games follow these relationships and apply rules the game supplies. It does not invent a family, title system or inheritance law. Keeping that distinction lets strategy games use different dynastic and succession rules.

Family ties: ancestors, descendants and kinship

A mod—a package that adds game content and rules—can supply family relationships. The engine uses that information to find a character's ancestors and descendants. Kinship distance is the number of parent links on the shortest family path between two people. The engine does not decide a character's biography or what a family line means beyond the relationships the game provides.

This can help a game apply its own family rules. In a test family tree, two cousins shared an ancestor, while a character outside their family had no shared ancestor within the searched range. If a game already has a list of candidates for marriage or another choice, the engine can remove those who are not alive and those closer than the game's chosen limit, then order the remaining candidates by the game's own priority. The game decides who enters the list, which relationships are acceptable and whether a marriage is allowed.

A game can group people it treats as part of the same family branch. The engine can help list the living members; the game decides whether that group represents a dynasty, a branch of a family or something else.

A title hierarchy is different from a family tree

A family tree shows parent relationships between people. A title hierarchy shows one office above or below another. One title's position above another does not mean their holders are parent and child.

A family tree with descendants sharing an ancestor on the left and a separate title hierarchy on the right

MKA Engine can help a game find titles above or below a given title in the arrangement the game defines. Before changing a title's place, the game can ask whether following the new arrangement would eventually lead back to the starting title. The engine reports the result; the game decides whether to change the hierarchy.

Succession: the game chooses, the engine orders candidates

Succession is the game's rule for who may follow the current title holder, and engine support is optional. If a game describes its own law as content and chooses to use the engine's support, the engine can find living heir candidates, apply the game's eligibility conditions and put them in the order the law specifies. For example, a law might put a nearer generation first and then older candidates of that generation; another game can choose a different rule.

In a test game, the first candidate died before the following game step, and another candidate moved to the front of the next list. This is one example of the ordering reflecting a changed game world. The engine supplies the ordered candidates; the game decides who receives the title and how to apply that change.

Family records and a game-defined law produce an ordered heir list, while the game separately records the new title holder

What did the checks show?

Checks confirm that family information produces the expected relationships and candidate filtering, that the title hierarchy can recognize a change that would create a loop, and that optional succession support follows the game's ordering law.

A separate simulation measured daily progress without using the family, title-hierarchy or succession features. Its daily summaries stayed the same, while the small timing differences fell within the ordinary variation between repeated runs. That measurement did not show how fast active family and succession questions are, so we make no performance claim about using them.

Why did we make this distinction?

Every game can give family ties and titles a different meaning. Helping with common relationships makes the engine reusable without fixing one dynasty or inheritance model for every game. Letting a game optionally use its own law preserves the boundary between engine assistance and game rules.

What does it cost?

The game must provide its family and title relationships and, if it chooses the engine's succession support, define its law. The measurement described here does not include the performance cost of active family or succession questions.

What comes next?

In the next diary, we will look at how the engine represents treaties, organizations and disputes between countries.

Frequently asked questions

Does the engine define a family's relationships?

No. It follows the family ties supplied by the game or its mod; the game gives those ties their meaning.

Does kinship distance decide whether two people can marry?

No. The engine can help measure relationships within a candidate list the game supplies. The game sets the marriage rules and outcome.

Is a title hierarchy the same as a family tree?

No. One describes family ties between people; the other describes how offices are arranged above and below one another.

Does every game have to use the engine's succession support?

No. A game can use its own law with the engine or manage succession with its own rules.

For how a game's world data is stored, see Developer Diary #3. For how control of a state changes between players, see Developer Diary #15. Learn more on the MKA Engine and developer diaries pages, or visit contact if you have questions.

Sources and related docs

You may also like

  • How is a strategy game's world map made?

    For MKA Engine we built a 27,357-location world map of 1337 from real data: how terrain, rivers, straits, population and location borders were made.

  • The road to a game engine

    How we started MKA Engine: reading four games, treating determinism as law, moving phase by phase with measurements, and where we are now.