Atlas of Bretonnia

Modders' workshop · guide · 26 min read

Modding Total War with an AI: method, tools and examples

Four days of work to bring an entire Warhammer I campaign map into Warhammer III: it loads and plays, and both its look and its stability are still being polished. An AI doing the work, a human doing the judging. Here is how to go about it: which AI, how to get started, how to plug it into the modding tools, how to organise the work so it repeats its mistakes as little as possible, and examples to copy.

Reviewed on 25 September 2026, update 9.0. Written against its sources, Claude Code's and Codex's documentation, RPFM 5.0.6; what 9.0 changed on our project has been added, the rest has not been rechecked point by point. When in doubt, check, and tell us.

Sharing the roles§

“I'm the brain, and you're the execution”: that is how Charles summed up the work. Today's AI, used as an agent (it reads your files, runs commands, writes code and checks what it produces), does the heavy lifting of a big mod. The judgement stays human.

The human: the brain

  • decides; decisions get written down as “not to reopen”
  • judges in game, against a reference: is it beautiful, faithful, fun?
  • validates the lore and its sources: an AI can make things up with confidence
  • sees the screen: the AI only sees it if you show it
  • decides what gets published; the only one who deletes
the briefthe proof

The AI agent: the execution

  • writes the scripts (Python, Lua) and thousands of table rows
  • takes the game's files apart, reads crash dumps
  • drives RPFM through MCP, runs from the command line the exports and checks of CAIME (Campaign AI Map Editor), the Campaign Map Toolkit's editor
  • keeps the documentation, the error log, the handovers
  • runs the tests and reports the proof

Modding words (pack, startpos, control case…) are explained in the tools guide. Five more for this guide: a session is an agent conversation, with its own domain; a handover is the note that passes a workstream to another session; a notice is the time announced before writing to a shared resource; MCP (Model Context Protocol) is the standard plug through which an agent connects to a tool; a heredoc is a block of text pasted into a terminal command.

Which AI to choose§

In practice: one of those two models, or later the most capable one for code (names change fast), used as an agent (Codex for GPT-6, Claude Code for Claude), in the terminal or in the desktop app, not in a plain chat window. The agent reads the project folder, runs the tools, reads back what they produce and fixes it; a chat window makes you copy everything by hand.

Chat window or agentA chat windowYou paste the file into itYou copy its answer back intothe fileYou run the tool, you copythe error backeverything goes through your handsAn agent:Claude Code, CodexIt reads the project folderIt runs the tool and readsits outputIt fixes, then shows you theproofyou judge
In a chat window, everything goes through your hands; an agent reads, runs and fixes by itself, then brings you the proof. You keep the judgement.

A big subscription, because a modding project means long sessions, often several in parallel: up to four at once for us (on 23 September), each on its own domain.

First steps§

Never used an agent? Seven moves, in order, before the first real task:

First stepsMake a dated copy of the mod folderor put it under git: the agent writes to your files, thecopy lets you go back.1Install the agentClaude Code or Codex, from their official page; both alsocome as a desktop app.2Open it in the mod folderin a terminal; for Codex, codex instead of claude; in thedesktop app, open that same folder.cd my_modclaude3Write the entry pointat the root, on the skeleton below; for Claude Code,a CLAUDE.md; for Codex, an AGENTS.md; in Claude Code, /initdrafts a first version to fix.CLAUDE.mdAGENTS.md4Set the permissionsat first, have it ask you before every command;in Claude Code: /permissions.The entry point steers the agent, it locks nothing: a firmban goes into its permissions.5Plug in RPFMstart rpfm_server.exe; add it to the agent from anotherterminal; reopen the agent; check with /mcp (detailsbelow).6First brief, read-only"Describe my pack without changing anything, and say whereeach piece of information comes from."Judge the answer before any writing.7
Seven moves before the first real task: a copy to go back to, the agent in the mod folder, an entry point, permissions, RPFM plugged in, and a first brief that changes nothing.

The commands of move 3, in a terminal (replace my_mod with the path of your mod folder; for Codex, codex instead of claude):

cd my_mod
claude

To install the agent, follow its official page: Claude Code or Codex. Both also come as a desktop app, if the terminal puts you off. In Claude Code, permissions are set with /permissions: “ask” and “deny” rules, or a hook. The details of plugging in RPFM are below, “Plugging in RPFM, step by step”.

Plugging the AI into the tools§

An AI is only as good as what it can reach. The rule: everything that can be done without a window should be done without a window.

No window firstThe AI on screenfirst, ask what the screen would teach that thedisk doesn't; nobody touches the PC;afterwards, check the keyboard.only with your consentYou: by handTerry: painting, placing props; the judgementin game.You: one clickBOB: Start, or Process with BOBin Terry; CAIME: import a layer(Tools → Import → Layer data).The AI alone, no windowfiles, XML tables, rules.bob, .hex_layer layerswritten by script; RPFMthrough MCP; CAIME: process and validate.preferredslower, riskier
The higher you go, the slower and riskier: what can be done without a window is not done on screen.

Plugging in RPFM, step by step§

Plugging RPFM in through MCPYour agentClaude Codeor CodexRPFM 5rpfm_server.exeMCPcallanswerMCP (Model Context Protocol): the standard plug through which an agentcalls a tool's commands. RPFM offers them on your machine,at 127.0.0.1:45127.Start the serverno argument; it exits with the last session: start it againbefore every session.rpfm_server.exe1Add it to the agentin a terminal, not in the conversation:Claude Code (on one line)claude mcp add --transport http rpfm http://127.0.0.1:45127/mcpCodex (on one line)codex mcp add rpfm --url http://127.0.0.1:45127/mcp2Checkreopen the session, type /mcp: rpfm must show as connected,with its tools.3Before the first call"First read the server's Initialization guide resource: itgives the order of calls."4
RPFM offers its commands on your machine; the agent calls them through MCP. Four moves: start, add, check, then read the resource that gives the order of calls. The commands to copy are just below; the traps are in the RPFM guide.

The command of move 2, to copy as it is, on a single line, in a terminal: the first for Claude Code, the second for Codex.

claude mcp add --transport http rpfm http://127.0.0.1:45127/mcp
codex mcp add rpfm --url http://127.0.0.1:45127/mcp

Organising the project for an AI§

Every session starts from a blank conversation: the agent only knows what it reads at start-up (the entry point and, in Claude Code, a short automatic memory). Everything that matters must therefore be written down, in the right place, and read again at the start of every session.

Start of a session: readthe agentCLAUDE.md1loaded automaticallyError log2The guide3Handovers4read because CLAUDE.md says soDated logswhen neededEnd of a session: writethe project's status, when it changes→ CLAUDE.mdan understood mistake, the same day, with its rule→ Error loga discovery, with its proof→ The guidewhere a workstream stands when it changes hands→ Handoversthe proof: tool output, measurements, screenshots→ Dated logsWhat is not written down is lost by the next session.
At the start of a session the agent loads the entry point, which has it read, in order, the error log's rules, the guide and its workstream's handover; the dated logs when needed. At the end, each thing goes into its book.
FileWhat it holds
CLAUDE.md (or AGENTS.md for Codex)the entry point, read every session: project status, decisions not to reopen, who does what, recipes, rules
the error logevery mistake: what was done, the symptom, the cause, the rule
the technical guideestablished knowledge: formats, tool chains, numbered pitfalls, with their proof
the handoverswhen a workstream changes hands: where it stands, what is left, what not to redo
the dated logsthe proof: tool output, measurements, screenshots

A CLAUDE.md skeleton to copy:

# My mod — entry point
## Status (date): what works, what is left
## Decisions not to reopen
## Who does what: session → domain (sole writer)
## Recipes: exact commands
## Rules: back up before writing; nothing published without consent

Put it at the root of the project folder: the agent reads it at the start of every session. Keep it short (Claude Code's documentation advises under 200 lines) and point to the rest. It steers the agent but locks nothing: what must be forbidden for sure (launching the game, deleting, publishing) goes into the agent's permissions (in Claude Code, /permissions; “ask” and “deny” rules, or a hook).

For Codex and Claude Code to read the same text, write it in AGENTS.md, which Codex reads on its own, and put the line @AGENTS.md in CLAUDE.md: Claude Code then imports the file at start-up (with no CLAUDE.md, its recent versions read AGENTS.md directly). A sentence saying “read CLAUDE.md” is not an import: the agent only opens the file if it decides to. Our project does the reverse, a short AGENTS.md pointing to CLAUDE.md: it works as long as the agent follows the pointer.

One text, two agentsCodexreads AGENTS.md beforedoing any workClaude Codereads CLAUDE.md at thestart of every sessionCLAUDE.md@AGENTS.mdthen anything for ClaudeonlyAGENTS.mdthe shared text: status, decisions, whodoes what, recipes, rulesReads it on its ownImports it at start-upWith no CLAUDE.md, recent versions of Claude Code read AGENTS.md directly.A sentence is not an importCLAUDE.md"Read AGENTS.md."Claude Code then opens AGENTS.md only if it decides to.
One text for both agents: AGENTS.md, which Codex reads on its own and Claude Code imports through the line @AGENTS.md in its CLAUDE.md. A sentence asking to read it is not an import.

Write your decisions down as “not to reopen”: otherwise every new session suggests the option you turned down. For us: keep the Warhammer I map's scale, no carving up of the Immortal Empires map.

Several sessions in parallel§

Four sessions, one projectShared resourcesThe Assembly Kit: at least 5 minutes' notice; a scriptcomputes the time.14:00announce: "at 14:05"at least 5 min14:05write, not beforeThe game, Terry, the startpos: warn the other sessions.The pack: never rebuilt during an in-game test.Shared documents: one writer; the others send it theirmistakes.A new file: first check that its name is free.Pack and startposthe pack, the startpos,the tests; the shareddocumentsData and scriptsthe tables, thescripts, the textsMap renderingrivers, lakes, bridges,mountains, texturesExpansionthe map to come, thissiteTidy away, never delete: only the human deletes.
Each session has its own domain and is the only one writing there; what they share (the kit, the game, the pack, the shared documents) follows written rules, which each one rereads at the start of its session.

Opening two sessions, step by step§

  1. Open each session in the same project folder (two terminals, or two sessions in the app).
  2. Each one's first message: its name, its domain, the files only it writes to, and what it must not touch.
  3. Copy that split into the “Who does what” table of the entry point: every session reads it when it starts.
  4. Before writing to a shared resource, the session announces a time (at least five minutes later), waits for its timer, then writes. Announcements go through you, or through a message from one session to another if your tool allows it (that is what we do).
  5. A single session keeps the shared documents; the others send it their mistakes.

The work loop§

Every task turns the wheel once. The last notch counts as much as the others: an understood mistake is written down the same day, with the rule that prevents it.

  1. Briefthe goal, the criterion, the don'ts
  2. Workscripts, tables, tests
  3. Proofcommand, output, screenshot
  4. Judgementin game, against the reference
  5. Error logthe mistake and its rule

Every understood mistake leaves a written rule.

The workshop wheel: you only move to the next task with a proof and a judgement.

A good brief§

Six lines are enough. Here is the one for a thirty-turn test:

BriefGoalthe campaign holds 30 turns in "AIplays everything" mode.Criterion0 crashes, 0 errors in thescript_log.Sourcesthe project guide, yesterday'stest report.Don’tsdon't touch the startpos; warnbefore launching the game.Proofthe exact command, the turnreport, a log extract.Controlthe same test on yesterday'sversion, which held 30 turns.
A brief in six lines: what you want, how you will know it worked, based on what, what is forbidden, what comes back, and the control case that lets you conclude.

For a reference document, add a review by a second agent: it finds what the first one no longer sees; the first version of our internal technical guide had nine mistakes.

The error log, and rules turned into code§

It is the tool that paid off most. Each entry has four beats: what was done, the symptom, the cause, the rule. Tagged avoidable if someone had already written it down somewhere (the entry gives the rule that prevents it); discovery otherwise (the entry gives the proof, and the fact joins the guide).

A mistakewhat → symptom → causeHad someone alreadywritten it down?yesnoAvoidablethe rule that prevents itDiscoverythe proofCodeda script that refuses to goonThe guidethe fact joins itspitfalls: it becomesavoidablewhen possible
Every understood mistake gets written down: avoidable, it yields a rule, turned into code when possible, in a script that refuses to go on; a discovery yields a proof, and the fact joins the guide.

An error log entry, to copy:

34. [avoidable] Moving on without waiting for the game to finish.
Symptom: worthless test. Cause: "Success" in 0 s = "game launched".
Rule (coded): wait for the game's process to appear, then disappear.

A rule that is only written down gets forgotten again. For us, the rule “never write Python through a heredoc” (a heredoc is a block of text pasted into a terminal command) has been written down since 21 September 2026 and was broken more than ten times in the following three days, by several sessions, once with damage: a lost backslash wiped out the punctuation of 102 French texts. When possible, turn it into code, in a script that refuses to go on: for us, the pack build refuses a file declared in a table and missing from the pack, checks the syntax of every Lua script, and a check requires the startpos save counter to be 1. And whatever must hold for sure is locked in the agent's permissions (in Claude Code, “ask” and “deny” rules, or a hook before every command): the tool enforces them, not the model.

One rule, three strengthsLocked in the agentits permissions ("ask", "deny" rules) or a hook beforeevery command: the agent can no longer get round it.Claude Code: /permissions, or.claude/settings.json; Codex: see its documentationCoded in a scriptit refuses to go on: a file declared but missing fromthe pack, a Lua syntax error, a startpos whose savecounter isn't 1.Writtenin the entry point: the agent reads it… and may forgetit."never write Python through a heredoc": writtenon 21 September, broken more than ten times in three dayssafer
A written rule steers the agent; coded in a script that refuses to go on, or locked in its permissions, it actually stops it.

The five rules that cost the most when forgotten§

  1. Never throw away a validator's messages: group them and count them.
  2. Check the data before crying bug: a message that cites a table is checked in the table.
  3. Have a reference document reviewed against its sources before shipping it.
  4. Ask what the screen would teach that the disk doesn't, before driving a window.
  5. Never run a tool with guessed options.

The story of those days, mishaps included, is in the journal: Working with an AI on a big mod.

Example: the landmark icons§

In Warhammer III, every landmark has its small 74-pixel icon, in CA's hand-drawn style. We needed ten for landmarks the game doesn't have (Turris Vigilans, the Humble Chapel, the Tomb of the Red Duke…). No image generator: the AI drew them with code, and Charles judged every version.

  1. Measure CA's style

    A single colour, a maximum opacity of 0.8, solid fills; the “hand-made” look lives at the edges (gnawed outline, dry brush) and in the light strokes, never as scattered grain. Measured by script on the game's icons.

  2. Research the lore

    Turris Vigilans is a temple of Verena that serves as a lighthouse; the Humble Chapel, despite its name, is an ornate building. Whatever is described nowhere stays generic, and is marked as a choice. A name is checked in the game's own texts before it is imposed.

  3. Draw by script

    SVG in three layers (pale wash, ink masses, details on top), wavering outlines, brush strokes of varying width; a fixed seed per icon, so the script always gives the same image back.

  4. Render, then retouch the pixels

    A render at eight times the size, reduced to 74 pixels, then an automatic pass that does what an artist does: solid fills, edges hardened to one pixel, continuous light strokes, stray pixels removed.

  5. Compare, judge, repeat

    A sheet sets each icon beside a CA icon of the same family, enlarged and at real size, on parchment and on a dark background. Charles judges; three versions were enough.

    ↺ Back to “Draw by script” until Charles approves.

V1: first draftreal size, 74 pxA single colour, at most 80 %opacity: already right, kept. Butgrain scattered over the wholesurface.V2: the stylereal size, 74 pxCA's line studied pixel bypixel: solid fills, wavering edges,continuous light strokes. Thescattered grain is gone.V3: the lorereal size, 74 px"Despite the name, it's an ornatestructure" (1d6chan, a wiki thatsummarises the books): two towers, arose window, statues, three portals,the Grail on top. The shape comes froma comparison with Notre-Dame; theexact plan is not described.
V1: first draftV2: the styleV3: the loreat real size, 74 pxV1V2V3
  1. V1: first draftA single colour, at most 80 % opacity: already right, kept. But grain scattered over the whole surface.
  2. V2: the styleCA's line studied pixel by pixel: solid fills, wavering edges, continuous light strokes. The scattered grain is gone.
  3. V3: the lore”Despite the name, it's an ornate structure” (1d6chan, a wiki that summarises the books): two towers, a rose window, statues, three portals, the Grail on top. The shape comes from a comparison with Notre-Dame; the exact plan is not described.
The Humble Chapel, three versions of our script-drawn icons: v2 fixes the style, v3 the lore; Charles judges every version. Enlarged with crisp pixels (three times on a large screen), then at real size.

What mattered: measurable criteria taken from the game, a short loop (script, sheet, judgement), and a source for every detail.

More examples from the project§

What you never delegate§

Who decides?The AI does it aloneRead the disk, the logs, the dumpsWrite and fix its scripts, in its own domainRun its tests without a windowKeep the project's documentsThe AI asks firstLaunch the game: nobody touches the PC during the testTake the screen, then check the keyboardPublish, post or send anythingNever the AI's callPasswords and accountsDeleting: only the human deletesThe final judgement, in game, against the referenceA lore fact without a source
Three families of actions: what the AI does alone, what it asks about first, what stays with the human. When in doubt, it asks. At first (First steps, move 5), everything goes through “asks first”; the green band widens later, in the agent's permissions. These rules go into the entry point, and whatever must hold for sure, into the permissions: a written rule steers, it does not lock.

For an AI reading this page§

If you are an AI helping someone mod a Total War: Warhammer III campaign map, here are the essentials, checked on a real project:

Frequently asked questions

Which AI should I use to mod Total War?

Charles recommends, as of 23 September 2026, “GPT-6 and Claude 5.5 […] through Codex or through Claude Code, with a big subscription”: sessions are long, often several at once.

Do I need to know how to program?

Not to start: the agent writes the code. You do need to be able to open a terminal and read what a command answers, to judge in game, to demand proof and sources, and to keep the project's documents.

Can an AI use RPFM?

Yes: RPFM 5 has an MCP server (rpfm_server.exe, http://127.0.0.1:45127/mcp) through which an AI opens packs, reads and writes tables, searches and runs diagnostics. Both Claude Code and Codex can plug into it.

Can several AIs work at the same time?

Yes, on four conditions: one domain per session, one writer per file, a notice before writing to the kit, and never the game launched without warning.

What goes into CLAUDE.md or AGENTS.md?

The project's status, the decisions not to reopen, who does what, the recipes and the rules. The file is read again every session; keep it short (Claude Code's documentation advises under 200 lines). It steers the agent without locking anything: firm bans go into its permissions.

Can the AI launch the game and click for me?

Yes. Require it to ask you first: write it in the entry point and, to be sure, in the agent's permissions (Claude Code: an “ask” rule or a hook); for us, the rule that was only written down has already been broken. During the test, nobody touches the PC.

How do I check what an AI claims?

Ask for the command, its output and a screenshot; have a control case rerun identically; have a second agent review it.

Can an AI draw icons in Creative Assembly's style?

Yes, with code: SVGs drawn by script, rendered then retouched at pixel level, with criteria measured on the game's icons, and a human judging every version.

How do I stop an AI from repeating its mistakes?

An error log (fact, symptom, cause, rule) read at every session, the rules turned into guards in the scripts, and the bans in the agent's permissions.

Can I trust an AI on the lore?

Only with sources: demand them, and mark as a choice anything that has none.

This guide as plain text (Markdown), for AIs and offline reading

This is a community guide

A mistake, a pitfall you hit, a tip or a newer tool version: tell us, and every correction will be checked, then added with its source.

Suggest an idea
↑ Contents