Why simulating character behavior should start with math, not language models.
The Generative Agents Problem
In 2023, Stanford’s “Generative Agents” paper put 25 LLM-powered characters in a virtual town and let them interact. The characters planned their days, formed relationships, even organized a party. The paper received widespread attention and launched a wave of “AI town” projects.
The architecture is straightforward: each character is an LLM instance with a memory stream. When two characters meet, both LLMs generate dialogue. When a character needs to decide what to do next, the LLM generates a plan. The system’s output — the behaviors, the conversations, the social dynamics — is entirely produced by language models.
This is a valid research contribution. But the claims that followed, and the commercial projects that built on the concept, reveal a fundamental confusion about what “emergence” means.
When an LLM generates text that says “I decided to organize a party because I felt lonely,” that is not emergent behavior. That is an LLM generating plausible-sounding narrative about loneliness. The character doesn’t have a loneliness metric that accumulated over time through specific, traceable interactions. The LLM produced a coherent story about loneliness because that’s what LLMs do — they produce coherent stories.
The distinction matters. In an LLM-driven system, if you ask “why did Character A betray Character B?”, the answer is: because the LLM generated text describing a betrayal. The causal chain is opaque. You cannot trace it back to specific state changes, specific interactions, specific accumulated pressures. You can only read the LLM’s post-hoc rationalization.
This is not emergence. This is generation.
What Emergence Actually Requires
Emergence requires simple, well-defined rules producing complex behaviors that the designer did not explicitly program. Conway’s Game of Life has four rules. Gliders, oscillators, and universal computation emerge from those rules. Nobody told the system to compute — it computes because the rules, applied iteratively, produce computation.
Lenia, a continuous extension of cellular automata developed by Bert Chan, demonstrates this principle with striking clarity. Orbium — a Lenia creature — moves, maintains its structure, and interacts with other creatures. None of this behavior is programmed. It arises from continuous growth and decay functions applied to a scalar field. The creature doesn’t “know” it’s moving. It moves because its internal structure, within a field governed by differential equations, mathematically produces motion.
SimWorlds asks the analogous question for characters: if a character’s beliefs, desires, fears, and relationships are fully described as continuous state vectors, and interaction rules are defined as mathematical functions, can their behavior be computed rather than generated?
The answer, after six phases of development, is yes.
Architecture: Three Tiers of Computed Behavior
SimWorlds uses a three-tier architecture, each adding complexity while preserving one constraint: all mechanics are continuous functions. No discrete thresholds produce behavior. Discrete-looking phenomena — alliances forming, leaders emerging, betrayals happening — emerge from continuous dynamics.
Tier 1: Core Mechanics
Each character has a 5-dimensional state vector (power desire, moral rigidity, loneliness, fear level, trust default), all continuous values between 0.0 and 1.0. Each pair of characters has a 5-dimensional directional relationship (trust, respect, fear, dependency, affection).
The central mechanic is books as influence functions. A catalog of 12 books spanning 5 philosophical traditions (from Han Feizi’s Legalism to the Tao Te Ching) serves as the “force field” that shapes character evolution. Each round, every character selects a book via softmax over affinity scores — essentially, characters read what resonates with their current psychological state. The book then shifts their state vector through a mixing function governed by absorption rate and receptivity.
This design is directly inspired by Lenia’s convolution kernels. In Lenia, a kernel defines how neighboring cells influence a cell’s state. In SimWorlds, a book defines how cultural content influences a character’s state. The parallel is structural, not metaphorical: both are functions that take current state as input and produce state change as output. Both operate through affinity (Lenia: spatial proximity; SimWorlds: psychological resonance).
After reading, selected character pairs interact. Four interaction types emerge from state comparisons: resonance (both read the same book), productive debate, destructive debate, and dependence requests. Interactions modify relationship vectors through continuous delta functions.
Tier 2: Emergent Social Dynamics
Tier 2 adds four continuous mechanics and a read-only observation layer.
Weighted pair selection replaces uniform interaction with softmax-weighted sampling. Strong feelings (positive or negative) increase interaction likelihood. This creates natural clustering — some pairs interact frequently while others rarely meet.
Emotional contagion spreads certain dimensions (loneliness, fear, trust) between characters who share positive relationships. This produces the phenomenon of emotional clustering in groups without any explicit “group formation” mechanic.
Alliance momentum tracks pairwise interaction history as a continuous accumulator. Positive interactions build momentum toward alliance; negative interactions push toward rivalry. “Alliance formed” is never an explicit event. It is an observation derived from continuous momentum exceeding an observation threshold.
Observation labels are six read-only detectors (dominance, alliance, isolation, betrayal, convergence, polarization) that classify emergent patterns at end of each round. The critical design constraint: labels never feed back into mechanics. They classify what has already emerged. If you see “Alliance detected,” it’s because the continuous dynamics produced alliance-like behavior, not because a label triggered alliance mechanics.
Tier 3: Irreversible Events
Tier 3 introduces one-way state transitions. Characters can be exiled, coups can succeed or fail, pacts can form, schisms can split the population. Six irreversible event types, each triggered by continuous state conditions, each producing permanent structural changes.
The most interesting mechanic is Memorial-as-Book. When a character dies through martyrdom (exile + high moral rigidity + sufficient supporters), they become a Memorial — a frozen influence source that enters the book selection pool alongside regular books. Living characters can “read” a memorial, absorbing the dead character’s values. A dead character’s legacy operates through the exact same mechanics as cultural influence. No new code paths needed. This is both computationally elegant and thematically resonant: a person’s legacy is their continued cultural influence on the living.
The Crucial Difference
In SimWorlds, every behavior is traceable. “Why did Zhao Wei betray Sun Yi?” has a concrete answer: look at Zhao Wei’s reading history (Han Feizi, The Dark Forest — both reinforce power-seeking and distrust), trace the trust decay in their relationship over 30 rounds, identify the specific rounds where fear accumulated past the tipping point.
This is not a narrative the system generated. It is a causal chain the system computed. The distinction is the same as the difference between a weather simulation and a weather report. The simulation computes atmospheric dynamics from physical equations. The report describes what happened in natural language. One is a model. The other is a description.
LLM-based character systems produce descriptions. SimWorlds produces a model. The model can then be described — and that’s where LLMs become genuinely useful (planned Phase 7), not as the behavior engine, but as the narrative renderer that translates computed dynamics into readable prose. The LLM adds readability, not behavior.
What Computed Emergence Looks Like
To make this concrete, here are patterns that have emerged across multiple simulation runs — none of which were programmed or anticipated.
The Reading Cascade. In one run, Chen Lu (a character with high trust and moderate morality) discovered the Tao Te Ching early and shared it with Li Qing through the book sharing mechanic. Li Qing, whose high moral rigidity made her receptive to the text, subsequently shared it with Sun Yi. Within 15 rounds, three characters had independently shifted toward the “Idealist Peaks” region of the terrain map. This wasn’t programmed as “ideology spreading through social networks.” It emerged from the interaction of book affinity, relationship trust, sharing mechanics, and state mixing. The causal chain is completely traceable: which round each character first read the text, which relationship enabled the sharing, how much each character’s state shifted per reading.
The Fear Spiral. Zhao Wei, starting with high power desire and high loneliness, gravitates toward Han Feizi and The Dark Forest — texts that reinforce power-seeking and distrust. His rising power desire triggers fear in other characters who interact with him. Fear is a contagious dimension in Tier 2. Characters who fear Zhao Wei spread that fear to their interaction partners. By round 40, the majority of the population fears one character — not because of any “threat system,” but because emotional contagion through trust networks amplified an initially mild signal. This in turn triggers isolation detection (Zhao Wei is avoided), then exile (majority fear + isolation + low alliance support).
The Unexpected Alliance. Wang Fang (pragmatic, moderate values) and Sun Yi (strategic, low fear) share no obvious ideological alignment. But the weighted pair selection mechanic, which increases interaction probability based on relationship intensity (positive or negative), causes them to interact frequently after a series of productive debates. Productive debates increase respect while reducing trust slightly — creating an unusual relationship profile where mutual respect is high but trust is moderate. This relationship, uncommon in the initial configuration, produces a distinctive alliance type: professional respect without personal warmth. The observation label system classifies it only when the momentum threshold is reached.
The Dead Man’s Influence. After Zhao Wei’s martyrdom (exile + high moral rigidity + two supporters), his Memorial enters the book pool. Characters who previously trusted him are drawn to the Memorial through the relationship affinity modifier. Over 20 rounds, two characters’ state vectors begin converging toward Zhao Wei’s final position — not because they’re “following his legacy” in any programmed sense, but because the Memorial’s influence vector (frozen at his death values) acts as an attractor for psychologically similar readers. The observation label system can detect this convergence, but the convergence itself is purely mechanical.
These patterns are reproducible. Given the same seed, the same cascade, spiral, alliance, and memorial effect occur at the same rounds. Change one parameter — swap a book, alter an initial relationship, apply an intervention at round 20 — and the dynamics diverge. This is what makes it a model rather than a narrative: you can perform controlled experiments on it.
Research Questions
SimWorlds was built to investigate several open questions:
Emergent narrative quality. Can computed behavior produce sequences of events that humans find narratively interesting? Early results suggest yes — alliance formation, betrayal cascades, and exile events all produce compelling dynamics. But “interesting” is not “authored.” The system doesn’t aim to produce good stories. It aims to produce honest dynamics that sometimes happen to be good stories. The distinction is important: authored narrative optimizes for reader experience, while computed dynamics optimize for nothing — they simply follow the math. When the math produces compelling drama, it suggests that narrative tension may be a natural property of certain dynamic systems, not an artifact that requires authorial intent.
Explainability as a first-class property. In an LLM-driven system, asking “why” produces a rationalization. In a computed system, “why” has a verifiable answer. Every state change is logged, every interaction recorded, every influence function traceable. This makes the system inherently auditable — a property that matters far beyond entertainment. Consider the implications for AI safety research: if you’re studying how agents develop trust or hostility, you need a system where those dynamics are mechanistically transparent, not one where the model produces plausible-sounding explanations after the fact. SimWorlds provides exactly this: a fully inspectable social dynamics engine where every outcome can be traced to specific causes.
The authorship boundary. Where does the designer’s influence end and emergence begin? In SimWorlds, the designer controls initial conditions (who the characters are at round 0), the rule set (how states interact), and the cultural environment (which books exist). Everything else is computed. This creates a meaningful design space: you can ask “what if the book catalog had no power-reinforcing texts?” and run the experiment. The result isn’t a predetermined outcome — it’s a genuinely unknown trajectory that depends on the interaction of all the continuous dynamics. The designer shapes the possibility space but does not determine what happens within it.
Intervention as experimental method. The multi-world system allows forking a simulation at any point. “What if Zhao Wei had been forced to read The Analects instead of Han Feizi at round 50?” Fork the world, apply the intervention, let both branches run, compare outcomes. This is controlled experimentation on character dynamics — something impossible in LLM-based systems where behavior is not reproducible. Because the simulation is deterministic given a seed, you can isolate the effect of a single variable change. This is the scientific method applied to character behavior: hold everything constant, change one thing, observe the difference.
Cultural content as force field. The choice to use books — specifically philosophical texts from distinct traditions — as the primary influence mechanism was deliberate. It models a real phenomenon: people are shaped by the ideas they encounter, and they seek ideas that resonate with their current state. The book catalog is not decorative flavor. It is the environment that the characters inhabit, just as Lenia creatures inhabit their growth/decay field. Change the environment and you change what emerges. A catalog heavy in Legalist texts produces a different social landscape than one dominated by Taoist thought. This is testable, repeatable, and observable — and it suggests a research program around how cultural environments shape social dynamics at the mechanistic level.
What’s Next
LLM Narrative Layer (Phase 7)
The planned next phase adds natural language rendering to the computed dynamics. The LLM receives structured evidence — specific state changes, specific interactions, specific causal chains — and produces readable narrative. The LLM is constrained by evidence, not generating behavior from nothing. This is the proper role for language models in simulation: translation, not computation.
NSP Integration (Phase 8)
SimWorlds will connect to the NSP (Narrative State Protocol) observation layer, mapping simulation entities to NSP primitives: Characters become Entities, state dimensions become Attributes, relationships become Relations, events become Evidence, labels become Perspectives, causal analyses become Diagnostics. This makes the simulation’s internal state queryable through the NSP protocol — enabling cross-system reasoning about character dynamics.
Full Fork: Divergent Worlds
Currently, forking creates a branch with the same characters and rules but different future trajectories. A planned extension — “full fork” — would allow creating worlds with entirely different character sets, book catalogs, or rule parameters from the start. This transforms SimWorlds from a single-scenario simulator into a comparative framework.
The research possibilities multiply. Run the same five characters through three different book catalogs — one Legalist-heavy, one Taoist-heavy, one balanced — and compare the social structures that emerge after 100 rounds. Or take the same cultural environment and populate it with different personality distributions: what happens when most characters start with high trust versus high fear? Full fork turns these questions from thought experiments into executable programs.
This capability is particularly relevant for the cross-domain applications discussed below. An organizational consultant could simulate the same team under different policy environments. A political scientist could model the same population under different media landscapes. The common pattern is: hold agents constant, vary environment (or vice versa), compare emergent structures.
Cross-Domain Framework
The SimWorlds architecture — continuous state vectors, influence functions, observation labels, irreversible events — is not specific to fictional characters. The framework generalizes to any domain where agents have internal state that evolves through interactions and environmental influences:
-
Organizational dynamics: Employees with satisfaction/engagement/burnout vectors, company policies as influence functions (a new remote-work policy shifts engagement dimensions just as a book shifts character state), team formations as emergent structure. Observation labels detect when a department is polarizing or when informal leaders emerge. Irreversible events model layoffs, promotions, and acquisitions.
-
Ideological evolution: Citizens with belief vectors (economic left-right, social conservative-progressive, institutional trust), media sources as influence functions (consuming different media shifts beliefs through the same mixing mechanics as book reading), social interaction spreading attitudes through the same contagion mechanics. Polarization is not a programmed outcome — it emerges (or doesn’t) from the interaction of media environments and social network structure.
-
Ecosystem modeling: Species with trait vectors (metabolic rate, reproductive strategy, territorial behavior), environmental pressures as influence functions, predator-prey relationships as directed interactions. Extinction is an irreversible event. Niche formation is an emergent observation label. The framework naturally captures evolutionary dynamics without simulating genetics — just as SimWorlds captures social dynamics without simulating neurons.
The common abstraction across all these domains is: agents with continuous internal state + environmental influences that shift state + interaction rules that modify relationships + observation labels that classify emergent structure + irreversible events that permanently alter the system. This is not a metaphor. It is a reusable computational architecture.
The core insight — that complex social dynamics can be computed from continuous state and simple rules, without requiring generative AI for behavior — has broad applicability. The framework’s value lies not in the specific domain (fictional characters reading Chinese philosophy) but in the architecture: state vectors + influence functions + observation layers + irreversible events is a general-purpose toolkit for modeling any system where agents with internal state evolve through environmental interaction.
The Lenia parallel is instructive here. Lenia was developed as a study of continuous cellular automata, but its insights about how simple continuous rules produce complex life-like behavior have influenced thinking about artificial life, self-organization, and emergence more broadly. SimWorlds aims to do for social dynamics what Lenia did for artificial life: demonstrate that the complexity doesn’t require complex generation — it requires well-chosen continuous rules applied at scale.
Demo Guide
A live instance runs at jamesshare.com/simworlds. Here’s what to look for:
The terrain map positions characters by psychological state (power desire on X, moral rigidity on Y). Watch how characters move over time — a character drifting toward the bottom-right is becoming more Machiavellian. Movement trails show the trajectory.
Relationship lines appear when you click a character. Green lines = trust + affection. Red = fear. Blue = respect. Width indicates strength. Asymmetric relationships (A trusts B but B fears A) are visible as differently-colored lines in each direction.
The event log (bottom panel) shows what’s happening. Filter by type: Resonance (shared reading), Conflict (debates), Labels (emergent pattern detection), Irreversible (exile, coup, etc.). Irreversible events are pinned — they never scroll away.
Add characters (up to 8 per world) and books (up to 20) at runtime. Auto-generate from archetypes or customize manually. Exile characters you want to remove from the simulation.
Fork the world to create parallel timelines. Use the Distribute drawer to force-feed books to specific characters and observe how interventions change trajectories.
Speed controls: Adjust from 0.25x to 4x. Pause to examine state. Step forward one round at a time for detailed observation.
The simulation is deterministic given the same seed. If you see something interesting, note the round number and world state — you can fork from that point and explore alternatives.