
The Core Idea Affekt makes every NPC feel like a person who exists independently of the player. Each has its own temperament, a memory of what you did, and an emotional state that changes with events. Plain code decides what a character feels, remembers and knows (about 80%); a language model only phrases the final line (about 20%), so it can’t invent a price, an item or a relationship. How an Interaction Unfolds The engine reads your intent, tone and any price offered. It updates the NPC’s emotion across four dimensions (valence, initiative, stress, inertia), recalls three layers of memory and a world graph, then builds a small prompt with only the facts that matter, including the character’s place and your local time of day. A model on AMD Token Factory words the line: Gemma 4 first, MiMo (also on AMD) as backup, OpenRouter as last resort. A price guard fixes wrong prices, and if every model fails the NPC answers with a line for its mood, so the game never freezes. Why It Works Models alone drift: personalities wobble and prices change. Here code keeps character, facts and plot stable, prompts stay small, and a 30-line session costs under $0.003 (estimated). The engine accepts a local model; a small fine-tuned one on the player’s machine is the goal, planned but not trained yet. Example In Affekt Town, Marta sells a potion for 25 coins. Polite players get a friendly Marta; insult her and she turns hostile and remembers it. The price is 25 for both: the mood changes, the facts don’t. At 9 a.m. she says “Good morning” and the town is bright; at 11 p.m. she notes how late it is and the town goes dark. It plays with keyboard, mouse or touch.
18 Oct 2026