← Back to the site

Sep 2026 · age 17 · browser game

Pixel Publisher

A publishing tycoon where you write a real short story, and a language model quietly plays the critic, the readers and the market.

Status
Shipped, playable on itch.io
Built in
~11 days, 39 commits
Size
One HTML file, no build step

Why I made it

I'd been following the discussion around GTA VI not using AI. The worry about AI replacing human artistry in games is completely valid, but it made me think about a different use: what if AI powered really smart NPCs and a world that reacts to anything the player does, in a completely free sandbox? I don't have the time or resources of a AAA studio, so I made the closest thing I could. That's Pixel Publisher.

The problem

In every writing or publishing game I played, the book you "write" is a number. You pick a genre, a slider moves, a score comes out. You never actually write anything, so nothing you make can surprise the game.

I wanted the opposite: you type a real story, in any language, and the world reacts to that story, its characters and its plot.

What I built

You start as a broke writer with $500 and a desk. Write a story, pay the printer, set a price and a marketing budget, hit Publish. A critic scores it, readers post about what actually happens in it, copies sell week by week, and rent is due every month. Hit $0 and you are bankrupt.

the AI gets opinions. the maths gets the money.

How it works

What went wrong / what I learned

One bad save froze the whole game. A book saved without a colour palette threw an error on every animation frame, which killed the render loop: the printing press turned into a black rectangle mid-publish. Fix: every part of the loop now runs inside a guard that logs and keeps going, and old saves get repaired on load.

Closing a window could lock Publish forever. Six dialogs returned promises that only their own buttons resolved. Pressing Escape left publish() waiting forever. Now closing any window settles its promise with the passive choice (decline, do nothing), because dismissing a window should never count as saying yes.

My checker lied to me once. A bad patch duplicated 2,400 lines after </html>, and my first syntax check only read up to the first </script>, so it said OK. It now asserts there is exactly one of each before checking anything else.

Built with an AI coding assistant as pair programmer; the design, the architecture and the testing are mine. The itch.io page is tagged as using AI-generated code, graphics, audio and text, because that's true.

lesson: "it passed" means nothing if the test can't fail

Stack

Links

You bring your own Gemini or OpenAI key (the free Gemini tier works), or pick the offline mock engine to try the loop without any AI. The source is private for now.

← majdlahbib.com