One More Branch #1

Two nights ago I endured the kind of insomnia that forces you to roll around in bed under a barrage of intrusive thoughts, but also receiving some compelling ideas from the girl in the basement. And a new idea excited me immediately. In case you’ve been following my blog, which likely only a couple of people worldwide do at the most, you may have read recent posts about a project about evolving board games. Well, I’m growing out of it already. Don’t know what to tell you. Thankfully we’re in the era of Codex and Claude Code, and you can program whole new apps in a couple of days, which is what I’ve done for the new one.

In summary: as a kid I loved those “Choose Your Own Adventure” books. I devoured them. I resent the fact that I lent one to a guy I ended up hating, and I never saw that book again; it was my favorite of those kinds of books, too (it was about a guy, a knight or something, exploring a vast subterranean complex of caves. I don’t remember much of it other than he fought monsters and at the end there was a gorilla. I never found out the title of that book again). We’re in the era of large language models that can write better than 99% of writers, so why not task it with producing such interactive branching stories in a structured manner?

Well, it’s done. Here’s the repository: https://github.com/joeloverbeck/one-more-branch . You give the system a character concept, some worldbuilding details, the tone/genre, and it creates the first page of narrative, with 2-4 meaningful, distinct choices at the end. You click one, and the corresponding page gets generated. If you restart, you can navigate already explored branches without generating anything, but any new branches will be generated and stored. I have let the AI decide when branches end. Haven’t seen that yet.

There’s currently an issue: I store information about the characters involved, the canon facts about them, globally. And I found out that the information can bleed from branch to branch when I didn’t mean it; for example, in one branch a character gave the other a map or something to that effect, and it was registered globally, which would have contaminated new branches. Such issues are the kinds that you routinely fix while working on an app. It will involve distinguishing between global canon facts about characters and state changes involving characters.

Anyway, I present you some branches of a test narrative. You can click the choices that have been explored, and they will lead you to the appropriate header, like in one of those “Choose Your Own Adventure” books but automatically. Other branches haven’t been explored so they aren’t clickable.


Page 1

The Drowned Serpent tavern reeks of canal-water and desperation, which means the crowd is perfect. You are Vespera Nightwhisper—at least, that’s the name you’re wearing tonight—and you’ve been working this room for two hours, your hybrid lute-viol singing melodies that make dock workers weep into their ale while their coin purses grow lighter. Your whiskers twitch slightly as you modulate your voice into something breathy and inviting, finishing a ballad about star-crossed lovers. The amber-gold eye catches firelight while the ice-blue one tracks the room’s exits. Your tail sways in time with the final chord. The applause comes with the satisfying clink of copper and silver hitting your open instrument case. But it’s all… fine. Competent. Safe. The music isn’t reaching that place you need it to reach—that breakthrough you can taste but can’t fucking touch.

You’re prowling through the crowd afterward, ears decorated with silver charms catching the lamplight, when a hooded figure intercepts you near the bar. Beaver-folk, you note instantly—the broad flat tail is unmistakable beneath the cloak. His breathing is shallow, panicked. Prey behavior.

“You’re the bard, mmh?” His voice cracks. “The one who takes… contracts?”

Your whiskers perk forward with interest. He slides a leather pouch across the bar—it clinks heavily. Gold, not copper.

“My business partner, Greaves. He’s been… changed. Cursed item from a dredger haul. The Ash-Seal company says it’ll take two weeks to dispatch someone, but he’s—” The beaver-folk’s voice drops to a whisper. “—he’s killing people at night. Doesn’t remember it come morning. I need someone who can track him, stop him, and keep it quiet before the constables get involved.” His eyes are desperate, searching your face. “They say you don’t flinch.”

You can already hear it—the chord progression that would capture this moment. Minor key, building tension, the way his breath hitches like a string about to snap. Part of you is cataloging his tells: the way he won’t meet your heterochromatic gaze, how his fingers drum against the bar—guilt rhythm, not just fear. He knows something he’s not saying. The other part of you feels that familiar clarity starting to crystallize. Danger. Blood. The prospect of something that matters. Your hand rests casually on your theatrical rapier’s pommel.

What do you do?


Page 2

The beaver-folk’s whiskers flatten against his muzzle. “You want to see it? The thing that’s turning my partner into—” He cuts himself off, glances around the tavern. Too many ears. “Not here. Come.”

You follow him out into Brinewick’s fog-thick night, your tail swishing with anticipation. The canals reflect lamplight in fractured gold as he leads you through three twisting streets to a cramped warehouse office that smells of timber and wet fur. He bolts the door behind you.

From a locked chest beneath his desk, he produces a wooden box wrapped in chains. Your whiskers twitch involuntarily—even through the wood and iron, you can feel something wrong radiating from it. Not sound, exactly. More like the absence of sound, a void where music should be.

“Greaves pulled this from a canal dredge two weeks ago,” the beaver-folk says, his paws shaking as he sets it on the desk. “Thought it was just an old mirror. Looked into it once. Just once. Now every night when the moon rises, he… changes. Becomes something else. Hunts.”

He unwraps the chains with the care of someone handling a venomous snake. Inside the box: a hand mirror, its silver surface tarnished black except for veins of sickly green that pulse with their own light. Your heterochromatic eyes widen—the amber one burns, the blue one goes cold. The reflection it shows isn’t the room. It’s something moving. Writhing.

Your fingers hover over your lute-viol’s case. Part of your brain is already cataloging this—the way the green light pulses in 6/8 time, the subsonic hum that makes your teeth ache. But another part, the part that stays sharp when blood starts flowing, is calculating. This isn’t just a curse. This is a weapon. And the beaver-folk’s breathing has changed—faster now, excited beneath the fear.

“The music of the curse,” you murmur, and your voice has gone flat, dangerous. The cute affect has vanished entirely. “Interesting phrase for someone who just needs his partner stopped, mmh?”

The beaver-folk’s tail twitches. “I don’t—”

“You’re lying.” Your whiskers are arrow-straight, reading every microexpression. “Your breathing shifted when you opened that box. Not fear. Anticipation. So let’s try this again, and this time don’t waste my fucking time: what do you actually want?”

What do you do?


Page 3

The beaver-folk’s pupils dilate. His breathing shifts—shallow now, caught. You watch his paws clench and unclench against the desk edge, claws scraping wood. He’s calculating whether to lie, and you can see the exact moment he realizes you’ll know.

“Smart cat,” he mutters, and his voice drops the desperate merchant routine entirely. What’s left is sharper. Hungrier. “Fine. Yes. Greaves needs to be stopped—that part’s true. But the mirror…” His eyes flick to the pulsing green light, and there’s reverence there. Want. “Do you know what Ash-Seal pays for functional cursed items? Not the broken ones they have to dispose of. The ones that still work.”

Your tail goes still. “You want to sell it.”

“I want to profit from two weeks of my business partner trying to eat dock workers, yes.” He leans forward, and now you can smell it—not just fear, but excitement, the musk of someone who’s found an angle. “But here’s the problem. Ash-Seal won’t pay premium unless they can verify it’s functional and contained. Which means I need someone who can demonstrate control. Someone who can look into it, trigger the transformation, and prove they can handle what comes after.”

The mirror pulses. Six beats. Rest. Six beats. Your mind is already turning it into a waltz in a minor key, something that would sound beautiful if it weren’t so wrong.

“You want me to become the monster,” you say, and your voice is flat as a blade. “To prove it works.”

“I want you to show you can survive it.” His whiskers twitch—he’s lying about something, but not about the core truth. “You’re a bard who fights. You’ve got discipline, control. If anyone can look into that thing and come back unchanged—or at least, come back in control—it’s someone like you. Do that, help me negotiate with Ash-Seal, and I’ll split the sale. Sixty-forty.”

Your amber eye burns. Your blue eye stays ice-cold. Part of you—the part that chases the crystalline clarity that comes after violence—is already wondering what kind of music would pour out of you if you let that curse in. What you could compose if you survived it. The rest of you knows this is the kind of choice that draws a line you can’t uncross.

The beaver-folk mistakes your silence for negotiation. “Seventy-thirty. Final offer. And I’ll throw in information about where Greaves hunts tonight. You can stop him, play hero for the constables, build your reputation. Then we do the demonstration for Ash-Seal tomorrow. Everyone wins.”

Your fingers drift to your rapier’s pommel. The mirror keeps pulsing. Six beats. Rest. Six beats. Like a heartbeat. Like a song you haven’t written yet.


Page 4

You lean in close enough that your whiskers nearly brush his cheek, letting your tail curl around his wrist where it rests on the bar. The beaver-folk goes rigid—prey instinct warring with something else. Good.

“Mmh, they say a lot of things about me,” you purr, tracing one claw along the edge of the coin pouch without opening it. “But ‘cheap’ isn’t one of them, sweetness.” Your heterochromatic eyes lock onto his—amber-gold and ice-blue pinning him in place. You can read him like sheet music: the way his breath catches, pupils dilating despite the fear-scent rolling off him. Desperate, yes. But there’s something else underneath. Anticipation?

“Triple,” you say, voice dropping into that register that makes people forget how to negotiate. “Your partner’s killing people, you need discretion, and you need someone who won’t run screaming when things get messy.” You let your fingers walk up his forearm. “That’s specialty work, darling. Premium rates.”

He swallows hard. “I—I don’t have that kind of—”

“Mrow, don’t lie to me.” Your whiskers flatten slightly, just enough to shift from seductive to dangerous. “You’re not coming to a tavern bard with a cursed-item problem because you’re poor. You’re coming because you need this handled quietly, and quiet costs.” You tilt your head, studying the micro-expressions dancing across his face. “So either you pay what I’m worth, or I walk, and you explain to the constables why you waited two weeks while bodies piled up.”

The beaver-folk’s breathing changes—faster, shallower. But he’s not breaking. He’s… calculating. Your ears swivel forward.

“Seventy-thirty,” he says suddenly.

“What?”

“The mirror—the cursed item. It’s functional. Controllable, in a sense.” His voice gains confidence, which sets your whiskers twitching. “Ash-Seal pays premium for items they can study and demonstrate. We contain it, prove what it does, I sell it to them. Seventy-thirty split. You get thirty percent.”

Your mind catalogs this instantly: He’s not trying to destroy the curse. He’s trying to profit from it. And he needs you to—what? Demonstrate it? Contain Greaves while he still transforms? The chord progression in your head shifts to something darker, more complex.

“You want me to help you sell the thing that’s turning your partner into a killer.” You don’t phrase it as a question. “While he’s still useful as proof of concept.”

The beaver-folk meets your eyes. “Greaves doesn’t remember anyway. And the money would set us both up for years. I know where he hunts. I know the pattern. We just need… documentation. Containment. Someone who can handle the dangerous part.”

Your tail lashes once. The dangerous part. The part where you’d be close to something curse-twisted and violent, where blood would likely spill, where that crystalline clarity might finally arrive and the music you’ve been chasing would bloom perfect and terrible in your skull.

Your whiskers are already trembling with something that isn’t quite fear.

What do you do?


Page 5

You pull back like he’s venomous, tail snapping away from his wrist. The predatory warmth drains from your expression, leaving something colder, clearer. “No.”

The beaver-folk blinks. “What?”

“No.” You stand, smoothing your tail fur with one hand—the nervous gesture betraying what your voice doesn’t. “I’ve crossed lines, sweetness. Plenty of them. But this?” Your whiskers flatten completely. “You’re not trying to stop your partner. You’re trying to profit off him. Off the people he’s killed.” The words taste wrong in your mouth, and that wrongness is what decides it. “That’s too fucking twisted even for me.”

You can see the calculation die in his eyes, replaced by panic. “Wait—you can’t—”

“Watch me.” You’re already moving, slinging your lute case over your shoulder. The rapier’s weight at your hip feels necessary, grounding. Your mind is racing, converting the situation into rhythm—6/8 time, the mirror’s pulse, the pattern of a trap you almost walked into. The melody forming is discordant, unfinished, and it makes your chest tight.

The night air hits you as you push through the tavern door. Brinewick’s canal-smell wraps around you—brine and rot and fish. The constabulary station is three blocks west, near the merchant district. You know because you’ve made a point of knowing where law enforcement operates in every city you work.

Your ears swivel back. The beaver-folk hasn’t followed. Smart. But now you’re walking toward the constables with a story about cursed mirrors and nighttime killings, and you’re a traveling bard with a reputation for not flinching at violence. They might listen. They might arrest you for wasting their time. They might already know about the bodies and wonder why you know details.

Your whiskers twitch. The smart play would’ve been taking the contract, documenting everything, then selling both the mirror and the evidence. Control the narrative. Instead you’re about to hand your leverage to people who don’t owe you anything.

But the alternative was becoming part of something that made your skin crawl, and apparently you still have limits. Who knew?

The constabulary station’s lamplight glows ahead. You can see two constables outside—a tall human woman and a tortoise-folk man, both armed. This is the moment. Once you walk up those steps and start talking, you’re committed. No take-backs, no negotiations, no performance that lets you slip away clean.

Unless you don’t. Unless you find Greaves yourself first, before the beaver-folk can move the mirror or disappear. Unless you handle this your way—not for profit, but because someone should, and the constables are slow and the bodies are real.


Page 6

You slide onto the bar stool beside him, close enough that your tail brushes his leg—calculated intimacy, the kind that makes people spill secrets. “I’m listening, mrow,” you purr, letting your voice do that thing where it sounds like an invitation and a threat at the same time. Your whiskers angle forward, reading the micro-tensions in his posture. “But I need details. When did this start? What does he become? Where does he hunt?” Your clawed finger taps the bar in rhythm—already your mind is converting his panic into tempo.

The beaver-folk glances around nervously before leaning closer. His breath smells like fear and wood shavings. “Two weeks ago. Greaves bought a dredger haul—mostly junk, rusted tools, broken pottery. But there was a mirror.” His voice drops further. “Ornate thing, silver frame with strange engravings. He looked into it once, just once, and that night…” He swallows hard. “He came back covered in blood. Didn’t remember leaving the warehouse. Said he’d slept through the night.”

“And the pattern?” you press, your ice-blue eye fixed on his face while your amber one tracks the tavern’s crowd. Your tail coils around the stool leg—anchoring yourself while your mind races ahead to chord structures, to the way terror sounds when you pluck it just right.

“Every night since. Always between midnight and dawn. He goes to the canal district—the old warehouse rows near Southwick Bridge. Three bodies so far that I know of.” The beaver-folk’s paws tremble as he slides a folded paper across to you. “This is where we store the timber. The mirror’s there, locked in my office. I… I haven’t destroyed it because—” He hesitates, and something flickers across his face. Not just fear. Anticipation? “—because Ash-Seal pays premium prices for functional cursed items. If you can prove it works, prove it can be controlled or contained, we split the sale. Seventy-thirty, your favor.”

There it is. The real melody beneath the desperate harmony. He wants to profit from this. Your whiskers twitch—not quite a lie, but not quite honest either. “Show me the mirror first,” you say, your voice dropping the sultry performance into something flat and surgical. “Then tell me everything about how Greaves hunts. Does he track by scent? By sound? Does he remember his victims come morning, or is it complete blackout?” Your claws drum against the bar—six-eight time, you note distantly. Everything is music if you listen right.

The beaver-folk nods rapidly. “Complete blackout. He wakes up in his bed, no memory of leaving. But there’s always blood under his claws, dirt on his feet. And the mirror—” His voice catches. “—it glows. Sickly green light, pulsing like a heartbeat when the sun goes down.”

Your breath catches. Not from fear—from recognition. That’s the rhythm you’ve been chasing. The one that arrives right after violence, right after the kill, when everything becomes crystalline and clear. You can already hear it: the pulse of cursed light translating into bass notes, the transformation into a crescendo, the hunt into a bridge that builds and builds until—

You realize you’ve been silent too long. The beaver-folk is staring at you, uncertainty creeping into his expression. Your whiskers flatten slightly as you force yourself back into the moment. “The warehouse,” you say simply. “Take me there. I want to see this mirror before I commit to anything.”

What do you do?


Page 7

You lean back slightly, letting your heterochromatic gaze bore into him—amber and ice reading every microexpression. Your whiskers flatten just enough to signal you’re not buying the full story. “Seventy-thirty sounds lovely, mrow,” you say, voice silk over razors, “but I don’t commit to hunting cursed problems without seeing what I’m actually dealing with.” Your tail uncurls from the stool, tip flicking in that particular pattern that means you’re calculating angles. “Tonight. I watch the transformation from a safe distance. See what your partner becomes, how the curse actually works, whether this is a containment job or a mercy killing.”

The beaver-folk’s whiskers twitch—there, that tells you he was hoping you’d just take his word for it. “That’s… reasonable,” he admits slowly. “But if Greaves catches your scent while he’s changed, I don’t know what he’ll do. The transformation makes him… wrong. Predator-wrong. His eyes go black, his teeth sharpen, and he moves like something that learned to hunt before it learned to think.”

“I can handle myself,” you say flatly, though your mind is already composing—6/8 rhythm, that green pulse he mentioned, the way terror sounds different when the monster used to be someone you knew. “Where exactly should I position myself? Rooftop? Alley? I need sightlines and escape routes.”

He pulls out a second scrap of paper, sketching quick lines with a charcoal nub. “The warehouse district near Southwick Bridge. There’s a three-story grain storage building with a flat roof—here.” He marks an X. “You’ll see the timber yard from there, and the route Greaves takes toward the old canals. He leaves around midnight, returns just before dawn.” His paw hesitates over the sketch. “The mirror stays in my office. It glows when the curse activates—sickly green light, pulses like a heartbeat. You’ll know when it starts.”

Your ears swivel forward. That rhythm again. Your fingers itch for your lute’s strings. “And you’ll be where during all this?”

“Safe in my quarters, door barred, pretending I don’t hear him leave.” The beaver-folk’s voice cracks slightly. “Same as every night for two weeks.”

You study him a moment longer—the way his shoulders hunch, the slight tremor in his webbed fingers, the calculating gleam buried under the fear. He’s not just desperate. He’s invested. This curse is worth money to him, and you’re the instrument he’s hoping will make it profitable. Fine. You can work with that. You’ve been worse things than someone’s profitable tool.

“Midnight, then,” you say, sliding off the stool with feline grace. “I’ll be on that roof. And beaver?” You lean close enough that your whiskers nearly brush his cheek. “If you’re lying about any detail that gets me killed, I’ll haunt you so thoroughly you’ll beg for whatever Greaves does to his victims. Understood, mrow?”

He nods quickly, and you catch the genuine fear there—good. You take the sketched map and the warehouse address, tucking both into your hidden pockets. The night air outside will be cold, and you have hours to kill before midnight. Your lute case feels heavy on your shoulder, and part of you wants to find a quiet corner to play, to chase that 6/8 rhythm that’s been circling your mind since he mentioned the mirror’s pulse. But another part—the part that keeps you breathing in dangerous cities—knows you should prepare. Scout the location in daylight. Check your medical kit. Maybe sharpen your rapier. Or you could visit the constabulary, see what they know about the bodies. Information is leverage, and leverage is survival.

The Drowned Serpent’s door swings shut behind you as you step into Brinewick’s lamp-lit streets, the canal-smell thick in the air, your mind already three moves ahead.

LudoForge #4

Now that the evolutionary process to grow game definitions is progressing at a steady pace in my app, named LudoForge, I fed the architectural docs to ChatGPT so that it would write a good explanation on how it works. It may be interesting to those curious about how complex systems can grow organically through an evolutionary algorithm that mimics biological evolution.


Teaching a computer to invent tabletop games (and occasionally rediscover the classics)

If you squint, evolving game designs is a lot like evolving creatures: you start with a messy ecosystem of “mostly viable” little organisms, you test which ones can survive in their environment, you keep the best survivors—but you also keep a diverse set of survivors so the whole population doesn’t collapse into one boring species.

In our system, the “organisms” are game definitions written in a small, strict game DSL (a structured way to describe rules: players, state variables, actions, effects, win/lose conditions, turn order, and so on). Each candidate game definition is wrapped in a genome: basically an ID plus the full definition.

From there, the evolutionary loop repeats: seed → simulate → score → place into niches → mutate elites → repeat.

1) Seeding: where the first games come from

Evolution needs a starting population. We can generate seeds automatically, or import them from disk, or mix both approaches. The important bit isn’t “are the seeds good?”—it’s “are they valid and diverse enough to start exploring?”

So seeds must pass two kinds of checks before they’re even allowed into the ecosystem:

  • Schema validation: does the JSON structure match the DSL’s required shape?
  • Semantic validation: does it make sense as a playable ruleset (no broken references, impossible requirements, etc.)?

And there’s a third, subtle filter: when we place games into “niches” (more on that below), seeds that land only in junk bins like unknown/under/over are rejected during seed generation, because they don’t help us cover the design space.

Think of this as: we don’t just want “a bunch of seeds,” we want seeds scattered across different climates so evolution has many directions to run in.

2) Playtesting at machine speed: simulation as the “environment”

A human can’t playtest 10,000 games a day. A simulation engine can.

For every candidate game, we run automated playthroughs using AI agents (simple ones like random and greedy are enough to expose lots of structural problems). The engine repeatedly:

  1. Lists the legal moves available right now
  2. Checks termination (win/lose/draw conditions, cutoffs, loop detection)
  3. Lets an agent pick an action (with concrete targets if needed)
  4. Applies costs and effects, recording what happened
  5. Advances the turn/phase according to the game’s turn scheduler

Crucially: when a complex game definition tries to do something illegal (like decrementing below a minimum, or targeting something that doesn’t exist), the engine records skipped effects/triggers instead of crashing, so the system can observe “this design is broken in these ways” rather than just failing outright.

This is the equivalent of an organism interacting with the world and leaving tracks: “it tried to fly, but its wings didn’t work.”

3) Turning playthroughs into numbers: metrics, degeneracy, and fitness

After simulation, we compute a set of analytics that act like proxies for design quality—things like:

  • Agency: did players have meaningful choices, or were they railroaded?
  • Strategic depth (proxy): how large is the typical decision space?
  • Variety: do many different actions get used, or does one dominate?
  • Interaction rate: are players affecting each other or only themselves?
  • Structural complexity: is this a tiny toy, or something richer?

These are not “fun detectors.” They’re sensors.

Then we run degeneracy detection: filters that catch the classic failure modes of randomly-generated rulesets:

  • infinite loops / repeated states
  • non-terminating games (hits max turns/steps)
  • games with no real choices
  • trivial wins, dominant actions, excessive skipped effects, etc.

Some degeneracy flags cause an outright reject (hard gate), others apply a penalty (soft pressure), and too many penalties at once can also trigger rejection.

Finally, all of this becomes a feature vector, and we compute an overall fitness score—the number evolution tries to increase.

4) “Growing in niches”: why we don’t keep only the top 1%

If you only keep the single highest-scoring game each generation, you get premature convergence: the population collapses into one design family and stops surprising you.

Instead, we use MAP-Elites, which you can picture as a big grid of “design neighborhoods.” Each neighborhood is defined by a few chosen descriptors (think: agency bucket, variety bucket, etc.). Each candidate game gets “binned” into a niche based on its descriptor values, and then it competes only with others in that same niche.

  • Each niche keeps its best resident (the “elite”).
  • Over time, the map fills with many different elites: fast games, slow games, chaotic games, skillful games, high-interaction games, and so on.

This is how you get a museum of interesting survivors, not one monoculture.

5) Reproduction: mutation (and why mutation is structured, not random noise)

Once we have elites across niches, we generate the next generation by mutating them.

Mutation operators aren’t “flip random bits.” They are rule-aware edits that make plausible changes to game structure, such as:

  • tweak a number (thresholds, magnitudes)
  • add/remove/duplicate actions (with safety guards so you can’t delete the last action)
  • add/remove variables (while rewriting dangling references)
  • change turn schedulers (round-robin ↔ simultaneous ↔ priority-based, etc.)
  • add triggers and conditional effects
  • modify termination rules (win/lose/draw conditions)

The key is: the operator library is rich enough to explore mechanics, not just parameters.

Mutation retries (because many mutations are duds)

Some mutations do nothing (“no-op”), or produce something that can’t be repaired. The runner will retry with a different operator a few times; if it still can’t produce a productive mutation, it falls back to keeping the parent for that offspring slot.

This keeps evolution moving without pretending every random change is meaningful.

6) Repair, rejection reasons, and staying honest about failure

After mutation, we may run repair (optional), then validation and safety gates. If a candidate fails, it’s not just dropped silently—the system classifies why it failed:

  • repair failure
  • validation failure
  • safety failure
  • evaluation error
  • evaluation returned null fitness/descriptors

And it persists these outcomes for observability and debugging.

This matters because “evolution” is only useful if you can tell whether the ecosystem is healthy—or if you’ve started breeding nonsense.

7) Adaptive evolution: learning which mutations are actually useful

Not all mutation operators are created equal. Some will be reliably productive; others will mostly create broken genomes.

So the runner tracks per-operator telemetry every generation: attempts, no-ops, repair failures, rejection counts, and how often an operator actually helped fill a new niche or improve an elite. evolution-runner

Those stats feed into adaptive operator weighting, so the system gradually shifts its mutation choices toward what’s working in the current region of the design space—without hardcoding that “operator X is always good.”

8) Optional superpower: motif mining (stealing good patterns from winners)

Sometimes an evolved game contains a little “mechanical phrase” that’s doing real work—like a neat resource exchange loop, or a repeating pattern of effects that creates tension.

When motif mining is enabled, we:

  1. select elites (top per niche + global best)
  2. re-simulate them to extract trajectories
  3. mine repeated effect sequences (“motifs”)
  4. convert those motifs back into DSL effects
  5. feed them into a special mutation operator that can inject those motifs into new games

That’s evolution discovering a useful mechanic, then turning it into reusable genetic material.

9) Human taste enters the loop (without turning it into manual curation)

Metrics are helpful, but “fun” is subjective. So we can add human feedback:

  • ratings (“how good is this?”)
  • pairwise comparisons (“A or B?”)

Rather than asking the human to judge random games, the system uses active learning to choose the most informative comparisons—especially cases where its preference model is uncertain, and it tries to include underrepresented niches so taste is learned across the map.

Under the hood, the preference model is an ensemble trained online (so it can update continuously) and its uncertainty controls how much feedback to request per generation (adaptive budget).

Fitness can then blend:

  • “objective-ish” signals (metrics/degeneracy)
  • “human preference” signals

So the system doesn’t just breed games that are non-broken—it breeds games that align with what you actually enjoy.

10) Why this can rediscover known games and invent new ones

If your DSL is expressive enough to describe the rules of an existing game, then in principle there exists a genome that encodes it. Evolution doesn’t need to “know” the game—it only needs:

  1. Search operators that can reach that region of the rulespace (structural mutations, not just numeric tweaks)
  2. Selection pressure that rewards the behaviors that make that game work (choice, balance, interaction, clean termination, etc.)
  3. Diversity preservation so the system keeps exploring many styles instead of collapsing early

Once those are in place, rediscovery becomes a side-effect of searching a huge space under the right constraints. And invention is what happens when evolution stumbles into combinations nobody tried on purpose—then keeps them because the ecosystem rewards them.

The simplest mental model

If you want the non-technical version in one breath:

We generate lots of small rulesets, machine-play them thousands of times, score them for “does this behave like a real game?”, sort the survivors into many different “design neighborhoods,” keep the best in each neighborhood, then make mutated children from those survivors—occasionally learning from human taste and reusing discovered mechanics—until the map fills with strong and varied games.

That’s the evolutionary process: not magic, not random, but a relentless loop of variation + playtesting + selection + diversity.

LudoForge #3

If you don’t know about LudoForge, you should probably read the previous posts. In summary: I’m developing an app to evolve tabletop game prototypes according to a “fun” factor made up of plenty of fun proxies like player agency, strategic depth, etc. The code is now mature enough to run X evolutionary generations on demand, produce shortlists of the best games, and finish. That’s great because it means the code works well, although there’s always room for improvement. But the shortlist of four winners is absolutely terrible in a way that has had me giggling for a while. I’ll let ChatGPT explain these “games.”


Game 1: “The Shared Counter Chicken”

Two players take turns. There’s a shared number on the table that starts at 0 and can be increased up to 15. The “win condition” is simple: whoever makes it hit 15 wins instantly.

The game also includes a couple of other buttons that change other numbers… but those numbers can never actually produce a win. They’re basically decorative dials. One of them always gets set to 12, but the victory threshold for it is 20, so it’s like having a “Launch Rocket” button that always fuels you to 60% and then stops forever.

So what do players really do? They increment the shared counter… and then start playing a tiny psychological game of chicken: “I could push the counter closer to 15… but then you might get the final move.” So the game hands them some useless actions that function as “stalling.” If both players are stubborn, they can just keep stalling until the match times out.

It’s not strategy so much as who blinks first.

Game 2: “The Game Where You Can’t Move”

This one is my favorite kind of failure because it’s so clean.

The game defines two counters. The only action in the entire game says: “Decrease both counters.”

But the action is only allowed if both counters are greater than zero.

And the game starts with both counters at zero.

So on turn one, a player looks at the rules and… there is literally nothing they’re allowed to do. No move exists. The game doesn’t even fail dramatically. It just sits there like a vending machine with the power unplugged.

In other words: it’s a tabletop game prototype that begins in a stalemate.

Game 3: “First Player Loses: The Speedrun”

This one actually runs, which makes it even funnier.

There are two counters. One counter is the only one that can possibly lead to a win — the other one only goes downward forever, so its “win condition” is a permanent lie.

The “real” counter starts at 0, and there’s an action that increases it by 2. The victory threshold is 4.

Here’s what happens:

  • Player 1 goes first. Their only sensible move is: 0 → 2.
  • Player 2 goes next and does the same move: 2 → 4.
  • Player 2 instantly wins.

So the entire “game” is basically:

“Player 1 sets up the win for Player 2.”

It’s like a sport where the first player is forced to place the ball on the penalty spot and then politely step aside.

Game 4: “The Unwinnable Ritual”

Three players this time. There’s one shared counter. Winning requires the counter to reach 4.

But the rules only let you do two things:

  • Set it to 2.
  • Decrease it by 2 (if it’s above zero).

Notice what’s missing: any way to make it bigger than 2.

So the win condition is a castle in the sky. The game is a ritual where players take turns setting the number to 2, or knocking it back down toward 0. It can never, ever reach 4. No amount of cleverness changes that.

It’s essentially a machine that cycles between “2” and “less than 2” until you get bored or the turn limit ends it.


ChatGPT finished its report with this note: “The first evolutionary run didn’t produce brilliant board games. It produced life, in the same way early evolution produced algae and sea foam. These were rule-sets that technically existed… but didn’t yet deserve to.”

These idiotic games already provided fun by existing, so as far as I care, this app has already been a success. The good thing is that I have code to handle degeneracy, fitness, etc., so I simply have to tighten that code so some of these nonsensical points would either kill a genome or penalize its fitness.

By the way, earlier tonight I was playing tennis in VR with people across Europe while I waited for Claude Code to work through the tickets of one of the app’s new features. And yet the world is terrible. We live in the lamest cyberpunk dystopia imaginable.

LudoForge #1

Two nights ago I was rolling around in bed trying to sleep when a notion came into my head, one that has returned from time to time: some of the most flow-like fun I’ve ever had was playing tabletop games. I’m a systems builder by nature, and I love to solve problems with a variety of tools. Tabletop games are complex problems to solve with specific series of tools. My favorite tabletop game is Arkham Horror LCG, although I’ve loved many more like Terraforming Mars, Ark Nova, Baseball Highlights: 2045, Core Worlds, Imperium, Labyrinth, Renegade… But none of them fully captured me. Like some potential game exists that has exactly every feature my brain yearns for, but that game doesn’t exist. I’ve cyclically thought that I should create that game, but I never know where to start. I don’t even know what exactly I want, other than knowing that what I’ve experienced isn’t enough.

These past few weeks I’ve been implementing extremely-complex analytics reports generators for my repository Living Narrative Engine. I was surprised to find out that it’s feasible to mathematically find gaps in extremely complex spaces (dozens of dimensions) as long as they’re mathematically defined. I guess Alicia was justified to be obsessed with math. So I started wondering: what makes a tabletop game good? Surely, the fun you have with it. Can “fun” be mathematically defined? Is it the agency you have? The strategic depth? The variety? If any of such metrics could be mathematically defined, then “fun” is a fitness score that combines them.

And what if you didn’t need to design the game yourself? If you can map a simulated game’s activity to metrics such as the agency per player, the strategic depth, the variety… Then you can evolve a population of game definitions in a way that, generation after generation, the “fun” score improves. If you can turn all game mechanics into primitives, the primitives will mutate in and prove their worth throughout the generations, composing coherent mechanics or even inventing new ones. Initially, a human may need to score game definition variants according to how “fun” the playthrough of those games were, but in the end that could be automated as well.

Because this is the era of Claude Code and Codex, I’ve already implemented the first version of the app. I’ve fed ChatGPT the architectural docs and told it to write a report. You can read it down below.


LudoForge: evolving tabletop games with a deterministic “taste loop”

I’m building LudoForge, a system that tries to answer a pretty blunt question:

What if we treated tabletop game design like search—simulate thousands of candidates, kill the broken ones fast, and let a human “taste model” steer evolution toward what’s actually fun?

Under the hood, it’s a seeded-population evolution loop: you start with a set of game definitions (genomes), run simulations, extract metrics, filter degeneracy, blend in learned human preferences, and then evolve the population using MAP-Elites and genetic operators. Then you repeat.

The big picture: the loop

LudoForge is structured as a pipeline with clean seams so each layer can be tested and swapped without turning the whole thing into spaghetti. The stages look like this: seed → evaluate → simulate → analytics → (optional) human feedback → fitness → MAP-Elites → (optional) mutate/crossover/repair → next generation. pipeline-overview

A key design choice: the core expects a seeded population. There’s no “magic generator” hidden inside that invents games from scratch. If you want a generator, you build it outside and feed it in. That keeps the engine honest and debuggable. Note by me after rereading this part of the report: this will change soon enough.

Games as genomes: a DSL that can be validated and repaired

Each candidate game is a genome: { id, definition }, where definition is a DSL game definition. Before any evaluation happens, the definition goes through schema + semantic validation—and optionally a repair pass if you enable repair operators. Invalid DSL gets rejected before it can contaminate simulation or preference learning.

Repair is deliberately conservative: it’s mostly “DSL safety” (e.g., clamp invalid variable initial values to bounds). Anything that’s “this game is technically valid but dumb/unplayable” is handled by simulation + degeneracy detection, not by sweeping edits that hide the real problem.

The simulation engine: deterministic playthroughs with real termination reasons

The simulation layer runs a single playthrough via runSimulation(config) (or wrapped via createSimulationEngine). It builds initial state from the definition, picks the active agent, lists legal actions, applies costs/effects/triggers, advances turns/phases, and records a trajectory of step snapshots and events.

It’s also built to fail safely:

  • No legal actions → terminates as a draw with terminationReason = "stalemate".
  • Max turns exceededterminationReason = "max-turns" with an outcome computed in that cutoff mode.
  • Loop detection (optional hashing + repetition threshold) → terminationReason = "loop-detected".

Most importantly: runs are reproducible. The RNG is a seeded 32-bit LCG, so identical seeds give identical behavior.

Metrics: cheap proxies first, expensive rollouts only when you ask

After simulation, LudoForge summarizes trajectories into analytics: step/turn counts, action frequencies, unique state counts, termination reasons, and sampled “key steps” that include legalActionCount.

From there it computes core metrics like:

  • Agency (fraction of steps with >1 legal action)
  • Strategic depth (average legal actions per step)
  • Variety (action entropy proxy)
  • Pacing tension (steps per turn)
  • Interaction rate (turn-taking proxy)

Extended metrics exist too, and some are intentionally opt-in because they’re expensive:

  • Meaningful choice spread via per-action rollouts at sampled decision points
  • Comeback potential via correlation between early advantage and final outcome

Here’s the honest stance: these metrics are not “fun”. They’re proxies. They become powerful when you combine them with learned human preference.

Degeneracy detection: kill the boring and the broken early

This is one of the parts I’m most stubborn about. Evolution will happily optimize garbage if you let it.

So LudoForge explicitly detects degeneracy patterns like:

  • loops / non-termination
  • stalemates
  • forced-move and no-choice games
  • dominant-action spam
  • trivial wins metrics-and-fitness

By default, those flags can reject candidates outright, and degeneracy flags also become part of the feature vector so the system can learn to avoid them even when they slip through.

Human feedback: turning taste into a model

Metrics get you a feature vector. Humans supply the missing ingredient: taste.

LudoForge supports two feedback modes:

  1. Ratings (1–5) with optional tags and rationale
  2. Pairwise comparisons (A/B/Tie) with optional tags and rationale

Pairwise comparisons are the main signal: they’re cleaner than ratings and train a preference model using a logistic/Bradley–Terry style update. Ratings still matter, but they’re weighted lower by default.

There’s also active learning: it selects comparison pairs where the model is most uncertain (predicted preference closest to 0.5), while reserving slots to ensure underrepresented MAP-Elites niches get surfaced. That keeps your feedback from collapsing into “I only ever see one genre of game.”

Fitness: blending objective proxies, diversity pressure, and learned preference

Fitness isn’t a single magic number pulled from the void. It’s a blend:

  • Base composite score from metrics (weighted sum/objectives)
  • Diversity contribution (pressure toward exploring niches)
  • Preference contribution from the learned preference model (centered/capped, with bootstrap limits early on)

Feature vectors are keyed by metric id (not positional arrays), which matters a lot: adding a new metric doesn’t silently scramble your model weights. Renaming metrics, though, becomes a migration event (and that’s correct—you should feel that pain explicitly).

Evolution: MAP-Elites + mutation/crossover that respect DSL validity

Instead of selecting “top N” and converging into a monoculture, LudoForge uses MAP-Elites: it bins candidates into descriptor niches and keeps the best elite per niche.

Descriptor binning is explicit and deterministic (normalize → floor into bin count; clamp to range), and niche ids serialize coordinates like descriptorId:bin|....

Then you can evolve elites with genetic operators:

  • Mutations like numeric tweaks, boolean toggles, enum cycling, duplicating/removing actions, nudging effect magnitudes, adding/removing phases, rewriting token/zone references safely, etc.
  • Crossover via subtree swaps of state.variables or actions, followed by DSL re-validation.

Optional “shortlisting” exists too: it picks a diversified subset of elites for human review using a max-min distance heuristic over descriptor coordinates.

What’s already proven (and what isn’t yet)

This isn’t vaporware; the end-to-end tests already prove key behaviors like:

  • the ordered phases of the pipeline
  • invalid DSL rejection before evaluation
  • safety cutoffs (max-turns) and deterministic seeded outputs
  • human prompt loops and legality enforcement
  • deterministic state transitions
  • MAP-Elites producing stable ids
  • active learning selection behavior
  • mutation + repair at scale, including crossover

And there are explicitly documented gaps—like extended metrics aggregation and worker-thread batch simulations.

The point of LudoForge

I’m not trying to build a “game designer replacement.” I’m building a design pressure cooker:

  • Simulate hard
  • Reject degeneracy ruthlessly
  • Measure what you can
  • Ask humans the right questions
  • Let evolution explore breadth, not just a single hill

If you’re into procedural design, evolutionary search, or just enjoy the idea of treating “fun” as something you can iteratively approximate with a human-in-the-loop model, that’s what this project is for.

Living Narrative Engine #19

I have quite the treat for you fuckers. I’ve recorded myself playing through my test scenario involving Alicia Western. More than an hour of me speaking in my accented English even though I rarely speak in real life, and showing off a fun, frustrating playthrough that made me hungry.

This is, of course, related to my beloved Living Narrative Engine. Repo here.

Living Narrative Engine #18

I’m building a browser-based app to play immersive sims, RPGs and the likes. In practice, I use it to set up short story scenarios or elaborate gooning sessions. I dared myself to build the most comprehensive psychological system imaginable, so that Sibylle Brunne, a 34-year-old orphan living in her parents rustic home somewhere in the Swiss mountains, while controlled by a large language model, would realistically bring her blue-eyed, blonde-hair-braided, full-breasted self to seduce my teenage avatar who is backpacking through the country, eventually convincing me to stay in her house so she can asphyxiate me with her mommy milkers.

Here’s a visual glimpse of the current complexity:

Alicia has become my test subject, as if she didn’t have enough with freezing to death. The system works like this: at the base you have mood axes (like pleasant <-> unpleasant), which change throughout a scene. Actors also have permanent biological or personality-based traits like aversion to harm. Together, mood axes and affect traits serve as weights and gates to specific emotion prototypes like disappointment, suspicion, grief. Delta changes to those polar mood axes naturally intensify or lessen the emotions. I also have sexual state prototypes, which work the same as the emotional states.

These emotional and sexual states serve as the prerequisites for certain expressions to trigger during play. An expression is a definition that tells you “when disappointment is very high and suspicion is high, but despair is relatively low, trigger this narrative beat.” Then, the program would output some text like “{actor} seems suspicious but at the same time as if they had been let down.” The descriptions are far better than that, though. The actors themselves receive in their internal log a first-person version of the narrative beat, which serves as an internal emotional reaction they need to process.

It all works amazingly well. However, to determine if I was truly missing mood axes, affect traits or prototypes, I had to create extremely complex analytics tools. I’ve learned far too much about statistical analysis recently, and I don’t really care about it other than for telling a system, “hey, here are my prototype sets. Please figure out if we have genuine gaps to cover.” Turns out that to answer such a request, some complex calculations need to map 20-dimensional spaces and find out diagonal vectors that run through them.

Anyway, I guess at some point I’ll run my good ol’ test scenario involving Alicia, with her now showing far more emotion than she used to before I implemented this system. That’s a win in my book.

Living Narrative Engine #17

I’ve recently implemented an emotions and expressions system in my app, which is a browser-based platform to play immersive sims, RPGs, adventure games, and the likes. If you didn’t know about the emotions and expressions system, you should check out the linked previous post for reference.

I was setting up a private scenario to further test the processing of emotions for characters during changing situations. This was the initial state of one Marla Kern:

Those current emotions look perfectly fine for the average person. There’s just one problem: Marla Kern is a sociopath. So that “compassion: moderate” would have wrecked everything, and triggered expressions (which are narrative beats) that would have her acting with compassion.

This is clearly a structural issue, and I needed to solve it in the most robust, psychologically realistic way possible, that at the same time strengthened the current system. I engaged in some deep research with my pal ChatGPT, and we came up with (well, mostly he did):

We lacked a trait dimension that captured stable empathic capacity. The current 7 mood axes are all fast-moving state/appraisal variables that swing with events. Callousness vs empathic concern is a stable personality trait that should modulate specific emotions. That meant creating a new component, named affect_traits, that the actors would need to have (defaults would be applied otherwise), and would include the following properties:

  • Affective empathy: capacity to feel what others feel. Allows emotional resonance with others’ joy, pain, distress. (0=absent, 50=average, 100=hyper-empathic)
  • Cognitive empathy: ability to understand others’ perspectives intellectually. Can be high even when affective empathy is low. (0=none, 50=average, 100=exceptional)
  • Harm aversion: aversion to causing harm to others. Modulates guilt and inhibits cruelty. (0=enjoys harm, 50=normal aversion, 100=extreme aversion)

In addition, this issue revealed a basic problem with our represented mood axes, which are fast-moving moods: we lacked one for affiliation, whose definition is now “Social warmth and connectedness. Captures momentary interpersonal orientation. (-100=cold/detached/hostile, 0=neutral, +100=warm/connected/affiliative)”. We already had “engagement” as a mood axis, but that doesn’t necessarily encompass affiliation, so we had a genuine gap in our representation of realistic mood axes.

Emotions are cooked from prototypes. Given these changes, we now needed to update affected prototypes:

"compassion": {
  "weights": {
    "valence": 0.15,
    "engagement": 0.70,
    "threat": -0.35,
    "agency_control": 0.10,
    "affiliation": 0.40,
    "affective_empathy": 0.80
  },
  "gates": [
    "engagement >= 0.30",
    "valence >= -0.20",
    "valence <= 0.35",
    "threat <= 0.50",
    "affective_empathy >= 0.25"
  ]
}

"empathic_distress": {
  "weights": {
    "valence": -0.75,
    "arousal": 0.60,
    "engagement": 0.75,
    "agency_control": -0.60,
    "self_evaluation": -0.20,
    "future_expectancy": -0.20,
    "threat": 0.15,
    "affective_empathy": 0.90
  },
  "gates": [
    "engagement >= 0.35",
    "valence <= -0.20",
    "arousal >= 0.10",
    "agency_control <= 0.10",
    "affective_empathy >= 0.30"
  ]
}

"guilt": {
  "weights": {
    "self_evaluation": -0.6,
    "valence": -0.4,
    "agency_control": 0.2,
    "engagement": 0.2,
    "affective_empathy": 0.45,
    "harm_aversion": 0.55
  },
  "gates": [
    "self_evaluation <= -0.10",
    "valence <= -0.10",
    "affective_empathy >= 0.15"
  ]
}

That fixes everything emotions-wise. A character with low affective empathy won’t feel much in terms of compassion despite the engagement, will feel even less empathic distress, and won’t suffer as much guilt.

This will cause me to review the prerequisites of the currently 76 implemented expressions, which are as complex as the following summary for a “flat reminiscence” narrative beat:

“Flat reminiscence triggers when the character is low-energy and mildly disengaged, with a notably bleak sense of the future, and a “flat negative” tone like apathy/numbness/disappointment—but without the emotional bite of lonely yearning. It also refuses to trigger if stronger neighboring states would better explain the moment (nostalgia pulling warmly, grief hitting hard, despair bottoming out, panic/terror/alarm spiking, or anger/rage activating). Finally, it only fires when there’s a noticeable recent drop in engagement or future expectancy (or a clean crossing into disengagement), which prevents the beat from repeating every turn once the mood is already flat.”

That is all modeled mathematically, not by a large language model. In addition, I’ve created an extremely-robust analysis system using static analysis, Monte Carlo simulation, and witness state generation to determine how feasible any given set of prerequisites is. I’ll make a video about that in the future.

Living Narrative Engine #16

A couple of nights ago, at two in the morning, I was rolling around in bed thinking about my current obsessions: the browser-based app Living Narrative Engine as well as Alicia Western, the tragic character from Cormac McCarthy’s last two novels. Recently I mixed them both by playing through a scenario in LNE that featured Alicia. I “novelized” that little bit of theater in the short story You Will Spend the Rest of Your Life.

Well, I wasn’t entirely happy with Alicia’s acting. Yes, she’s an analytical gal, but she’s in a deep hole there. I wanted to feel the despair from her. The relief. I wanted to see her cry. I wanted to cause a beautiful, blonde woman at the end of her rope to cry. And she didn’t.

As I thought about whether this was a solvable issue, my dear subconscious had a spark of genius: LLM-based characters in LNE already create thoughts, speech, notes, and choose actions. Why not task them with tracking mood changes?

Some deep research and several iterations later, ChatGPT and I came up with the following notions, which are displayed below in a lovely manner, as they appear on the game page of LNE.

The simulation relies on seven base mood axes: valence, arousal, agency control, threat, engagement, future expectancy, and self-evaluation. Apparently that basic breakdown is psychologically sound, but I’m trusting ChatGPT on that. The sexual variables apparently are also well-known: an excitation component is the accelerator, and the inhibition is the brake. Added to a baseline libido dependent on the individual, that calculates the arousal. As seen in the picture, Alicia right now is dry as sandpaper.

The most interesting part for me is that the mood axes and basic sexual variables are ingredients to form emotions and sexual “moods”. I have dozens of them defined, as I’ve been working with ChatGPT in order to depict the whole breadth of emotions that are distinct and meaningful. Here are the current listings of emotions and sexual “moods” that my app calculates:

  • Emotions: calm, contentment, relief, confidence, joy, euphoria, enthusiasm, amusement, awe, inspiration, aesthetic appreciation, interest, curiosity, fascination, flow, entrancement, hope, optimism, determination, anticipation, sadness, grief, disappointment, despair, numbness, fatigue, loneliness, nostalgia, boredom, apathy, unease, stress, anxiety, craving, thrill, fear, terror, dread, hypervigilance, courage, alarm, suspicion, irritation, frustration, anger, rage, resentment, contempt, disgust, cynicism, pride, triumph, shame, embarrassment, awkwardness, guilt, regret, humiliation, submission, envy, trusting surrender, jealousy, trust, admiration, adoration, gratitude, affection, love attachment, compassion, empathic distress, hatred, surprise startle, confusion
  • Sexual moods: sexual lust, passionate love, sexual sensual pleasure, sexual submissive pleasure, sexual playfulness, romantic yearning, sexual confidence, aroused but ashamed, aroused but threatened, sexual craving, erotic thrill, sexual performance anxiety, sexual frustration, afterglow, sexual disgust conflict, sexual indifference, sexual repulsion

Emotions are calculated based on detailed prototypes. Here’s one:

"anxiety": {
      "weights": {
        "threat": 0.8,
        "future_expectancy": -0.6,
        "agency_control": -0.6,
        "arousal": 0.4,
        "valence": -0.4
      },
      "gates": [
        "threat >= 0.20",
        "agency_control <= 0.20"
      ]
    }

Those emotions and sexual moods are fed to LLM-based actors. They figure out “hmm, I’m intensely disappointed, strongly cynical, strongly sad, etc., so that needs to color my thoughts, speech, notes, and the actions I take.” I haven’t tested the system much in practice, but the little I tested, the results were like night and day regarding the LLM’s roleplaying.

In real life, we not only do things, but our bodies do things to us. We are aware of how our emotional states change us, and those turn into “tells” to the other people present. In addition, when one thinks in terms of stories, you add “reaction beats” when the emotional state of an actor changes, so I did exactly that: if the LLM has returned changes to the previous mood axes and sexual variables, the library of expressions have a change to trigger (one at a time), based on whether some prerequisite triggers. The following example makes it self-explanatory:

{
    "$schema": "schema://living-narrative-engine/expression.schema.json",
    "id": "emotions:lingering_guilt",
    "description": "Moderate, non-spiking guilt—an apologetic, sheepish self-consciousness after a minor mistake",
    "priority": 57,
    "prerequisites": [
        {
            "logic": {
                "and": [
                    {
                        ">=": [
                            {
                                "var": "emotions.guilt"
                            },
                            0.35
                        ]
                    },
                    {
                        "<=": [
                            {
                                "var": "emotions.guilt"
                            },
                            0.70
                        ]
                    },
                    {
                        "<=": [
                            {
                                "-": [
                                    {
                                        "var": "emotions.guilt"
                                    },
                                    {
                                        "var": "previousEmotions.guilt"
                                    }
                                ]
                            },
                            0.12
                        ]
                    },
                    {
                        "<=": [
                            {
                                "var": "emotions.humiliation"
                            },
                            0.25
                        ]
                    },
                    {
                        "<=": [
                            {
                                "var": "emotions.terror"
                            },
                            0.20
                        ]
                    },
                    {
                        "<=": [
                            {
                                "var": "emotions.fear"
                            },
                            0.35
                        ]
                    }
                ]
            }
        }
    ],
    "actor_description": "It wasn't a catastrophe, but it still sits wrong. I replay the moment and feel that small, sour twist—like I owe someone a cleaner version of myself. I want to smooth it over without making a scene.",
    "description_text": "{actor} looks faintly apologetic—eyes dipping, a tight little wince crossing their face as if they're privately conceding a mistake.",
    "alternate_descriptions": {
        "auditory": "I catch a small, hesitant exhale—like a half-swallowed \"sorry.\""
    },
    "tags": [
        "guilt",
        "sheepish",
        "apology",
        "minor_mistake",
        "lingering"
    ]
}

I’ve created about 53 expressions already, but they’re surprisingly hard to trigger, as they require very specific (and psychologically logical) conditions.

Because testing this new system through playing scenarios would be a nightmare, I’ve created a dev page that makes testing the combinations trivial. In fact, I’ve recorded a video and uploaded to YouTube. So if you want to hear me struggle through my accent that never goes away, and the fact that I very, very rarely speak in real life, here’s ten minutes of it.

I think that’s all. Now I’m going to play through the same Alicia Western scenario as in the short story I posted. If the result is different enough, I will upload it as a short story.