What Inspired Me

I've always loved mystery and detective games. There's something uniquely satisfying about the moment a case clicks — when the contradictions line up, the motive becomes obvious, and you realise who did it before the story tells you. Games like Return of the Obra Dinn and Disco Elysium stuck with me not because of their graphics, but because of the feeling of piecing together a hidden truth from fragments.

The problem is that mystery games are finite. Once you know who the culprit is, the puzzle is gone. You can't un-read a solution.

That's what pushed me toward building The Detective. What if every case was genuinely new — not shuffled from a deck of pre-written scenarios, but invented from scratch each time? Large language models made that possible in a way that simply wasn't feasible a few years ago. This project was my attempt to combine the thing I loved about mystery games with the thing I found most fascinating about modern AI: the ability to generate coherent, structured fiction on demand.


How I Built It

The architecture is deliberately simple. A Python/Flask backend handles all the stateful logic and model calls; a vanilla HTML/CSS/JS frontend handles everything the player sees. No framework, no build step — just files you can read straight through.

Each new game triggers a single structured prompt to the setup model, which returns a complete case as JSON:

suspects → each with alibi, secret, personality, knowledge, and why_suspected
solution → culprit, motive, method
pre_story → narrative scene-setter

Built With

Share this project:

Updates