Home
All projects
Prototype

Living Village

NPCs who know only what reached them.

Status
PrototypeAn early working build.
Started
Role
Product Design, Systems Architecture, Test Design, Development Orchestration
Built with
  • Unreal Engine 5.8.1
  • C++
  • Unreal HTTP
  • Unreal JSON
  • Unreal Automation Framework
  • Claude Sonnet 5
  • Local JSON

Overview

Living Village is an Unreal Engine prototype about NPCs who know only what has actually reached them.

Most conversational NPC demos focus on whether the dialogue sounds natural. I wanted to start one layer lower: what is the character actually allowed to know?

The initial scenario is intentionally small. The player can take an axe belonging to Thomas, a woodcutter. If Thomas sees it happen, he remembers the theft firsthand. If he is facing away, he does not magically learn who took it. The player can later confess, deny it, or discuss the event through free-form dialogue.

The important rule is that the language model never gets to decide what Thomas knows.

World Truth Is Not Character Knowledge

The prototype began with one loop:

player action → world event → perception → memory → changed behavior

A custom range, field-of-view, and line-of-sight check determines whether Thomas perceived the event. The same theft can therefore produce two different internal histories based only on where he was looking.

Claude Sonnet 5 receives Thomas’s character profile, allowed current context, memories, derived beliefs, and a small conversation history. It decides how Thomas speaks. It does not decide whether he witnessed the event.

That distinction keeps natural-language generation inside a deterministic simulation rather than letting the model become the simulation.

Provenance Matters

Conversation can also create persistent memory, but claims remain claims.

If the player says, “I took your axe,” the system does not store “the player took the axe” as objective truth. It stores the fact that the player said they took the axe.

That lets direct observation, confession, denial, rumor, and testimony coexist without collapsing into one authoritative history.

An LLM summarizer can easily destroy this distinction by turning “I killed the mayor” into “the player killed the mayor.” To avoid that, the extraction model only returns constrained information such as the verbatim quote, topic, and importance. C++ assigns provenance and constructs the persistent testimony record.

Memory Is Not Belief

I also separated memory from belief.

Memories are durable records of what reached a character. Beliefs are deterministic conclusions rebuilt from that evidence.

Thomas can therefore remember both that he saw the player take the axe and that the player later denied it. The denial does not erase the observation. His belief reducer can continue to favor firsthand evidence, recognize the contradiction, and lower trust in future player claims.

Beliefs are recomputed rather than saved as independent truth, which keeps them traceable to the evidence that produced them.

Moving Information Between Minds

The latest architecture adds Sarah, an innkeeper, as a second independent agent.

Thomas can tell Sarah that he saw the player steal his axe, but Sarah does not inherit Thomas’s memory or confidence. She stores an NPCStatement from Thomas, applies her own trust in him, and reaches a weaker conclusion from secondhand evidence.

The only thing transferred is testimony.

That is the foundation for rumors, misinformation, conflicting accounts, and social knowledge without creating an omniscient shared memory store.

Current State

Thomas’s full scenario has been manually validated in Unreal PIE: perception, provenance-aware persistent memory, LLM dialogue, conversation continuity, contradiction handling, belief revision, and trust all work together.

Sarah and NPC-to-NPC testimony compile cleanly and pass the automated suite, but the complete two-character playable scenario still needs final live acceptance testing.

The visuals and environment are intentionally minimal. Living Village is a systems prototype first. Its current value is proving that an LLM can make a character expressive without being allowed to invent the character’s knowledge.

Milestones

  1. LLM dialogue added

    Connected Claude Sonnet 5 while keeping perception and memory authority deterministic.

  2. Provenance and belief revision

    Separated direct observation from player claims and derived trust-aware beliefs from persistent evidence.

  3. Second agent introduced

    Added Sarah with independent memory, trust, beliefs, and NPC-to-NPC testimony handling.

  4. Perception proof

    Proved that the same theft produces different future behavior depending on whether Thomas actually witnessed it.