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.

Step 1 of 3: The NPC

How to use it

  1. Type the NPC's Name and Role, add a Personality if you like, pick a Speech style, and press Next.
  2. Pick a situation such as Quest offer or Reaction to a player choice, add the details it asks for, and press Next.
  3. Choose the Player choices per line, the Branching depth and the Line length. Sign in to Ziva if asked, then press Generate dialogue.
  4. 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.
  5. 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?
Store the conversation as nodes: each node is a line the NPC says and a list of choices, and each choice names the next node. Your game shows the current line, a button per choice, and moves to the next node when the player picks one. Download JSON gives you a conversation in exactly this shape.
Is the NPC dialogue generator free?
You can fill in every step without an account. Writing the dialogue needs a free Ziva account, and each generation counts toward your Ziva plan.
Can I use the JSON in Unity, Unreal or another engine?
Yes. The file is plain JSON with ids, text and choices, so any engine or tool that can read JSON can load it. You write the code that shows the lines and the choices, or ask Ziva to build it.
How big can a conversation get?
Up to 4 player choices at each step and a branching depth of 2, which means the player answers the NPC, hears a reply, and answers once more before the conversation ends. Choices with the same outcome can share an ending, which keeps the tree small enough to write and test.
How is this different from the RPG quest generator?
The RPG quest generator builds quest outlines from hand-written templates at random, with no AI. The NPC dialogue generator writes the actual conversation for the NPC you describe, line by line, in their own voice.

See all tools