Make a game’s side characters talk with an AI model
Give each non-player character a short persona and rules, and have a model write their lines in response to what the player does, inside safe limits.
- Difficulty
- Builder
- Setup time
- 3 hr
- Monthly cost
- $10/mo
- What it saves
- pages of hand-written dialogue
How to do it
- Write a 5-line persona for each character: who they are, what they know, what they want, how they talk, what they never say.
- Have your game send the persona, the recent events and the player's line to the model.
- Limit replies to two sentences and a mood tag your game can animate.
- Cache common lines so you do not pay for the same reply twice.
- Add a fallback line for when the model is slow or offline.
The prompt
You are {{npc_name}} in a game. Persona: {{persona}}. You know only: {{knowledge}}. You never reveal: {{secrets}}.
Recent events: {{events}}
The player says: "{{player_line}}"
Reply in character in at most 2 sentences. Return JSON: {"line": "...", "mood": "happy|neutral|angry|scared|sly", "gives_quest": true/false}. Stay family-friendly. Never break character or mention being an AI.
Blaze School prompt pack
The full version adds variations, error handling and a checklist. It is part of Blaze School.
Members get every prompt pack.
Where this comes from
A build we designed. Not yet tested end to end.
Tried this? Tell us how it went and help move its proof level up.