Unity NPC persistence for RPGs and living worlds
Keep NPC memory and relationships alive between scenes.
MistScale gives your Unity NPCs a persistent cognitive layer, so they remember players, carry mood forward, and stay grounded in your lore. The scene can unload as many times as it likes. The character still knows who just walked back in.
The problem
Reset behavior is the thing players notice.
Every return visit is a first meeting
The scene unloads, the NPC's dialogue state goes with it, and the character greets a player it has spoken to for six hours like a stranger.
Save flags cannot hold a relationship
A door is one boolean. Trust, mood, promises made, and what the player actually said are not, and they grow every session.
You end up building the whole layer yourself
Custom save schemas, dialogue state, relationship tracking, and a retrieval story for which of four hundred remembered facts belongs in this line.
How it works
The state was never in the scene.
An NPC's memory, mood, and relationship with each player are held server side and retrieved per message. There is no save pass to write and no restore pass to run on load, because there is nothing on the device to restore. The component reconnects and the character is already itself.
using Mistscale.SDK;
using UnityEngine;
public class TavernKeeper : MonoBehaviour
{
[SerializeField] private MistscaleNPC mira; // drag in the Inspector
void Start()
{
// No load pass, no restore step. Whatever Mira knew
// about this player is already there on connect.
mira.OnNPCResponseReceived += reply => dialogueUI.Show(reply);
}
public void Say(string playerMessage)
{
mira.SendChat(playerMessage);
}
}That is the whole integration for text. Each running game instance gets its own player identity by default, so two testers build two separate relationships with the same character. For a released game, pass your own stable player ID before the connection opens so returning players are recognized across devices.
What survives
- Scene unloads and additive loads
- Play mode restarts and rebuilds
- Quitting the game and coming back days later
- Reinstalls, because none of it lives on the device
- Two players talking to the same NPC, kept as two separate relationships
What that buys you
A tavern keeper who greets a player differently after a week away. A guard who refuses help because of something that actually happened. A merchant who is warm to one player and wary of another, in the same world, on the same day.
Mood moves one step at a time rather than flipping per message, so characters read as consistent rather than unstable. It takes a pattern of behavior to change how an NPC feels about someone.
Integration
Small enough to test this afternoon.
One component
Drop MistscaleNPC on a GameObject, paste the NPC ID, press Play. Sending a message is one method call and receiving the reply is one event.
Engine agnostic underneath
The SDK ships its own WebSocket transport with no other dependencies. Any engine that can stream messages can integrate against the same protocol.
Free tier, no credit card
Point a test scene at a live NPC and judge the returning-player behavior yourself before you commit to building anything around it.
Straight answers
The questions Unity devs actually ask.
Will this work if my NPC is in an inactive scene?
The state was never in the scene, so unloading it changes nothing. Memory, mood, and per-player relationships live on the server. When the scene reloads and the component reconnects, the NPC resumes exactly where it left off. To be precise about what this is not: MistScale does not simulate NPCs in the background. The character does not act, move, or change its mind while nobody is talking to it. It picks up mid-relationship, not mid-life.
Do I need to replace my whole dialogue system?
No. MistScale is the cognitive layer behind your NPCs, not a replacement for your game logic. Authored quest beats, branching trees, and cutscenes stay yours. MistScale handles memory, mood, per-player relationship state, and the open-ended conversation around them.
Do I still need my own save system?
Yes. MistScale persists what NPCs know and how they feel about each player. Doors, coins, inventory, and quest flags are still your save system's job. The two layers sit side by side and do not overlap.
How do you keep NPCs from making things up?
Every specific claim an NPC makes is traced back to memory, your uploaded lore documents, or the character brief. Anything that cannot be sourced is rewritten from verified knowledge or refused with calibrated uncertainty, because an NPC saying it does not know costs far less trust than one that invents a place name.
Is this only for prototypes?
No. It is built for shipping games, where the same character has to stay consistent across thousands of players and months of play. That is also why mood moves one step at a time rather than swinging per message.
Start with one NPC, not the whole game.
Point a test scene at a single character, talk to it, quit, come back tomorrow, and see whether it knows you. That is the only proof that matters, and it takes minutes rather than a sprint.
Building the save layer around it? Read persisting state between sessions in Unity or the first NPC walkthrough.