The Problem with Traditional NPCs
In most RPGs, NPCs are dialogue trees. You click through branching options, read pre-written responses, and eventually exhaust every line. The blacksmith says the same thing on day 1 as day 100. He doesn't care that you saved his village or stole from his shop. He has no memory, no opinion, and no social life.
Wanderfolk takes a different approach. As an AI NPC game, every villager is powered by AI with persistent memory, a reputation system, and a social gossip network. They don't follow scripts — they respond to who you are, what you've done, and what the village thinks of you.
Procedural Identity: 37 Roles, 6 Voices
Wanderfolk's NPCs aren't hand-written characters. They're procedurally generated when a village is created. The NPC generator assigns each villager a role (one of 37 — blacksmith, herbalist, warchief, scribe, fisher, enchanter, and more), a name appropriate to the village's culture, a personality assembled from trait combinations, a backstory generated from templates, and a voice type (one of 6 styles that affect how they speak — formal, gruff, warm, sly, timid, or commanding).
The result is that every village in every playthrough has a unique cast of characters. The meadow village might have a warm-voiced baker named Elara and a gruff blacksmith named Tormund. The desert settlement might have a sly merchant named Kadir and a commanding warchief named Zara. None of these characters exist in a database — they're generated fresh each time.
Persistent Memory via Vector Embeddings
When you talk to an NPC, the conversation is summarized and stored as a vector embedding in a PostgreSQL database with the pgvector extension. Each memory captures the content of what was said, the emotional sentiment, an importance score, and a timestamp.
When you talk to the same NPC again — whether it's 5 minutes later or 5 game-days later — the system retrieves the most relevant past memories via cosine similarity search. If you promised the blacksmith you'd bring him iron ore, that promise is embedded as a high-importance memory. The next time you visit his forge, the system retrieves it and injects it into the AI's context: "The player promised to deliver iron ore 3 days ago and hasn't returned."
This means NPCs don't just remember — they remember contextually. If you mention the harvest, the system retrieves memories related to farming and the harvest, not unrelated conversations about the dungeon you explored. The vector search ensures that the most relevant memories surface, even across dozens of interactions.
Reputation: -100 to +100
Every NPC tracks a reputation score for the player, ranging from -100 (enemy) to +100 (beloved). This score changes based on your conversations and actions. Compliment someone, help with their problems, or deliver on promises, and your reputation rises. Insult them, lie, break commitments, or harm their friends, and it drops.
Reputation has concrete gameplay effects:
- +80 to +100 (Beloved): 25% shop discount, gifts, special quests
- +50 to +79 (Friendly): 15% discount, job offers
- +20 to +49 (Warm): Helpful, shares information freely
- -20 to +19 (Neutral): Normal interactions
- -50 to -20 (Cool/Disliked): Higher prices, less helpful
- -80 to -50 (Hostile): 30% price markup, warns others about you
- -100 (Enemy): Refuses all interaction
The reputation score is fed directly to the AI alongside the NPC's personality and memories. An NPC at -60 reputation doesn't just charge you more — they're visibly hostile in conversation. They reference past grievances, refuse favors, and may actively work against you.
The Gossip Network
NPCs don't exist in isolation. They have social connections to other villagers based on proximity, role relationships (the barkeep knows the barmaid, the elder knows everyone), and cultural ties. When your reputation changes with one NPC, that change propagates through the gossip network at roughly 15% influence per cycle.
This means a single bad interaction can cascade. Insult the shopkeeper, and within a few game-days, the elder, the blacksmith, and the herbalist have all heard about it. Their opinion of you drops even though you never spoke to them directly. Negative reputation spreads approximately 30% faster than positive — bad news travels fast in a small village.
The gossip system creates a global reputation score that's the weighted average of all individual NPC reputations. Village leaders (elders, warchiefs) carry more weight in this calculation. If your global reputation drops below -90, the village banishes you — and banishment is game over.
Autonomous Simulation
Everything described above — memory, reputation, gossip — is reactive. It responds to your conversations and actions. But Wanderfolk has a second layer of AI that's proactive: the autonomous simulation.
Each game day, every village runs a simulation tick. The AI receives the village's current state — population, resources, NPC personalities, active relationships, pending commitments — and generates a batch of events, thoughts, actions, and mood shifts for the day. A blacksmith argues with a merchant over pricing. Two farmers bond over a shared harvest. An elder grows worried about declining supplies.
On top of this, NPCs make structured commitments to each other — resource deliveries, guard shifts, social visits, craft orders, ritual attendance. These promises are tracked with deadlines and resolved deterministically. Kept promises build trust (+3 to +5). Broken promises damage relationships (-5 to -8) and generate gossip that spreads through the social network.
The simulation creates enforceable accountability between NPCs. A warrior who skips guard duty loses trust with the captain. A blacksmith who consistently delivers on time becomes a respected figure. NPCs under commitment pressure visibly change their behavior — prioritizing obligations over leisure as deadlines approach.
All of this feeds into the gossip network and world memory. When you return to a village after time away, the social landscape may have shifted. New alliances formed, old friendships cooled, promises kept or broken. You can learn what happened through conversation — NPCs will reference events you weren't present for, giving you a world that genuinely exists beyond the edges of your screen.
A Walkthrough Example
You arrive at a mountain village. The blacksmith, Tormund, is suspicious of strangers (starting reputation: -5). You ask him for work. He grudgingly offers you a bellows-pumping job. You do it well and your reputation rises to +10. You chat with him about his forge and he opens up about needing rare ore from the caves.
You promise to bring him starmetal. That promise is stored as a high-importance memory vector. Three game-days pass. You visit the shopkeeper, Elara, who mentions Tormund has been asking about you — the gossip network carried your improving reputation. She offers you a small discount.
You return to Tormund with the starmetal. He remembers your promise (retrieved via vector search), is impressed you followed through, and your reputation jumps to +35. He unlocks an apprentice crafting recipe for you. The elder hears about your reliability through gossip and your global reputation rises.
This entire sequence — the promise, the gossip, the memory retrieval, the reputation cascade — happened without a single scripted event. It emerged from the systems working together.
Frequently Asked Questions
Do NPCs remember everything I say?
Conversations are summarized and stored as vector embeddings. When you talk to an NPC again, the most relevant past interactions are retrieved via cosine similarity search. The system prioritizes important moments — promises, insults, gifts, confessions — over small talk.
Can NPCs lie to me?
Yes. NPCs respond based on their personality, their opinion of you, and their goals. A manipulative NPC with low trust might exaggerate threats or withhold information. A friendly NPC might soften bad news. The AI generates responses in character, not as an objective narrator.
What happens if I insult an NPC?
Your reputation with that NPC drops. They remember the insult in future conversations and may bring it up. If they are connected to other NPCs via the gossip network, those NPCs also learn about it — and their opinion of you shifts too. One insult can cascade.
Do NPCs talk to each other about me?
Yes. The gossip system propagates reputation changes across a social network. NPCs with close relationships (the shopkeeper and the elder, the barkeep and the barmaid) share information faster. Negative reputation spreads approximately 30% faster than positive reputation.
Experience It Yourself
The best way to understand the AI NPC system is to have a conversation with a villager. Join the playtest and see what happens when you make — or break — a promise.