
Codex, running GPT-6 Astra, created a playable Dune 2000 clone in HTML, CSS and JavaScript in 46 turns, or 11 h 16 min of agent working time. The game has generated sprites, 34 French voice announcements and 122 tests, at the cost of 54 messages and 12 screenshots to correct its mistakes. The session comes to about $196 at API rates, covered here by a ChatGPT subscription.
On Google, the AI-generated answer to the French query “créer un jeu avec l’IA” (make a game with AI) suggests having ChatGPT or Claude write a small HTML game. I wanted to see how a heavier project would turn out, a Dune 2000 clone handed to a coding agent for three days.
Dune 2000 is the real-time strategy game developed by Westwood Studios and released in 1998, a remake of Dune II. The agent is the Codex desktop app, with the GPT-6 Astra model set to xhigh reasoning effort. The figures below come from its session log, a 1.3 GB JSONL file, and from the project’s tests, rerun on 14 September 2026.
The final prototype runs below, in your browser. Its 51.6 MB only load when you click “Try it”.
Clone de Dune 2000 : le prototype de Codex et GPT-6 Astra
Le prototype tel que Codex l'a laissé le 9 septembre 2026 : une escarmouche Atréides contre Harkonnen, à la souris et au clavier. Rien ne se charge avant votre clic.
Protocol
Construit avec l'application Codex et le modèle gpt-6-astra en effort xhigh, du 6 au 9 septembre 2026 : 46 tours, 54 messages, 11 h 16 min de travail de l'agent. Compilé par Vite sans modifier le code du jeu, chemins des ressources rendus relatifs pour l'hébergement.

The project runs in an isolated sandbox (iframe sandbox and CSP): no access to the site, cookies or your session. Nothing loads before you click.
The starting prompt
The first message was 66 words long. Here it is, translated from French with the typos removed.
I want you to create a Dune 2000 clone in HTML CSS and JavaScript, drawing on the OpenRA project for help. You’re free to generate the sprites you want and need, including the animations that go with them. I want a playable prototype of a 1v1 match, Atreides against Harkonnen. The OpenRA project is in the /Projets/OpenRA-bleed folder.
OpenRA is an open-source engine for real-time strategy games, written in C#, that runs Dune 2000 and the early Command & Conquer games. Astra didn’t port its code. It drew on the rules of the d2k mod (costs, economy and prerequisite chains), then wrote a JavaScript simulation independent of the rendering, testable in Node and displayed with Phaser 3.90.
I gave no instructions on how to organise the work. On its own, Astra read the skills of the Game Studio plugin published by OpenAI (web-game-foundations, phaser-2d-game, sprite-pipeline, game-ui-frontend, game-playtest) and the imagegen skill, which generates images in Codex. These are SKILL.md files the agent loads before acting, on the principle detailed in our Agent Skills guide.
The session ran without a sandbox and without approval requests (danger-full-access, approvals set to never). Astra could launch Chrome, install npm packages and write anywhere on the disk, with none of the safeguards described in our article on what the Codex sandbox blocks.
Thirty-one minutes for a first match
The first turn lasted 31 min 30 s and made 25 tool calls. Astra generated sprites for the buildings, the harvester, the tanks and the infantry, then coded spice harvesting, power, production queues, combat and a Harkonnen AI that attacks in waves. Fog of war, the minimap, box selection and attack-move on the A key were there from that turn.
It finished with eleven simulation tests, Playwright-driven checks in Chrome and an automated match that wins on the “Découverte” (Discovery) difficulty. The turn cost the equivalent of $5.96 at API rates.
The match ran, but it didn’t look like Dune 2000 yet. My second message listed what was missing: animations, tank guns that swivel, more ground textures, Harkonnen-specific units and faster construction. In 32 minutes, Astra split hulls from turrets so they could aim through 360°, drew a black and red Harkonnen army with a quad and a twin-barrelled Devastator, and made each building go up in 4 to 6 seconds with foundations, scaffolding and a crane. The project then had 17 tests.
Forty-six turns over three days
A turn starts with my message and ends with Astra’s reply. In between, the agent chains commands, image generations, browser screenshots and tests on its own. I sent 54 messages, attached 12 screenshots, often annotated directly on the game page in the Codex browser, and interrupted 4 turns.
| Day | Turns | Agent working time | Main requests | Tests at end of day | Cost at API rates |
|---|---|---|---|---|---|
| 6 September | 20 | 5 h 01 min | animations, 157 terrain tiles, eight directions for the infantry, sandworms, cursors, first ElevenLabs sounds | 56 | $83.86 |
| 8 September | 23 | 5 h 51 min | original game interface, French voices, Carryall, six buildings and their units, textures, scenery, concrete slabs | 119 | $100.53 |
| 9 September | 3 | 24 min | single-cell slabs placed by dragging | 122 | $11.62 |
Astra added tests with every feature without my asking for a single one. The count went from 11 to 17, 24, 29, 33, 41, 44, 51, 56, 67, 69, 75, 85, 90, 106, 111, 119, then 122 on 9 September. Rerun on the 14th, the 122 Node tests pass in 2.1 seconds. The project also contains 24 browser scenarios, one per major feature, and 16 scripts that prepare the images and sounds.
Where Astra got it wrong
A fix that broke movement
On turn 12, I reported tanks whose sprites overlapped. Astra measured vehicles coming within 30 pixels of each other when their hulls are more than 60 wide, then gave each one a collision space matching its size. An assault by twelve Harkonnen vehicles, zoomed to 165%, validated the fix, and the 51 tests passed.
Five turns later, units spread out far too much and some refused to pass between two buildings that were easily far enough apart. Astra found two causes, one of them its own fix. The collisions covered the full diagonal of the sprites, and the navigation grid hid some passages. The repair took 24 min 54 s and 32 tool calls, with a 16-pixel grid, a ground footprint per vehicle and units that step aside to let others through. The turn 12 test measured hull overlap and nothing else, so it couldn’t see this regression.
What an interruption loses
On 8 September, a single message asked for different harvesters for each House, a Carryall that brings them back to the refinery, refineries that unload only one harvester at a time, and six buildings from the original game with their units. After six minutes, I interrupted that turn to send a screenshot of the original harvester. Astra redrew the harvester in eight orientations, and nothing else.
In the next message, I had to write “You didn’t do”, followed by the Carryall and the docks it had left out. Astra’s reply fits in one sentence: “You’re right, I finished the sprites without adding the logistics you asked for”. The same day, an annotation about small mountains reused as pebbles in the sand got lost the same way in an interrupted turn, and I pasted it again three turns later. The logistics took 35 minutes and 40 tool calls, and the project went up to 85 tests.
Images to redo
Several batches of images had to be redone. On turn 36, the icons for the six new buildings all looked alike and didn’t have the look of the windtrap drawn two days earlier. Redoing them one by one, while integrating the new units, took 47 min 54 s and 67 tool calls, for $16.16 at API rates, the most expensive turn of the session.
Astra also spotted flaws before I did. Its first eight-direction infantry sheets showed views that were too close to each other, and it redid them before integrating them. On turn 41, two texture generations, rock and scree, came back without an image, and it ran them again.
When Astra checked the original game
Several times, Astra went to read the Dune 2000 manual before applying a request. I wanted to know whether the original game paired a Carryall with each refinery. Astra said no, citing pages 16, 17 and 45 of the 1998 manual. Each refinery comes with a harvester, brought in by a Carryall, and transport Carryalls are built separately, at the High Tech Factory. I reread those pages, and they do say that.
On the evening of 8 September, I asked to be able to build on sand by laying concrete slabs. Astra first pointed out that the original game restricts construction to rock, where slabs protect buildings from wear, then applied my variant. A building placed on bare rock starts out damaged, a fully concreted site gives it all its hit points, and the starting construction yard sits on nine slabs. Sandworms go around this concrete, even when it’s laid on sand, and the next day I cut the slab down to one cell, placed by clicking or dragging for 5 credits a cell.
Sound effects and voices generated with ElevenLabs
The first sounds were synthesised in code. On turn 13, I asked to switch to ElevenLabs through a skill. Astra installed ElevenLabs’ official sound-effects skill and set up a .env.local file, excluded from Git, for the key. The first key was rejected (401 invalid_api_key). The second, valid for 24 hours, produced 20 effects with the eleven_text_to_sound_v2 model, converted to mono WAV by FFmpeg.
On 8 September came 34 voice announcements in French, from “Alerte! Notre base est attaquée” (Alert! Our base is under attack) to “Commandant, votre base est opérationnelle” (Commander, your base is operational). Since the French voice in the ElevenLabs library is reserved for paid plans, Astra picked a standard multilingual voice with eleven_multilingual_v2, then had Scribe v2 transcribe the 34 files to check every sentence. The announcements go through a priority queue, lower the music and appear as subtitles. Twelve vehicle sound effects followed on turn 39.
The music wasn’t generated. Command of the Scorched Plain is an MP3 file I supplied, played on a loop at its own volume. All sounds are served from the project, with no API calls during a match, and the key’s expiry has no effect on their playback.
Time, tokens and cost
Each model response leaves a token_usage_record line in the session log, stored under ~/.codex/sessions/. This command totals them without loading the whole log into memory:
jq -c 'select(.type == "token_usage_record") | .payload.usage' \
~/.codex/sessions/2026/09/06/rollout-2026-09-06T13-20-25-01a07672-bb68-7500-b23a-db1fc7ccbe3e.jsonl \
| jq -s '{reponses: length, entree: (map(.input_tokens) | add), cache: (map(.cached_input_tokens) | add), sortie: (map(.output_tokens) | add)}'{
"reponses": 856,
"entree": 120107006,
"cache": 116244736,
"sortie": 822700
}| Measurement | Dune 2000 clone |
|---|---|
| Period | from 6 September, 13:23, to 9 September, 11:26 (Paris time) |
| Agent working time | 11 h 16 min over 46 turns |
| Model responses | 856 |
| Tool calls | 800 |
| Context compactions | 15 |
| Input tokens | 120,107,006, of which 116,244,736 read from cache (96.8%) |
| Output tokens | 822,700, of which 264,688 reasoning |
| Cost at API rates | $196.00 |
The calculation follows the GPT-6 Astra price list published on OpenRouter and checked on 14 September 2026, at $10 per million input tokens, $1 for cache reads and $50 for output, below 272,000 tokens of context. The Codex window topped out at 258,400 tokens, so every request stays in that tier. That comes to $38.62 of uncached input, $116.24 of cache and $41.14 of output.
I didn’t pay per token. Codex ran on my ChatGPT subscription, which counts usage against a quota, and this amount serves as a reference point. Without the cache, the input tokens alone would have cost $1,201, nearly eight times the $154.87 counted. A cursor fix, on turn 4, took 1 min 24 s and $0.86. For GPT-6 Astra against Claude Fable 5.1 on a shorter exercise, see our three.js comparison.
What the folder contains
The final project has 41 source files (3,261 lines, 332 KB), 956 lines of tests and 2,172 lines of scripts. The public/ folder serves 227 PNG images, 57 WebP, 32 WAV files and 35 MP3s, and eleven JSON files keep the prompts behind the generated images. The prototype uses no files from Dune 2000, and its sprites, artwork and sounds were made for it.
It’s a single-player skirmish against the AI, with no campaign, no multiplayer and no saves. The OpenRA rules were adapted when I asked, as with concrete on sand or parallel production, where two factories halve a tank’s build time and three cut it to a third. The same agent then built an RPG in one evening with a completely different method, described in Make a game with ChatGPT: an EarthBound-style RPG.
What to remember
- Codex and GPT-6 Astra produced a playable real-time strategy game in 46 turns and 11 h 16 min of agent working time, with 54 messages from me to correct course.
- OpenRA supplied the starting rules, and the 1998 manual settled both the Carryall question and the concrete slab question.
- An interruption wipes the requests of the turn in progress. Twice, they had to be sent again.
- The tests went from 11 to 122 without my asking, and none of them saw the turn 17 movement regression coming.
- The cache decides the bill, with 96.8% of input tokens re-read at $1 per million instead of $10, for $196 in total at API rates.
Common errors
npm run test:pathfinding here, before approving.~/.codex/sessions/…/rollout-….jsonl log. Put it in .env.local, excluded from Git, and give the agent only the variable name.danger-full-access, with no approvals. Keep this setting for a throwaway folder, with no production keys within reach.

