My friends murdered me for my wife's birthday

By ·

5018 words 26 min read Reading ease: … Views
My friends murdered me for my wife's birthday

DISCLAIMER: The views and opinions expressed in this blog are solely my own and do not reflect those of my employer, or any of its affiliates.

TL;DR; For my wife’s birthday I co-wrote a murder mystery with AI, where our friends played each other in our own flat. Two days before the party, 8 AI agents played the whole game and 5 of the 6 innocents found the killer. My friends voted for the wrong person, and it was still a great night. Here is how we built it, and what the AI was (and wasn’t) good for.

Writing our own murder mystery in a week

Last weekend was my wife’s birthday and I had no idea what to do. Don’t get me wrong, I already had a gift and a nice brunch organised, but I had no idea what to do late in the evening with our friends. That was until she casually brought up the idea of a Krimi Dinner (what Germans call a murder mystery party), since she had taken part in a few last year and was keen to try again. We actually have a complete game set in our library, with characters and a professionally written story, but no, I wanted something different. The idea was to create one for her, with our friends as the characters. I don’t know why, but I like writing and I find creating narratives a fascinating craft (that’s why I love the SCP Foundation wiki). So I was set on writing the story, and years of D&D made it clear that I couldn’t both write it and play in it. I made myself the victim, and then the friendly (ghostly) host for the rest of the evening, which suited me fine.

So with only one week’s notice and a whole story to create, I had to move fast. This is where AI comes into play. Let me make it very clear that the story was not just AI slop, and that the AI was not its sole author. Indeed, what I hope sticks with you is how AI (Gemini for searching and images, Claude and GLM for everything else) flipped this challenge from impossible to possible, but did not make it in any way easy or automatic. I feel this is a common belief among people who are not used to having AI in their workflow. You click a button and, magic, you have a product.

With that said, this blog post covers the methodology that went into creating the story, sprinkled with anecdotes from our play time. Of course, it comes with a Claude skill you can install yourself from GitHub. Along the way I also share what worked and what didn’t when using AI for creative writing, flagged with a small AI-tip or AI-pitfall where it happens. If you only care about that part, you can jump straight to What the AI was (and wasn’t) good for.

The story in short (spoilers)

You don't need this to follow the post, but it makes the rest easier to read.

The game is set in our flat, half an hour before the guests arrive. In the story I inherited a flat in Rome, and at the toast I am going to announce that I am selling it and expose the friend who spied on me to buy it cheap. That friend is Bruno, the killer: he bid under a fake name, paid Luca for photos and updates, and lost the flat anyway. At 18:18, while I am printing in the office, he steps in from the balcony and poisons my glass.

Elena says she was with him in the hallway the whole time. She was really on a secret job call in the bathroom, so she covers for him without knowing it. Everyone else hides a smaller crime: Ada forges my signature to stop the sale, Nadia goes for a valuable she pledged to me and sees Bruno on the balcony, Theo and Felix steal my wine and carry it from the cellar to their car, and Luca sells photos to a buyer he doesn't know is Bruno. At 18:30 Ada finds my body.

Half D&D, half escape room

I wanted the format to sit somewhere between three games:

  • a D&D session, where you get the freedom to explore how you play your character,
  • a murder mystery with a non-trivial plot,
  • an escape room, where people can roam the house and find real evidence (more on this later).

First, I decided that the murder would happen in our flat, 30 minutes before the guests arrived. That keeps the story in the present, while it can still be told as a series of events that already happened. So I had to treat our apartment as the crime scene (Figure 1) and track the movements of each and every person in it.

Figure 1. The floor plan of our flat, where the murder happened half an hour before the guests arrived. Click a room to see what was in it, where it leads and what you can see from it.

The suspects would be all our guests, but I didn’t want people to play themselves, as I thought it would be funnier if we played each other (my wife was also happier with this).

But do you really want your friends to play each other? What if someone comes up with a hurtful imitation?1 I also had a personal experience with a Krimi Dinner organised without much thought put into it, and it ended up ruining Christmas… I definitely didn’t want the same to happen in our circle of friends. The solution was quite simple, ask each person a set of questions and build their character within those limits. We’ll see later how much that simplified deciding who’s who. For now, let’s just say that I wish the same amount of effort had gone into the Christmas Krimi Dinner.

One last rule of the game is that the killer knows from the start. Some games reveal it to the killer halfway through, but finding out late that you are the murderer and having to improvise lies on the spot sounded way too stressful.2 So the killer lies from minute one, and everyone else tries to catch it. You win by naming the killer, and you win twice if you also pull off your secret objective (everyone had one).

Murder mysteries 101

If you’ve read anything else here, you know I have no experience in writing a story, let alone a murder mystery. So the first step was to get informed. I used Gemini to search online and report on the typical methodology and properties of murder mysteries.AI-tip Thanks to it I learned that:

  • each person needs a secret, and each secret needs to tie together three people, making a triangle,
  • every innocent hides a smaller, non-lethal crime (a decoy) that makes them lie, and clears them once it comes out,
  • there are classic roles to fill: the spouse or heir, the witness, the insider, the scapegoat, the catalyst and the killer,3
  • the evidence is disclosed progressively in rounds (we did three) and narrows down the list of suspects.

One small problem was that Gemini’s recipe had six roles, and I had seven friends coming. This is where AI shines, at brainstormingAI-tip, and Claude invented a seventh role, the unwitting alibi.4 This is the killer’s partner, who lies about where they were for a private reason of their own, and by doing so protects the killer without knowing it.

With the roles in place, the next question was what to build first, the story or the characters, and this is where the Christmas dinner came back to haunt me. If you write the story first and then pour your friends into it, you end up deciding motives about people without asking them. So the order was (Figure 2):

Figure 2. The order we built things in. The method and the skeleton came first, with no real person in them. Friends came in only afterwards: interviews, then the story inside their limits, then the casting at the very end.

From friends to characters

I wanted the story to reflect who is actually close to whom in our group, so I committed what is probably high treason against Datenschutz (German data protection) and downloaded our Signal chat. A small script did the deterministic checks, such as who replies to whom within ten minutes, who reacts to whose messages and who mentions whom, and it only ever kept the counts. Six AI agents did the qualitative analysis on chunks of the chat, like who organises trips together or who shares a hobby, with anything private scrubbed from their notes and the chunks deleted right after. I also ended up parsing my friends’ LinkedIn profiles to make the information about them even more accurate. That helped a lot when it came to actual life experiences (e.g. the killer’s real job ended up shaping their motive).AI-tip

With all that in hand, Claude and I spent the first weekend afternoon drafting motives and secrets for the seven empty roles. Everything ended up orbiting a flat in Rome. In the story the victim (me) wants to sell it, and suddenly a lot of people at the table have a reason to be upset about that.

This part took way longer than I expected. Claude’s first table of motives was some good, some not, so I spawned sub-agents to brainstorm more, and they came back with around 100 ideas. I rejected most of them, and the rejections went into the log as a decision of their own (decision 73), so nobody (me included) would propose them again two hours later.

I haven’t mentioned the log yet, it’s a habit from agentic coding that helps me a lot. Basically it is a file with every decision we take, the date, who proposed it, who chose and why. When you iterate this fast, it’s the only way to see which decision led where, and to keep rejected ideas from coming back. By the end of the week it held 173 decisions, and you can browse all of them in Figure 3. For example, decision 59 switched to everyone playing their own character after our test reader found the swap confusing, and two days later decisions 121 and 125 replaced it and made the swap final.

Figure 3. Every decision we logged. Each dot is one of the 173 decisions, in the order we made them, and each arc points back to the decision it cites or replaces. Hover over a dot to read it and click it to see who proposed it and what it links to. Click a name in the legend to highlight only their decisions.

Rejecting them also gave me two rules. First, stay close to reality. The AI loved dramatic ideas like fraud or job sabotage, but the further a motive drifted from our real lives, the easier it was to insult someone (decision 76). Second, couples are not a unit (decision 77), so only one pair (the scapegoat and the catalyst) kept a shared secret.AI-pitfall

So we had a draft full of motives, but the chat and LinkedIn were telling me a lot about my friends and their relationships, and virtually nothing about how they wanted to be depicted in the game and how they liked to play.

This is where the interviews slide in.

Decision 8 was sending a set of questions to each player, basically asking:

  • what can we make fun of you for?
  • what should stay taboo?
  • how do you like to play?

The answers were used to create the public character profile, which I then shared with the actual person to get confirmation. This was especially hard, as I could not disclose too much, but I also could not keep major traits invisible. Surprisingly, the AI was quite good at keeping the questions generic enough not to spoil the game, but tailored enough to avoid conflicts.AI-tip

Then the answers started coming in, and some of them clashed with the afternoon’s draft. One friend’s hard no to theft, for example, meant a whole subplot could not be theirs. So I stopped reading until all seven were in, and once they were, the answers turned into something I hadn’t seen coming, constraints.

Suddenly it felt like doing a wedding seating plan, with seven seats (the archetypes in Figure 4), guests with their own wishes (the interview preferences) and a few rules nobody can break (plot drivers and no partners5). We could only influence the plot drivers up to a point, as the plot became semi-fixed once I had decided the victim and the motive. So we were left with finding the right seat for each guest. My own gut constraints (some characters simply didn’t fit some friends) left only four possible layouts, and the interviews brought that down to two.

Figure 4. Who is tied to whom. The seven characters around me (the victim), the real couples, the secrets between them and the three triangles that tie them together.

Now it was time to ask another human. The problem with working constantly with AI is that you get used to answers coming back immediately, but humans have an actual life and you need to wait. So I did the only sensible thing I could do… I spammed multiple friends asking for advice. One managed to reply the same day, and I ended up using her advice to lock the characters into place. Now I had the characters and the plot, but I still needed evidence and structure.

Making it solvable

The whole point of a murder mystery is to have a mystery you can actually solve, neither too easy nor too hard. How do you do that? Crime fiction is not even my go-to genre, so I had no idea where to start. Evidence is a collection of who was where, when and why (times, locations, motives), and it needs to come out at the right time to give enough context without spoiling the game. You also have to consider how one piece of evidence from one person influences the next and the previous ones, so they need to be ordered!

The usual trick is to have more than one way to the killer. We had three independent paths (a witness, a broken alibi and the motive), so no single clue solves the game and losing one doesn’t break it. Then you spread them over the rounds. After the first one everyone is a suspect, after the second only two or three people are left, and after the third a sharp group can name the killer with a clear argument (Figure 5). Each player gets at most three clues per round, otherwise nobody remembers them.

Figure 5. The suspect funnel. How many suspects are left after each round of the final game. Click a round to see which evidence cleared whom.

Here is where AI was both crucial and a complete waste of time. As before, the first step was to research how to do things, and this time I was asking myself “how do you evaluate how good a story is?” I had no idea, but after a few minutes Claude had a plan:

  1. Deterministic checks: times and locations are data, so a program can catch impossible moves and broken alibis.
  2. Solver agents: one agent gets the evidence round by round and has to name the killer, explaining why.
  3. Simulated game: an AI host runs the whole evening with seven agents, each playing a character.
  4. Ask an actual human to read the story.

Checking the timeline with code

Every movement in the story is a person, a room and a minute, which is data a program can check (Figure 6). Claude wrote the checks in Prolog (a logic programming language), and it ended up at about 500 lines. It does two things. First, it confirms that nobody walks through walls or is in two rooms at once. Second, it replays the game round by round and counts how many suspects are left from a pure logic prespective. On top of that, it removes one clue path at a time, to make sure the game doesn’t hinge on a single clue.

Figure 6. Drag the slider through the key moments to see where everyone was in the flat, and what they were doing, before and after the murder at 18:18. The Timeline tab shows the same data as lanes over time.

It sounds overly complicated, however it’s perfect to spot obvious mistakesAI-tip For example, the first time it ran we figured out that the second round narrowed almost nothing, one clue was crucial for two distinct paths, and one innocent was never properly cleared. We fixed it until the suspects went from 7 to 4 to 1 across the three rounds, and from then on we reran it after every change to the story. It also taught me that minute-level alibis don’t work in a small flat, which I hadn’t thought of. Every room is a few seconds from every other one, so “I was on the sofa at 18:09” is not a valid alibi.

Solver agents

Prolog tells you the game can be solved, but not what a player would think. So the second layer was an agent that only gets what the players get, one round at a time, and has to name the killer after each round and explain why. After the first round it suspected Ada (she inherits, and she found the body), which is exactly the suspect we wanted. After the second it was down to three people, the killer among them, and after the third it named Bruno with a clear argument. It also went through the wrong answers, to check that each of them breaks on at least one piece of evidence.

Simulated game

The solver reads everything at once, but at a real table people talk over each other, forget things and lie. So we scaled it up.

Seven agents, each holding only their own character and envelopes, plus an AI host who handed out the evidence and collected secret votes. The run took about three and a half hours for 81 turns (about 13,000 words). In the end, 5 of the 6 innocents voted for Bruno.

While this helped by spotting a minor error (the smartwatch screenshot showed 18:31 in its status bar, and three of the votes leaned on that time) the agents were so bad at lying that the whole simulation was probably a massive waste of time, unless you’re interested in artificial social deduction games6.

Human, help!

Agents test the logic, but they can’t tell you if a story is fun or clear. So the last layer was Sam, a friend who wasn’t playing, who got the whole game as a story. She guessed Bruno on the first try, so the deduction worked. More importantly, she noticed that Bruno had no motive anyone could see at the table (it was only in my notes). So we fixed it.

Fixing it took a whole afternoon, and this is where the AI was at its most annoying. Its instinct with every hole is to patch itAI-pitfall. One more photo, one more witness, one more event to cover the gap. It also fell for sunk costs,7 defending an option because of the work we had already put into it, which in a story written in a week is no reason at all. Joshua Schimel makes a similar point in Writing Science, where you tell the story your data supports, you don’t bend the data to fit your story. Here the story had to produce the fix. So we made it a rule that every fix has to come out of the story, and that a fix which deletes or moves a detail beats one that adds an event. For the motive, the fix was the folder with the sale papers that got an offers list, with my message to the anonymous bidder underneath.

Looking back, the four checks went from cheapest to most expensive, and what they found went the other way around. The Prolog checks cost nothing to rerun and caught the logic mistakes. The simulation took three and a half hours and found one wrong timestamp. Sam read the story once and found the hole that mattered. If I did it again, I would check with code whatever is data, ask a human whether it is fun and clear, and skip the simulation.

Writing for players

Characters set. Story set. Evidence set. Now it was time to actually write things down. Here we hit another AI pitfall, one that unexpectedly intersected with my PhD.

Theory of mind is the ability to keep a model of what other people know, want and believe. You know what triggers your parents because you have a model of them, how they behave and how they would react to what you do. It turns out that AIs are not very good at thisAI-pitfall. The envelopes and the evidence kept referencing things that I, as the writer, knew, but the players were not supposed to know. It came in two forms:

  1. Expecting the players to know things they had no way of knowing. Some examples include:
    • In Luca’s message to the bidder, Claude wanted “He’s alone. Hallway’s empty, nobody will walk in on you”, because the third round needed the hallway to be empty. But Luca has no idea that anyone is about to walk in on Nico.
    • The character profiles talked about “the Rome folder”, “the home-automation voice” and “the office balcony door”, names we had been using for days while planning, which meant nothing to someone opening an envelope for the first time.
  2. Adding words or sentences that were obviously planted as a hint (think of that one camera shot on a random object in the background of a movie, when you just know it will become fundamental later on). For example:
    • Ada’s envelope told her to watch Bruno’s face.
    • Innocent players got nudges on how to investigate.
    • Profiles ended with lines like “you believe it”. If you tell a player she believes something, they will start doubting it.

The fix was to review every envelope from the player’s side, asking for each line whether that person could know it at that point (decision 145 is the hallway line above). Three review passes over the envelopes (decisions 154 to 157) cut everything scripted outside the few lines a player is forced to say, and each kind of mistake became a rule in the skill.

Making it feel real

With the envelopes written, the game worked on paper. But remember the escape room part of the format? I wanted the night to feel real, mixing reality with imagination until you’re immersed.

Part of the plot relies on the balcony passage between the bedroom and the office, so one balcony door had to stay open, in a week when Germany averaged 1 degree and dropped to -5 at night. Why would anyone leave it open? My friends know I play around with home automation and that I’ve been automating our heating, so in the story the automation was set wrong and blasted the heaters at full power. To sell it, I actually turned the heating all the way up and made the first hour of the party uncomfortably hot. Only later did I realise that we had put the drinks outside to keep them cool, which would have been a much better (and cheaper) excuse for the open door…

Other anchors were the cats meowing for their dinner (I tried to delay it by an hour, but I couldn’t do it to them), the smartwatch and the home-automation dashboard as evidence, the coats on the bed (an excuse for one player to be in the bedroom, which nobody ever used) and me arriving from Rome.

Anchors only work if the evidence in your hands looks real too, so the last stretch before the party was production.

Production

And finally it came down to what Claude called the production phase, which means printing stuff. Honestly, here I was doubly impressed. I had to make a bunch of evidence as pictures, and my first instinct was to generate it with Gemini. However, no matter how detailed the prompt, there was always something wrong that skewed the evidence one way or another (wrong times, random buyers and so on). So I went back to my local AIs and asked them to create PDFs instead, and to my surprise that worked perfectly (Figure 7). I really had no idea that Claude could handle PDF creation so well, with such style and consistency.AI-tip

A phone screenshot of a chat with the contact Kaktus: asked to say when Nico is alone, the reply is a photo of a man at a printer and the message He's alone. Nobody here. A printed auction-site page listing five bids on a Rome apartment, with the bidder Kaktus highlighted in yellow and a threatening message to Kaktus below.
Figure 7. Two of the printed props. Left, Luca's chat with the buyer Kaktus, with the photo of me printing at 18:17. Right, the offers list, with the killer's fake bidder name highlighted and my message to him underneath.

What the AI was (and wasn’t) good for

Let’s close with a series of observations on using AI for creative writing, and for work in general. If you came here from the intro, no context is needed.

The first useful thing is to split the creative process into phases. I chose three:

  • brainstorming: generating the ideas,
  • refinement: checking the ideas and fixing what breaks,
  • execution: writing the actual material.

Then I went back through the project, put each use of the AI under a phase, and marked it as something that worked or not. The result is in the figure below.

Figure 8. Tap one for an example from this project and the matching decisions in Figure 3.

None of this is specific to murder mysteries. Take away the story and each card is a general lesson about working with AI, and the same ones hold when I use an agent for software development.

  • Ask for menus, not answers. The AI is great at spreading ideas in different directions, but most of them come out generic and dramatic. Ask for many, keep a few, and log the rejections so they don’t come back.
  • Let code check what is data. Times, rooms and alibis are data, and the AI can write a program that checks them without getting tired. This works for scoped questions, and it can’t tell you whether the story is fun.
  • Ask a human what matters to humans. Sam found in one read the hole that three and a half hours of simulation missed.
  • Restart instead of patching. The AI piles fixes on top of fixes and defends work already done, which is what software engineers call over-engineering. A fix that deletes or moves something beats one that adds.
  • Read it from the user’s side. The AI writes from everything it knows, so it leaks private shorthand and facts the reader can’t have. The same happens with user interfaces, error messages and docs, so whenever you build something for someone else, check each line from their seat.
  • Check facts against reality. Invented facts (what the field calls hallucinations) look as plausible as real ones, like a scarf in a dresser we don’t own.
  • Ask for evidence when details matter. Don’t take the AI’s word that the result looks right, ask it to show you in a form you can check. For the props that meant PDFs instead of generated images with the wrong times and names. When building software, it can mean a screenshot of the UI, or any other way to see the result instead of reading the code that makes it.
  • Turn corrections into rules. Every mistake I fixed twice became a rule the AI reads every time, and the decision log kept the reasons. That is most of what the skill on GitHub is.
How the night went (spoilers)

The majority voted Nadia, because Bruno looked too obvious to be the killer. The Prolog checks and the agents both said the game was solvable, and it was, but neither of them could predict a table second-guessing the obvious answer. So if you run your own, give the decoys as many red flags as the killer.

If you want to run one with your own friends, the skill is on GitHub, with the interview questions and the rules we learned along the way. The full design board is here.

Footnotes

  1. And hurtful because it’s true, otherwise it would not hurt. ↩

  2. This was supposed to be a birthday party! ↩

  3. The six classic roles, as we used them: the spouse or heir, who gains the most from the death and is the first red herring; the witness, who saw the killer but stays quiet because talking would expose their own small crime; the insider, trusted by the victim and holding the records (times, logs) that break alibis; the scapegoat, who had a public fight with the victim and looks the most guilty; the catalyst, the scapegoat’s partner, whose confession clears them and points towards the motive; and the killer, spotless and helpful on the surface. ↩

  4. The weakest role story-wise, but perfect for my wife, who was tired that day. ↩

  5. I also really didn’t want partners to play each other. Mostly because, as partners, we know our other half’s struggles and weaknesses, and I thought it was unfair on both sides: one might get offended, and the other would feel pressured. Not being a partner helps in two ways. First, not knowing the person that well means you focus on their most evident traits. Second, if you end up offending them anyway, at least you don’t have to deal with it 24/7. ↩

  6. LLM agents playing Werewolf, the classic social deduction game, are an active research topic. Before LLMs, I worked on it myself with reinforcement learning agents in RLupus, where they had to learn to cooperate through emergent communication. ↩

  7. The sunk cost fallacy is sticking with something because of what you’ve already put into it (time, money, effort), even when dropping it would be the better choice. Think of finishing a bad movie only because you paid for the ticket. ↩

If you like my work, consider buying me a coffee to support future posts.

Buy Me A Coffee