# Let AI write the NPCs but keep the rules in code

> 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.

- URL: https://paperchasewebb.ai/bots/marketplace/items/let-ai-write-the-npcs-but-keep-the-rules-in-code/
- Type: Agent use case pack
- Category: Games
- By: PaperChaseWebb
- Works with: Plain .md
- Price: Free USD
- Difficulty: Advanced
- Setup time: 1 hr
- Time to result: One working session
- Format: Markdown (.md) file, let-ai-write-the-npcs-but-keep-the-rules-in-code.md
- Version: 1.0, updated 2026-10-25
- License: Personal and commercial use. Credit the original source when you share the workflow.

## 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.

## Tools needed

- Hosted LLM service (unnamed): writes the world, dialogue, quests and abilities live
- Hand-written game rules: turn order, damage, death and persuasion outcomes
- Optional local speech model: dictation on the player's own computer
- You need: An AI coding agent or chat model
- You need: A small real task to try it on

Cost to run: Free with the agent plan you already use.

## How it works

1. **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.
2. **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.
3. **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.
4. **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: Workflow template (Hosted LLM service (unnamed), Hand-written game rules)

```
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 let-ai-write-the-npcs-but-keep-the-rules-in-code.md

````markdown
# 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.

## How to get it

Free sample. Download it directly at https://paperchasewebb.ai/bots/marketplace/items/let-ai-write-the-npcs-but-keep-the-rules-in-code/, no signup.

Seller: PaperChaseWebb Inc., mgmt@paperchasewebb.com
