We write technical scripts and dialogue trees for games — not movie scripts with blank spaces for lines. This is a technical document with states, conditions, and branching that a narrative designer can read and the dialogue engine can parse. In a typical indie studio, a narrative designer writes text in a Google Doc, a programmer transfers it into code with flags — and after 10 branches the logic breaks. We solve this problem by creating turnkey scripts: from a narrative document to a tested dialogue tree in Unity or Unreal Engine. Experience — 8 years in gamedev, 20+ projects with dialogue systems. We guarantee logical integrity of branching.
How is a dialogue tree structured?
A dialogue tree is a directed graph where one node can have multiple incoming connections. Each DialogueNode stores a speaker ID, the line text, a list of outgoing edges (DialogueEdge[]), optional entry conditions, and actions (triggers for the game world). Conditions check the game state: QuestFlag("rescued_merchant") == true, PlayerLevel >= 5, Reputation("thieves_guild") > 30. If no condition is met, the branch is hidden or replaced with a fallback line. Actions affect the world: give a quest, add an item, change reputation. This separation into conditions and actions is the foundation of any narrative system, be it Yarn Spinner, Ink, or a custom editor.
Which tool to choose: Yarn Spinner or Ink?
Yarn Spinner — a text format with syntax close to Twine. Conditions are written directly in the script: <<if $player_level >= 5>>. Commands: <<jump NodeName>>, <<set $flag = true>>. It's easy to learn: a beginner can master it in a day. Great for linear dialogues with branching. Learn more about the tool at Yarn Spinner.
Ink — a more powerful language with knots and diverts, support for visit counters (visited, visit_count) and weave structure for parallel narrative flows. Used in Disco Elysium, 80 Days, Heaven's Vault. Ink handles complex narratives 2x faster than custom C# systems, but requires more time to learn (about a week).
For 200 lines of dialogue in an action-RPG, Yarn Spinner is enough; for a narrative game with 100k+ words and a branching story, Ink is better. We help choose the right tool for your project.
How to write lines that don't break technically?
Each line must work without previous context. Test: read the line in isolation — if it's unclear what it's about, a fallback context is needed. Response options should not be empty: "Yes", "No", "Tell me more" are bad options. Instead, use "I've heard about this already", "Go on, I'm interested", "No time — what do you need?" These options convey character personality.
Localization labels: each line gets a unique ID like NPC_MERCHANT_GREETING_01, not a sequential number. This allows the translator to see context in the ID. This is standard when working with LocalizationTable in Unity.
How are dialogues integrated into quests?
A single NPC can have different lines depending on QuestState: NotStarted, InProgress, ObjectiveComplete, Turned In, Failed. Minimum 5 versions of the dialogue tree per quest, or one tree with conditional branches. A typical mistake: forgetting Turned In — after turning in a quest, the player hears the quest offer again. We check all states and add fallback lines. Savings on fixes — up to 40% of QA time.
What is included in the work?
| Deliverable | Description |
|---|---|
| Narrative document | Description of characters, quest structure, key lines |
| Dialogue scripts | Ready files in Yarn Spinner or Ink format, compatible with your project |
| Localization tables | CSV/JSON with unique string IDs for translators |
| Engine integration | Check operation in Unity/Unreal editor with logs enabled |
| Testing | Full walkthrough of all branches, bug report and fixes |
Working process: stages
- Narrative document — description of characters, motivations, key points.
- Node structure in the tool (Yarn Spinner Visual Editor or Articy:Draft).
- Draft dialogue — text of lines and response options.
- Technical review for feasibility of conditions and actions.
- Revisions and final text.
- Manual testing of all branches with logs (identify dead branches and nodes without exit).
Typical mistakes and how to avoid them
- Missing fallback lines when conditions are not met — player sees empty branches.
- Using sequential numbers instead of meaningful IDs — confusion during localization.
- Overly long "one-off" branches without considering NPC returning to initial state.
- Ignoring quest states — forgetting Turned In.
For example, on a project with 10 quests and 2000 dialogue lines, we find up to 15 dead branches and 8 nodes without exit. Our testing eliminates these before production.
How is project evaluation done?
We analyze the narrative structure, number of characters, branching complexity, and target engine. Evaluation takes 1 day. Result — accurate timeline and cost, calculated individually. Savings on testing due to thorough logical analysis — up to 40%.
Estimated timelines
| Scale | Volume | Timeline |
|---|---|---|
| Small | 1–3 quests, ~500 dialogue lines | 1–2 weeks |
| Medium | Main story + side quests, ~3000–5000 lines | 1–2 months |
| Large | Full narrative system, 20k+ lines | 3–6 months |
We have 8+ years of experience in gamedev and 20+ completed projects. We guarantee logical integrity of dialogues. Contact us for a free project evaluation. Get a dialogue tree prototype in just 2 days.





