NPC Dialogue Generator: Branching Trees as JSON
Describe your NPC's name, role, personality and way of speaking, pick a situation such as a quest offer, a shop or a reaction to a player choice, and get a branching conversation: NPC lines, 2 to 4 player choices at each step, one or two levels deep. Writing the dialogue needs a free Ziva account, and the result downloads as JSON a game can load.
How to use it
- Type the NPC's Name and Role, add a Personality if you like, pick a Speech style, and press Next.
- Pick a situation such as Quest offer or Reaction to a player choice, add the details it asks for, and press Next.
- Choose the Player choices per line, the Branching depth and the Line length. Sign in to Ziva if asked, then press Generate dialogue.
- Read the conversation as a tree, then press Download JSON for your game or Copy as script for a writing doc. Press Generate another for a new take.
- Press Copy Ziva prompt to have Ziva add the NPC and its dialogue to your project.
The dialogue JSON format
The file has a start id and a list of nodes. Each node is one NPC line with an id, a speaker, the text and a list of choices; each choice has the player's text and next, the id of the node it leads to. A node with no choices ends the conversation. With emotion tags on, every node also has an emotion such as happy or suspicious that you can use to swap the NPC's portrait.
Every next is checked before you see the result: if the AI returns invalid JSON, two nodes with the same id or a choice that leads nowhere, the tool shows an error instead of a broken file, and you can generate again.
In Godot 4, read the file with FileAccess.get_file_as_string and turn it into data with JSON.parse_string, which returns null if the text is not valid JSON. Put the nodes into a Dictionary keyed by id, show the current node's text in a Label or RichTextLabel, add one Button per choice, and when a button is pressed, look up its next id and show that node. If you use a dialogue plugin or another engine's dialogue system, the id and next fields map onto any node-and-link dialogue structure with a short import script.
Writing NPC dialogue players read
Keep lines short. A line that fits one dialogue box gets read; three boxes of backstory get skipped. Choose Short lines for dialogue boxes and Long lines only for text-heavy RPGs where reading is the game.
Make each player choice a different intent, not the same answer reworded: friendly, curious, practical and rude choices give the player a way to play a character, and give the NPC something different to react to. A choice should change something, even if it is only how the NPC talks to the player next time.
Give the NPC a voice through the speech style, then cut any line that only delivers information. Players remember the gruff blacksmith who complains about the weather before she gives them the quest, not the quest text itself.
Frequently asked questions
How do I make branching dialogue for a game?
Is the NPC dialogue generator free?
Can I use the JSON in Unity, Unreal or another engine?
How big can a conversation get?
How is this different from the RPG quest generator?
More free game dev tools
- Video Game Plot Generator: A full story outline for your game, with characters, a twist and a level-by-level map.
- RPG Quest Generator: A complete side quest with staged objectives, a choice and a reward, as text or JSON.
- Fantasy Character Name Generator: Fantasy names for seven races, each with an invented meaning.