How to Write AI Prompts for Game Dialogue and NPC Writing
November 2, 2026 · 8 min read
Ask an AI tool to "write dialogue for a game NPC, a blacksmith in a fantasy village" and what comes back is competent and almost entirely generic: lines that could belong to any blacksmith in any game, heavy on stating information, light on anything that feels like a specific person talking. The model is not bad at dialogue. A one-line persona request gives it almost nothing to build a scene from, so it defaults to restating the role back to you in dialogue form, a blacksmith who talks about the forge because that is what the prompt told it a blacksmith would talk about.
Why "give him a personality" produces flat dialogue
A personality trait on its own, gruff, cheerful, sarcastic, describes a surface tone, not what actually drives a line of dialogue. Game dialogue that holds together over dozens or hundreds of lines does so because the character wants something specific in each exchange and has a specific way of pursuing, avoiding, or deflecting that want, not because a single adjective was attached to a name. Without a want and an obstacle behind it, the model produces dialogue that sounds like the trait (gruff reads as short sentences and grumbling) but underneath that surface, says nothing a different gruff character in a different game could not also have said.
Give the model a want and an obstacle, not just a trait
Instead of "write dialogue for a grumpy blacksmith," specify what the blacksmith actually wants in this exchange (he wants the player to leave so he can finish an order before dark) and what stops him from just saying that plainly (he does not want to admit he is behind schedule, so he deflects by complaining about the quality of ore lately). That want-and-obstacle pair gives the model an actual engine for the scene instead of one flavor word to imitate, and it is the difference between a line with real texture and one that reads exactly the way a reader cue of "grumpy" would read, no matter how colorful the word choice around it gets.
Branching dialogue needs explicit state, not just more lines
For an actual branching dialogue tree, specify what state each branch carries, not just the different lines a player might hear at each node: what the NPC already knows going into this conversation, what has changed since the last time the player spoke to them, and what flag each player choice should set for later. A model generating branches without being told what carries between them tends to write each one as though it is the only path through the conversation, so an "if player was rude" branch and an "if player apologized" branch end up referencing the same prior context identically, or one branch quietly forgets something the other branch already established.
Keeping one NPC’s voice consistent across a hundred lines
A short description written once at the start of a session is rarely enough to carry a character’s voice across a hundred lines generated over several separate prompts, especially once barks, quest dialogue, and combat lines get written in separate batches. Naming one or two concrete, repeatable speech habits, never uses contractions, always answers a question with a question, refers to money only as "coin," gives the model something mechanical to check each new batch against rather than a vibe that drifts a little further from the original with every generation. Restating those habits explicitly in every new batch for the same character, rather than assuming the model remembers an earlier message, is the difference between a voice that holds for the whole game and one that quietly flattens out by the fifth quest.
Barks and combat chatter follow different rules than scripted dialogue
Ambient barks and combat chatter are short, repeated constantly, and heard with no surrounding context, so they need their own constraints: a strict length limit (most barks need to read in under two seconds, so five to eight words is often the real ceiling, not a suggestion), an explicit instruction to avoid referencing specific quest state since a bark can play at any point in the story, and a request for several interchangeable variants rather than one polished line, since the same bark repeating during a long fight is one of the fastest ways a player notices scripted or AI-generated dialogue in the first place. Treating a request for fifteen combat barks the same way as a request for one scripted cutscene line produces lines that are each fine on their own and collectively exhausting by the third repeat.
A worked example, before and after
Weak prompt: "write dialogue for a grumpy innkeeper NPC" produces a handful of lines that sound grumpy but carry no scene, nothing that would actually change depending on what the player just did. Structured prompt: "Innkeeper NPC, wants the player to pay their overdue tab before getting a room, won’t say that directly because he is embarrassed about needing the money. Never uses contractions, calls every guest ’friend’ sarcastically when annoyed. Write three versions of this exchange: one where the player has enough coin and pays without being asked, one where they try to leave without paying, one where they ask for credit." gives the model a want, an obstacle, a voice habit, and three branching states to differentiate between, so what comes back is a character actually navigating a scene rather than an adjective dressed up as dialogue.
Carrying voice and state across every batch of lines
Rebuilding a character’s want, obstacle, and speech habits from scratch for every new batch of lines, barks in one session, quest dialogue in another, is exactly the kind of structural detail that gets quietly dropped when a project has dozens of NPCs and hundreds of lines to write. Promptima carries that structure into the prompt automatically, so a character’s established voice and verbal habits get restated every time rather than relying on the model to remember them from an earlier conversation.
Common mistakes
Handing over a single personality adjective and expecting dialogue with actual texture, instead of giving the model a specific want and what stops the character from saying it plainly. Writing branching dialogue without specifying what state carries between branches, so paths that should know different things end up referencing identical context. Letting a character’s voice drift batch to batch by assuming a short description from an earlier session still applies, instead of restating the concrete speech habits every time. Writing barks and ambient chatter with the same length and specificity as scripted dialogue, instead of keeping them short, state-independent, and offered in several interchangeable variants.
Frequently asked questions
Why does AI-generated NPC dialogue always sound generic?
Because a single personality trait like "gruff" or "cheerful" describes a surface tone, not what drives a line of dialogue. Without a specific want for the character in that exchange, and something stopping them from stating it plainly, the model produces dialogue that matches the trait’s tone but says nothing a different character with the same trait could not also have said.
How do I write branching dialogue that stays consistent across paths?
Specify what state carries between branches, not just the different lines at each node: what the NPC already knows, what changed since the last conversation, and what flag each choice sets. Without that, a model tends to write each branch as if it were the only path, so branches that should know different things end up referencing the same context identically.
How short should ambient barks and combat chatter actually be?
Most barks need to read in under two seconds, which in practice means five to eight words is closer to a hard ceiling than a suggestion. Ask for several interchangeable variants rather than one polished line, and keep them independent of specific quest state, since a bark can play at any point in the game regardless of story progress.
How do I keep one NPC’s voice consistent across hundreds of generated lines?
Name one or two concrete, repeatable speech habits, never uses contractions, always answers questions with questions, and restate them explicitly in every new batch of lines rather than assuming the model remembers an earlier session. A vibe-level description written once tends to drift further from the original with each new generation; a mechanical habit the model can check against does not.
Try Promptima to build NPC dialogue prompts that carry a want, an obstacle, and a voice habit into every batch of lines →
✦ Try Promptima freeMore articles
Best AI Prompt Optimizer Tools in 2026 (And When to Use Each)
Prompt marketplaces, browser extensions, manual prompt engineering, and dedicated optimizers all solve a different version of the same problem. Here is how to tell which one you actually need.
How to Turn One Photo Into a Ready-to-Use AI Video Prompt
You have an image whose look you want to bring to life as a video. The problem is that video AI tools don’t read image prompts — they need camera, motion, and duration described in a completely different structure. Here’s how to bridge the two.