EXPLORE COLLECTIONS LEADERBOARD PRICING DOCS BLOG DISCORD
← Blog Tutorial 7 min read

Add AI Dialogue to Your Indie Game — No API Key Required

Published May 8, 2026

You finished your level. The world is built, the player can move, the enemies attack. But the NPC just stands there. You click on them and nothing happens. You need dialogue — and writing it from scratch for every character feels like a second job.

The conventional answer is to pay for the OpenAI or Anthropic API, plug it into your engine, and stream tokens at runtime. That works. It also costs money, requires writing code, leaks API keys if you ship to the browser, and gives you a hard dependency on a remote service that can go down or change pricing on you.

There is a much simpler approach that works for most indie games: have the AI write the dialogue once, paste it into your game, ship. No API key. No backend server. No per-message cost. No stream of unpredictable model output at runtime. Just deterministic, hand-reviewable writing that lives in your game files.

The Round-Trip Workflow

The whole flow takes less than five minutes:

  1. Write the world (synopsis, ending, NPC backstories) in your game editor.
  2. Click Copy Prompt — your editor builds a structured prompt that includes every NPC the AI needs to write dialogue for.
  3. Paste into Claude, Gemini, or ChatGPT (the free tier of any of them works).
  4. Copy the AI's response and paste it back into your editor.
  5. Click Apply. Every NPC now has dialogue, quests, and item rewards.

That's the entire pipeline. The AI never touches your runtime code. Your players never wait on a network round-trip. You can review every line of dialogue before it ships.

Why This Beats a Live API for Indie Devs

Live AI calls during gameplay sound futuristic, but for most indie projects they trade a small upside ("dialogue can vary every playthrough") for a stack of real downsides:

  • Cost. Even Claude Haiku or GPT-4o-mini at scale isn't free. A game with 1,000 players doing 50 NPC interactions each is 50,000 calls. That's a real bill.
  • Latency. A 2-second wait between "click NPC" and "see first line" feels broken. Streaming helps but adds network jitter.
  • Determinism. A speedrunner needs the same NPC to say the same thing on every playthrough. AI at runtime kills speedrunning, modding, and most testing workflows.
  • Safety. Live AI can be jailbroken into saying things you don't want associated with your game. Pre-generated dialogue is reviewed by you, line by line.
  • Offline. The browser can play your game without internet. Add live AI and that breaks.

Pre-generated dialogue keeps every benefit AI gives you (creative writing assistance, in-character voice, fast iteration) and avoids every cost.

Which AI Should You Use?

We've tested the same prompt across the three big chat models in May 2026. All three produce usable VXLScript. The differences are subtle:

  • Claude (Anthropic). Best at staying in character across a long NPC roster. Will catch contradictions in your synopsis ("you said the village is cursed but the merchant is selling celebration cakes — which is it?"). Best for narrative-heavy games.
  • Gemini (Google). Fastest. Good at branching choice trees. Sometimes invents item IDs that aren't in your world — easy to spot and fix on review.
  • ChatGPT (OpenAI). Best at humour and wordplay. Will pad lines with "great to see you again, friend" filler unless you ask for terseness. Good for cosy / casual games.

You don't have to commit to one. Run the same prompt through two of them, paste both responses into a comparison view, and pick the better dialogue per NPC. That's a workflow you simply can't do with a live API integration.

What the Generated Output Looks Like

The AI returns a plain-text script in a custom dialogue language (we call it VXLScript). Each NPC has a header, a list of lines, and quest hooks expressed as bracketed commands:

@NPC Elder [village_square:2]
# START
-> DONE (need 1 $relic_quest_done)

Elder: *Leans on his staff.* You returned, traveller.
Elder: The relics — show me what you have.

* 🙂 I have all three. (need 3 $relic) -> COMPLETE
* 🤔 Tell me again what they do. -> LORE
* 😬 Not yet. -> END

# COMPLETE
[take relic 3]
[give gold 500]
[set relic_quest_done 1]
Elder: At last. *He performs the ritual. Sky clears.*
[end_game "The curse is broken. The valley is safe."]
-> END

Every command in brackets is parsed by your game engine at runtime. You can read the dialogue and tweak any line by hand — the AI is a starting draft, not a black box.

Tips for a Better First Pass

  • Write a tight synopsis. One paragraph. The AI will hallucinate a generic fantasy plot if you leave it blank. Give it a specific world ("a 1990s post-office where letters can travel in time") and it stays interesting.
  • Describe each NPC in one sentence. "Gruff old elder, weary, wants the curse broken." That's enough — more text often confuses the model.
  • List your items and gold. Give the AI the exact item ids your scene already uses. It'll wire [give relic 1] instead of inventing a "magic-stone-3" id you don't have.
  • Pick a clear ending. The AI uses the ending as the destination — every quest line should ladder up to it. Vague endings give meandering quests.
  • Re-prompt one NPC at a time if something feels flat. You don't have to regenerate the whole thing.

Try It Free

The full editor with this AI workflow is free in your browser at VXLVERSE. No download, no install, no API key. Open the editor, drop a scene, click Story, write your synopsis, hit Copy, paste into your favourite AI, paste back, click Apply. Five minutes from empty world to a playable adventure with talking NPCs.

For more on what you can do once the dialogue is wired up, see our no-code NPC dialogue guide, the 30-minute speed-run, and our free RPG creation walkthrough.