melissa kate
<< Doppelgänger

Discoveries and effects authoring model

Discoveries vs. variables

Discoveries = append-only narrative facts ("you found the key", "you met the barista"). Once granted, never removed. If something needs to be revoked or counted, it's a variable, not a discovery — "right in the name, it's a variable state."

Variables = mutable quantitative or boolean state. Counts, currency, mood, anything that can decrease, multiply, or branch on >= 50.

Decision rule for authors:

Where they live

Discoveries are granted on choice.grants_discoveries[] (per-choice canonical). The scene-level event.grants_discoveries is preserved in data but exposed in the editor as a read-only summary of all incoming choice grants ("Discoveries Granted on Entry"), with an "Always granted on entry" row for legacy values.

Effects (variable mutations like gold += 50) live in event.effects[] / choice.effects[]. They are never evaluated inside content text — {coffee += 1} will not mutate state, only {coffee} reads. The Variable Editor modal includes an explicit anti-pattern hint.

Choice gating UI

Each choice (regular EventEditor + DialogueEditor's active response panel) has two dropdown pickers below Choice Discoveries / Choice Effects:

Both use the DiscoveryPicker component, which pulls from the canonical set of discovery names walked from the entire game via getAllDiscoveryNames(events). Stale chips (referencing a discovery that no longer exists anywhere) render with a warning style + tooltip.

OR-mode (show_if.any) is intentionally NOT surfaced. Keep authoring simple — authors who need OR can hand-edit JSON. Don't add a mode toggle "for completeness."

Why

How to apply