← Blog

A Wizarding World Made of Committed Truths

From Magical Mysteries to Mathematical Meaning · Article 3 of 7

A conventional game state might record where the player is, which doors are open, and which objects have been collected. A mystery needs something more demanding.

The fictional wizarding world contains ordinary facts and magical ones: a brass key is in a drawer, a broom arrived at the north tower at 9:40, a crystal vial shattered after dinner, and a protective ward failed before midnight. But it also contains facts about minds. One character saw the glass before it broke. Another believes the key was stolen. A third knows where the key is but claims not to. The detective has heard one version of the story but not another. A witness may sincerely report something false. A liar may state something true for deceptive reasons. Two people may use different descriptions for the same event.

These are not incidental complexities. They determine what counts as evidence.

If a character says, “I never entered the study,” the statement matters differently depending on the character’s actual history and knowledge. If the character truly never entered, the statement is truthful. If the character entered but forgot, it may be false without being a lie. If the character entered, remembers doing so, and intentionally denies it, the world contains at least three distinct facts: the event, the character’s knowledge of the event, and the deceptive statement.

A mystery engine that stores only narrative text leaves the model to reconstruct those distinctions every time they matter. A persistent formal-semantic representation can store them directly.

The result is best understood as a constructed network of truths. Some nodes correspond to entities: people, rooms, objects, documents. Others correspond to events, observations, statements, hypotheses, or evidence. Relations connect them: occurred_at, occurred_before, observed_by, known_by, believed_by, lied_about, caused_by, supports, contradicts, derived_from, and so forth.

The exact vocabulary does not need to be perfect at the beginning. In fact, one of the useful properties of this method is that the schema can evolve as the work reveals distinctions that are operationally important. If the game repeatedly needs to distinguish direct observation from hearsay, that distinction can become formal. If it becomes important to record whether a character knows that another character knows something, the model can be extended. The purpose is not to create an ontology for its own sake. Structure is added when it buys reasoning, validation, or control.

The most important rule is that committed truth should be distinguishable from generated possibility. Suppose the detective wizard asks whether a concealed magical passage exists behind the apothecary wall. The model might decide that such a passage would be plausible and useful. But plausibility is not enough. A new passage can affect movement possibilities, ward boundaries, timelines, witness visibility, and alternative explanations of the magical crime. The passage should therefore begin as a proposed fact. The system can inspect what its existence would change before accepting it into the world.

Once accepted, the corridor becomes part of canonical state. Future generation should treat it as true unless a later governed mutation explicitly revises it.

This gives the world a property that ordinary conversational role play often lacks: addressable persistence. The model does not merely have a memory that “there was something about a corridor.” It has an object or relation whose identity can be queried and whose consequences can be followed.

That matters because coherence is relational. A fact can be harmless in isolation and destructive in combination. Consider a character who is established to be in the dining room from 10:00 to 10:20. Later, a new scene proposes that the same character hid a weapon in the attic at 10:12. Neither statement is intrinsically implausible. Together they create a temporal-location conflict unless the world contains some mechanism that resolves it.

When the relevant facts are represented explicitly, the system can search for this kind of conflict before the second claim becomes authoritative. Some checks can be straightforwardly structural. If two exclusive locations overlap in time, the state can flag the conflict. If a person is said to possess an object after that object has been destroyed, the system can identify the inconsistency. If knowledge is acquired before the event that supplies it, the epistemic timeline can be questioned.

Other checks remain semantic. Two statements may conflict without sharing the same vocabulary. A character saying “I had never met him” may contradict a prior fact expressed as “they spent three evenings together the previous winter.” That relation requires interpretation rather than simple field comparison. But even here, the structured state helps because the model is comparing a bounded set of relevant objects rather than rereading an entire conversational history and reconstructing authority from prose.

Provenance becomes useful here as well. A fact can record where it came from: an authored premise, a generated event, a character observation, a document, or a later inference. That lineage matters when the case changes. If a world fact is revised, the system can identify which observations, statements, or clue interpretations were derived from it and require review. The same mechanism prevents a later generated explanation from masquerading as if it had always been part of the historical state.

The state also permits a cleaner distinction between world truth and evidence. A fact can be true without ever becoming evidence for the player. The murderer may have burned a letter completely. The event belongs to the world history, but if no trace remains and no one observed it, the player may never have access to it. Conversely, an object can function as evidence without directly revealing the truth. A train ticket may support a travel hypothesis, but its significance depends on other facts about timing, identity, and possession.

Evidence is therefore relational. Something becomes evidence for or against a proposition in a particular epistemic context.

This is one reason a generic inventory of “clues” is too weak. The same observation can support several hypotheses at one stage of the investigation and become discriminating only after another fact is learned. The state should be able to represent not just that a clue exists, but what it bears on and under what conditions.

The solver’s state has to be represented separately as well. The player may have discovered a muddy footprint even though the system already knows who made it. The player may believe it belongs to a gardener. Later, a shoe-size comparison weakens that hypothesis. The world truth does not change, but the solver’s epistemic state does. This separation allows the system to track the difference between reality and the learner’s current model of reality.

The same is true for non-player characters. A witness can hold a mistaken belief. A suspect can know a fact the player has not discovered. Two characters can disagree while the canonical world state contains a single underlying history. Deception becomes representable because truth, belief, knowledge, and utterance are not collapsed into one textual layer.

This formalization also changes how the model can reason about consequences. Suppose a new fact is proposed: a household familiar saw Mara leave the warded conservatory at 12:20. The system can ask several questions before committing it. Where was the maid at that time? Could she see the conservatory exit? Does she know Mara well enough to identify her? Has the maid already said something incompatible? Would this observation make the case too easy? Does it duplicate another clue? Does it create a contradiction with the intended timeline? If accepted, which hypotheses and later scenes become affected?

The world model therefore becomes a substrate for both generation and criticism. The model can generate candidate extensions semantically, then use the explicit state to evaluate them structurally and contextually. The state can also support deterministic algorithms where appropriate: dependency traversal, temporal ordering, reachability, consistency constraints, or impact analysis. Semantic inference and formal computation alternate rather than compete.

This is the same hybrid pattern that appeared in the earlier persistent-state writing project. The LLM is good at recognizing meaning, proposing relations, generating explanatory structures, and interpreting ambiguous situations. A structured external system is good at preserving identity, making dependencies explicit, recording provenance, and supporting exact operations over committed representations.

A mystery world benefits from both. The model supplies the semantic richness required for motives, testimony, plausible behavior, and contextual interpretation. The persistent truth network supplies the continuity required for a project that may unfold across many interactions and many generated artifacts.

That division of labor becomes especially important once the world is allowed to change during play. A static database can be coherent because everything is authored in advance. A generative world must remain coherent while new facts are proposed continuously.

The question is therefore no longer whether the model can invent an interesting detail. It can.

The question is whether the detail should be allowed to become true. That requires a protocol for mutation: a controlled process that evaluates new facts against the world, the evidence structure, the character knowledge model, and the intended trajectory before narrative prose commits them to the player’s experience.