Let AI write the NPCs but keep the rules in code
by PaperChaseWebb
A one-person studio is building Someone Else's War, a Steam RPG where an AI writes the world, characters and replies to whatever you type, while hand-written rules decide every fight and hold NPCs to the deals they make.
- Price
- Free
- Difficulty
- Advanced
- Setup
- 1 hr
- Format
- .md file
let-ai-write-the-npcs-but-keep-the-rules-in-code.md · 3 KB · direct download, no signup
What you end up with
The split (AI for words, code for numbers and outcomes) is the reusable design lesson, because it keeps the game learnable and stops a model from talking its way past the rules.
What you get
- A plain-language summary of the workflow
- A fill-in prompt template
- What to watch out for
- A link to the original source
Who it is for
Builders who already use AI agents and want a proven workflow they can copy into their own project.
Works with
Dashed chip: Plain Markdown, so it also pastes into other agents such as Grok Bot, Hermes, OpenClaw or Muse. We list those as compatible by format only, not as tested.
Tools needed
Cost to run: Free with the agent plan you already use.
Time to result: One working session
How it works
Let the model write [world text, character voice, replies]
Let the model write [world text, character voice, replies].
Expected: Done before you move to the next step.
Keep every rule that decides outcomes (damage, prices, deals, win and
Keep every rule that decides outcomes (damage, prices, deals, win and lose) in plain code the model cannot change.
Expected: Done before you move to the next step.
Pass the model only the facts the rules produced, and validate its rep
Pass the model only the facts the rules produced, and validate its reply against them before showing it.
Expected: Done before you move to the next step.
Log every case where the model contradicts the rules and add a code ch
Log every case where the model contradicts the rules and add a code check for it.
Expected: Done before you move to the next step.
Sample prompt from the pack
Apply this workflow to [your project]: 1. Let the model write [world text, character voice, replies]. 2. Keep every rule that decides outcomes (damage, prices, deals, win and lose) in plain code the model cannot change. 3. Pass the model only the facts the rules produced, and validate its reply against them before showing it. 4. Log every case where the model contradicts the rules and add a code check for it. Stop and ask me before anything irreversible: deploys, payments, sends or deletes.
Adapted by PaperChaseWebb. Not the original author's prompt.
Free preview of the file
# Let AI write the NPCs but keep the rules in code PaperChase agent use case (free feed entry), version 1.0. Source: [Ghamra Studios (@Ghamrastudios on X)](https://x.com/Ghamrastudios/status/2112036410878243267), 2026-10-19. ## What they did There are no dialogue trees: you type what you say, and characters answer what you actually said. In a posted example a scribe offered 120 gold for a job, the player asked for double, and the scribe agreed to 240, which the game then recorded and enforced. When you try to talk an enemy down, the AI only scores how good the argument was and the game's own rules decide whether it works. Places you mention and errands you accept get written into the map, and a setting at New Game picks whether the world is written for under 13, 13 to 17, or adults. ## Worth knowing The split (AI for words, code for numbers and outcomes) is the reusable design lesson, because it keeps the game learnable and stops a model from talking its way past the rules. The Steam page carries an unusually clear AI disclosure. The game is still listed as coming soon, needs an internet connection, and uses a monthly fair-use limit with paid credits beyond it, so treat this as a design pattern to study rather than a game to recommend yet.
Worth knowing
- The split (AI for words, code for numbers and outcomes) is the reusable design lesson, because it keeps the game learnable and stops a model from talking its way past the rules. The Steam page carries an unusually clear AI disclosure. The game is still listed as coming soon, needs an internet connection, and uses a monthly fair-use limit with paid credits beyond it, so treat this as a design pattern to study rather than a game to recommend yet.
- Figures are as reported by the original author and were not re-measured by us.
Questions
Where does this come from?
A public post credited to Ghamra Studios (@Ghamrastudios on X). Source: https://x.com/Ghamrastudios/status/2112036410878243267
Is it free?
Yes. Feed entries are free to read and download.
Details
Version 1.0 · Updated Oct 25, 2026 · Markdown version of this page
License: Personal and commercial use. Credit the original source when you share the workflow. Download terms
Related

Build a playable browser game prototype in one evening with an AI agent
A step by step pack for going from a one-paragraph idea to a playable HTML5 game in a single file, then posting it on itch.io for friends to try.

Launch an AI-built browser game: mobile, licensing, leaderboards and the itch.io page
A launch plan for a browser game built with an AI agent: performance budget, device tests, audio and touch fixes, an asset license ledger, leaderboard hardening and the itch.io page.