Inside the level-up screen: the CharGen pipeline

From logic/ui-levelup.json (Kingmaker.UI.MVVM._VM.CharGen, the MVVM view-model root) cross-checked against the mechanics datasets it names — build 20212986, patch 2.7.0x.

Character creation and level-up share one machine. The UI runs a fixed phase pipeline, and every phase is just a renderer over data this database already serves:

Race → Class → AbilityScores → Alignment → Skills → FeatureSelector (feats/talents) → Spells → Mythic → Appearance → Total

Level-up doesn't have its own screen logic — it reuses the same phases for the gained level. That's why multiclassing feels seamless: the Class phase simply runs again.

The Class phase is prerequisite evaluation

Available classes are decided by prereq groups — All/Any with ForcedTrue short-circuit (the two-bucket algorithm) — plus level caps (20, 10 for prestige) and alignment restrictions that accumulate or replace. Archetype picks drive AddFeatures/RemoveFeatures per level plus spellbook swaps — the diff-patch grammar, applied live in the picker.

FeatureSelector: no dead options

The feat/talent phase evaluates every candidate feature against your unit and the selection state — already-picked children are excluded, UI text comes from Prerequisite.GetUIText, and PrerequisiteSelectionPossible exists specifically to grey out selections that could never become valid. The feat economy numbers are what this phase draws from.

Point-buy is data, not code

Ability-score costs come from StatsDistributionPreset / BlueprintRoot entries, with racial modifiers applied from race features — which is why the planner can reproduce the buy exactly.

The Mythic phase gates on story, not level alone

Mythic classes appear only when LevelUpState.NextObligatoryMythicClass says so, gated further by PrerequisiteMythicLevel and the unlock etudes (see the etude machine). Your first mythic rank is literally an etude threshold firing into the level-up screen.

Spell picks are set arithmetic

Known-spell picks per spellbook level compute available = spell list minus known — straight set difference over spell-lists + spellbooks. No hidden weights, no "suggested" bias; the picker shows exactly the list math.

Every phase's output lands in our Classes section and the build planner, which reimplements the same evaluations offline.

Sources

  • logic/ui-levelup.json — the CharGen MVVM pipeline, per-phase gating and data bindings, evidence-attributed.
  • Cross-referenced: logic/archetype-features.jsonl, logic/mythic-path-unlocks.jsonl, logic/spell-lists.jsonl, logic/spellbooks.jsonl.
  • Build: 20212986 (patch 2.7.0x).

Related database section: Classes — e.g. Dragon.