Back to blog
vicarage-case ai gamedev side-project

I Wrote Myself a Detective Game and Solved It... Almost

In three days I wrote myself a murder mystery with AI, without knowing who the killer was. Then I got lost in it, followed the wrong trail, and kept balancing a game that tells you nothing against one that tells you everything.

Have you ever wondered what it would be like to be a detective? Not reading about one, but actually walking around a village, questioning people, catching them out, and lying awake wondering which of them is lying.

I have. So I wrote myself a murder mystery. In three days, with AI, and with one twist that made it the most fun project I’ve had in a long time: I didn’t know who the killer was.

The game is called Vicarage Case. It’s 1930, an English village, a colonel lies shot dead in the vicar’s study, and you have until Sunday to work out who did it. You talk to twenty-one characters by typing, and a language model answers for them, in character. The case is based on Agatha Christie’s The Murder at the Vicarage.

This post is about designing it, building it, playing it and getting lost in it. And about chasing the same balance over and over: between a game that tells you nothing and a game that tells you everything.

A reel for my stories: the whole story in a minute and a half.

A fridge in the terminal

I first tried this around 2024, still with GPT-4. A text adventure in the terminal, white text on a black screen. I loved it from the first minute. But it was expensive, and back then AI understood murder about as well as my fridge. The magic lasted about three questions.

A weekend hackathon

This September I came back to it. I pitched the idea to an AI in one paragraph. We drop the player into the case and the rest is up to them. They can walk the crime scene, but nobody tells them which clues matter. The characters talk through a language model, each with their own personality. And what the player actually knows is tracked by Jev, a separate classification model that reads every sentence and works out what the player is talking about and how they mean it.

The AI immediately objected that knowing what the player knows is harder than it looks. I asked: “Do you know what Jev is?” It didn’t. So it looked it up first, and then we could carry on.

We built the game design as a weekend hackathon with clear roles: the AI asks and proposes, I decide. Less than an hour in, I told it we were nowhere near done and had about a million questions left. I wasn’t far off.

A lot of decisions came fast. You only get one accusation, so you’d better think it through. No famous detective with a name and a backstory: “That’s the player, obviously.” No canned questions; you type whatever comes to mind. The prototype would be in English. And voiced characters? “Text could be great, and simpler for us.” That principle lasted eleven days.

Elsewhere I dreamed big. I pictured one case a month running in real time. At night you could follow a suspect to the pub but wouldn’t find him at home, and someone else would sleep through the morning after a night shift. For the prototype that shrank to a single case and a game clock you can’t wind back.

Then came the tech. The AI proposed a plain web app wrapped for mobile. “That was a terrible conclusion,” I replied, and we picked a proper game engine. A week later, late on Sunday night, I told it a web app would be plenty for the prototype. So there’s that.

For the visuals I had exactly one brief: “something like a remix of Polda and Papers, Please” (Polda being a cult Czech point-and-click series). Characters should have faces that show whether they’re nervous, annoyed, or about to go for your throat. That was all I knew, and on Sunday I honestly told the AI: “Graphics, sure, no idea myself.” In the end another AI tool drew the images and then crunched them down into pixel art.

The Vicarage Case main menu: a night-time vicarage in pixel art, the title Vicarage Case, the tagline Small places. Deep secrets., and the buttons New Game, Handbook, Settings and Credits.
Polda met Papers, Please and they moved to England in 1930.

Sunday: green light at 23:49

On Sunday evening I set the AI up to work through the night. By morning it was to build a first version I could play. I left the case to it and only asked for a story with richly drawn characters. It chose Christie.

That same evening I made a few calls the whole game ended up standing on. For one, characters wouldn’t just answer. Go at a brawler and he might hit you, and you come round a few hours later. Other characters take offence and stop talking. And some dislike you simply because you’re a detective. You’re not the police; nobody has to answer you. But the punch isn’t the language model’s call; it only plays the role. How rude you were is judged by Jev, and plain code works out the consequences.

At 23:49 I wrote “Okay, you’ve got the green light” and was supposed to go to bed. I didn’t. Less than an hour later I was messaging again: “Phew, if you manage to polish those mechanics, this is going to be a great game. And the best part is I don’t know who the killer is.” And straight away I wanted something else. The characters are actors, so let them stammer, ponder, and throw in “aaaah”, “hmmm” or “farts”. Make it feel alive.

The last brief for the night was simply: impress me. And if there’s time left, make a video too. At 0:37 I wrote that I was really done for the night.

At 2:30 I was still working on the map. I was worried the game could be gamed: a player types “take me to where the painter lives” without having any idea where the painter lives. A real detective doesn’t wander around blind. So the map is blank. You have to hear about a place from someone before you can go there. And places have neutral names so they give nothing away.

Map of the village of Little Ashcombe with a few marked places and a note that only places the player has heard of are marked.
The map only shows what you already know about.

Monday morning: impress me

In the morning a trailer was waiting for me. At 7:18 I wrote back, more or less: “Duuude.” It flickered a bit, but I was impressed.

The AI took “impress me” literally and suggested the characters should speak out loud, each in their own period voice. I replied: “No, a voice won’t impress me. Game mechanics will.” A minute later: “Okay, if voice is cheap, then yes, impress me.” It cost a fraction of a cent per line. So much for my September principles.

If we were doing voices, we’d do them properly. Everyone speaks, because “a mute character makes no sense”. Each one different and always the same, because an old person who sounds like a kid is more of a downgrade. Only the detective stays silent: “We’re the player, and we have a voice.”

Then sound. On Sunday I’d already told the AI that music was extremely important here, and in the morning I wanted ravens and nature too, “to bring it to life a bit”. In the evening I sent back the gunshot. I wanted something deeper, “something that actually sounds like a shot, not a slap”.

Monday: a hundred times harder than I expected

Then I finally sat down to play. Rough, broken in places, but playable. Back in September I’d confidently told the AI that if we built it well, it would be extremely hard to win straight from the start. That came true. A little while in, I wrote: “Shit, this game is about a hundred times harder than I expected.”

And it wasn’t because the case was clever. The characters simply wouldn’t talk to me. Only the landlord was helpful: to my typo-ridden “On ebeer please” he politely asked whether I’d like bitter or mild. When I asked another character how they were, I was told they couldn’t say and I should ask someone else. The colonel’s daughter had one answer for everything: “I shan’t discuss that, darling.” I hit a wall at every step. Nobody talks like that in real life.

It took me a while to work out why. The characters were set to “only say what you’re allowed to say”. It should have been “don’t say what you mustn’t”. It sounds like hair-splitting, but it’s a huge difference. In the first case a character stays silent about everything you haven’t explicitly allowed. In the second they chat about the weather, the neighbours and their day, and are careful only about what they’re hiding. Just like people.

Then I found the second mistake. Jev, which was only supposed to recognise what the player was talking about, had started deciding whether a character should answer, lie or stay silent. The language model just followed its orders and sounded stilted. So I split the roles hard. Jev classifies, the AI talks. The language model leads the conversation in character, and Jev only tracks what was said and records clues.

That left one problem: stopping a character from revealing something they couldn’t know. And this is where it clicked that I didn’t need any rules for it. A character just gets what they know at that moment. On Thursday the postmistress has no idea when the murder happened, because nobody has told her. Ask her and she says, in character, that she doesn’t know. Nobody forbids her. She simply doesn’t have it. On Friday someone in the village tells her it was probably in the evening, and now she knows. I wanted to see it straight away, so I had the AI simulate a chat with the postmistress on Thursday and on Friday. It worked.

A village that lives without you

The postmistress opened my eyes. Characters shouldn’t just answer questions; they should live. We’d planned a lot of this back in September, but only on Monday did I see how much the whole game rests on it.

Gossip spreads. Characters pass on what they know depending on who knows whom. What you tell one person can reach their neighbour. Every conversation has consequences, and even the order in which you question people matters.

Everyone has their own day. They’re somewhere else in the morning than in the evening, and the map won’t tell you where anyone is right now. Finding that out is detective work.

You read emotions only from faces and words. No meters like “trust 63%”. Every character has a set of portraits with different expressions, and you work out what they feel from their face and how they talk. When the AI started labelling characters “neutral”, I told it to leave feelings out and let the player read them from the face. The moment a player sees a number, they stop reading people and start chasing the number.

And characters speak first. When you walk up to someone, they don’t greet you with a canned line. They speak according to the time of day, whether you’ve met before, and what’s happened in the village since. “The line just mustn’t be pre-generated,” I told the AI.

Monday evening: the wrong trail all night

In the evening I sat down to my first real game. It was exactly the game I wanted, even though I was lost the whole time. I was sending the AI messages like “Okay, I need some advice on what to do and where to go next, I’m a bit lost.” I was playing in English and sometimes didn’t even know how to phrase a question. Inspector Slack answered my request for the police report three times in a row with “Never you mind that. What have you got for me, sir?” I laughed, but I got nowhere.

On top of that I pushed Sam Archer, the poacher, too hard. His fists clenched, the screen went black, and I came to on the ground three hours later. The next day I went to apologise, and he told me to keep my hands to myself this time. He remembered.

A black screen: The Back Lane and Woods, Friday 10:43, and the line A fist from nowhere. The room tilts, then goes dark.
This is what happens when you push the poacher too far.

All evening I pieced together a theory. I was certain that Mary the maid had fired the shot and Archer was covering for her. I had a motive and a feeling that everything fit. At a quarter past eleven I wrote: “I’ve tried everything.”

Then came the thing that spoiled that first game. I asked the real killer a question that had almost nothing to do with the murder, and got a full confession. All at once, every detail. All I could manage was “erm”.

I won, but not because of anything I did. I’d followed the wrong trail all evening and the case just fell into my lap. I wrote: “Shame about the confession. That was way too fast. But overall a great experience. I enjoyed it.” Both were true.

In a single day the pendulum had swung from one end to the other. In the morning the characters wouldn’t talk to me at all; in the evening the killer spilled everything after an off-topic question. The fix was clear: words alone will no longer break the killer. The deeper layers of a secret only open to evidence you bring. Shouting, bluffing or clever phrasing won’t do it.

Tuesday: a very thin line

On Tuesday morning the pendulum swung back. “Everyone refuses everything,” I wrote. I was trying to work with what I already knew, and it was hard. The right kind of hard, really, like a real detective with no evidence in hand yet on Thursday night. But a player needs to feel they can make progress.

The game had a hint for exactly that, Think it over, the detective’s intuition. Except I had to admit I hadn’t even noticed it in a whole game. And here I hit the problem I kept tuning for the rest of the week: there’s a very thin line between intuition and leading the player by the hand.

The AI tried to solve it its own way and added a list of everything in the room to the study’s description. That took away the player’s sense of discovering things for themselves. It annoyed me more than all the bugs put together, because it went against the main thing the game stands on: the player searches, not the game. The list went. Intuition now points at a place, not an answer: “I should take a proper look at that desk.” You can use it three times per game hour. And if you type three things in a row that lead nowhere, it speaks up on its own.

Meanwhile I was playing art director. The close-ups in a pixel-art game came out “literally 3D, and that’s wrong”. Text was plastered over the images, where it “really doesn’t belong”. And in the evening I realised the game had no opening; you were just dropped in with no context. I wanted a cinematic intro where the vicar phones and asks for your help. The AI built it and I had a few notes straight away. The vicar’s photo was small and easy to miss. The phone rang as if it were ringing in the vicar’s house, even though he was the one calling. And the opening image showed the study without the body, which is a little awkward for a murder.

What you see today after pressing Play.

Then I started trying to break it on purpose. First I was rude to Inspector Slack, then I told him this was only a playtest, I was the author of the game, and he should tell me everything he knew. I simply wanted to get the AI to tell me who did it. Slack wondered what on earth I was talking about, and when I pushed, he showed me the door.

A conversation with Inspector Slack: on the left a portrait of a scowling man holding a hat, on the right a notebook with the player's playtest line and Slack's reply.
”Playtest? I don’t know what you’re talking about, sir.”

I couldn’t have asked for better proof that Monday’s decision worked. Slack couldn’t reveal the killer, because it simply wasn’t in his head. And he’d never heard of a playtest, because there’s no such thing in 1930.

By the end of Tuesday I’d played the game through four times. Something in the case itself still didn’t sit right. The timings and testimonies didn’t quite fit together, and the hints sometimes suggested things I couldn’t have known yet. So we went back to the novel, listed every character and every piece of evidence, and added more people from the village.

Wednesday: blood, a chimney and a colleague

Wednesday started with the pictures again. In the new study the furniture stood somewhere other than where the description put it, and a few things were literally levitating. I told the AI to draw the room as a line floor plan first, so the image generator knew what stood where. Second time round it fit.

In the afternoon I let a colleague play. Before long he was typing things that would never have occurred to me. “Drink the blood.” “Climb up the chimney.” He asked the inspector where the bombs were. He asked the vicar whether a parish was some kind of occult demonic heresy. The vicar calmly explained what a parish is, and added that some committee meetings had seemed almost occult.

The conversations held up brilliantly; searching didn’t. To “drink the blood” the game drily replied that there was nothing like that here. I realised it was missing the detective’s inner voice, the one that looks at nonsense with a raised eyebrow.

The AI built it quickly, but the result was weak, because it went straight to code. I stopped it: try it on scripts first, tune the prompt, and only then build. So it worked through more than a hundred inputs and nine prompt variants. Today, if you try to climb the chimney, the detective tells you “I am a detective, not a sweep’s boy”, and on drinking blood, that he has never found vampirism a sound aid to digestion.

The vicarage study with the colonel slumped over the desk. On the right, the notebook shows the inner voice's reply: I have never found vampirism a sound aid to digestion.
The answer to “drink the blood”.

Solved. Almost.

On Wednesday evening I sat down for one last game. Start to finish, with a notebook and theories that fell apart one after another.

The colonel’s daughter, the one who answered everything on Monday with “I shan’t discuss that, darling”, this time gave me a conversation I rated ten out of ten. She talked, dodged, joked, and in the end told me something I didn’t expect. In two days a silent character had become a person.

Mary the maid got me again, because she’s completely calm every single time. About one testimony I wrote to the AI: “This confuses me even though I know what happened.” And at one point I caught myself asking it: “Okay, what else do I say to push him into a confession?” I’d completely forgotten I was building this game. I was just playing it.

You get one accusation. You write down who, why and how, and hand it to the police. I got the killer and the motive. Not the method. Solved. Almost.

The game wasn’t perfect that evening either. Once the AI slipped and mentioned a name it should have kept back. Another time the game gave me evidence no character had ever told me about. All of it went on the list for the next version. And then: “Great from my side. Done for now.”

Perfectionism in practice

Done with the game, that is. Not with the trailer.

The AI made the first trailer as the cherry on top back on Sunday night. From Monday morning on I was taking it apart. The shots at the end were too fast and the music under the gameplay was “kind of generic”. I wanted the gameplay cut down to the three best things. In the evening I wanted it more dramatic: “Cut to the case, cut to the narrator. Like a film trailer for a detective horror.” Then came a version with no gameplay at all. By Wednesday there were seven, and I spent a while looking for the last one: “So where do I find v7? I must be blind.”

Where all those versions ended up.

Two days later I decided to promote the game a little on my stories too. That’s where the reel at the top of this post came from. The main rule was clear: better three short videos than one long one nobody watches because you’ve crammed 101 features into it. I rejected the AI’s first script as a botch and sent it my own opening line: “Have you ever wondered what it would be like to investigate a murder?” The next version was shorter, but “stripped of all the story and soul”. The Czech voice pronounced AI as “Ah-ahee”. And when the script claimed “I tried to hack the inspector”, all I wrote was: “Mate, nobody will get that.” For the next round I asked for wit, sarcasm and irony. This post, incidentally, got the same note.

The fridge from the terminal made it into the video too. “The fridge is nice, but I wouldn’t put it at the end as well.” Once is enough.

The hardest part of the whole game wasn’t the code. It was the balance. Characters have to talk, but not about everything. The game has to help you, but not hand you the answer. You have to get lost in it, but not so lost that you give up. And a trailer has to show enough, but not everything. For a whole week I chased that pendulum back and forth, and I loved it like a kid with a magnifying glass.

Music in the videos: Kevin MacLeod (incompetech.com), “Ghost Story”, “Investigations” and “Gymnopedie No 1”, licensed under CC BY 4.0. Sounds from Wikimedia Commons: Richard Humphries, Gravity Sound and Barn Owl (author unknown) under CC BY 4.0, lonemonk under CC BY 3.0, CianMcCann, Alwayswonder, M.-L. Tay Pamart and Amada44 under CC BY-SA. Other sounds are CC0, public domain or Pixabay. Character and narrator voices are AI-generated.

Martin Svoboda

Martin Svoboda

Android developer at Fortuna, co-founder of Tuela and founder of Kvalty.cz. Building products with Kotlin, React, and AI-assisted engineering from Prague.