The Butler Did It

So someone pointed me at an entry to the recent Ludum Dare entry, The Butler Did It by Surrealix. Butler is another interpretation of the “randomised murder mystery” genre, like my own Nicholas Spratt project which I’ve been poking at on and off for the better part of a month, now. While I was unable to get Butler to run on my computer (the Windows port crashes at startup for me), I did take a quick glance at the source code to see roughly what it’s doing, and how it compares to Spratt.

For those who haven’t heard of it before, Ludum Dare is a 48 hour programming competition which
takes place twice a year, where the theme is announced at the start and then you have 48 hours to complete a game based upon that theme. It’s a bit like my “Game in a Week” thing, only even more compressed.

The thing that impresses me most about The Butler Did It is how much went into the game (developed in under 48 hours) that I had to cut from my Game-in-a-Week-edition of Nicholas Spratt due to implementation time issues. For example, Butler has a randomly generated mansion layout, whereas that was the very first thing I decided not to do in Spratt. I have some serious issues with the particular algorithm that Butler uses for level generation, but it’s extremely impressive to see it working at all in a game which was developed under such a short time deadline.

In addition to that, Butler actually has its characters pathfinding and moving between rooms, so that travel time becomes another way to eliminate possible suspects. That is, if someone has an alibi that proves they were on one side of the mansion at time ‘x’, then you can be sure that they couldn’t have made it to the opposite side of the mansion at time ‘x+1’, simply due to travel time. In Spratt, this sort of deduction was the second thing I cut; I just made my time slices large enough that a character could reasonably be assumed to be able to get anywhere they wanted to go within the 15 minute period between ‘turns’.

Finally, the murder generation itself. Butler is using a very similar murder generation system to the one I wrote for Game-in-a-Week Spratt; it divides the timeline up into slices, and each guest is in a single room in each slice. It starts by randomly selecting a murderer and victim and places them into the timeline first, and then starts filling out what the rest of the guests see and do. But it has some very significant improvements over how I did this in Spratt.

Most notably, it takes steps to ensure that the necessary witnesses are present at appropriate times such that every mystery it generates is actually solvable along a single line of reasoning, whereas Spratt just provided several different ways that a mystery could potentially be solved, and quietly hoped that through random chance, enough witnesses would be around to provide evidence for at least one of those approaches to work (and thus, Spratt‘s mysteries were not always solvable). I should really take this extra step, to ensure that witnesses are present where they’re really needed, to ensure that cases are always solvable. Additionally, Butler intentionally and explicitly plants a third character; the “red herring”, as a second likely murder suspect.

In fact, I’d say that about the only major thing that Spratt does that Butler doesn’t do is track the movement of the murder weapon after the murder is committed. In Spratt, the murderer tries to find a place to hide the murder weapon, and in some cases, knowing where the murder weapon was eventually found and approximately when the murder occurred, you can really narrow down the list of people who could have had the murder weapon.

For the last few days, I’ve been struggling trying to figure out how to ramp up Spratt‘s timeline and murder generation system for a revision 2 release. I know that I’m not happy with the characters randomly bouncing between rooms the way that they do right now, but I’ve been trying to figure out how to fix it; whether I need to set up a timeline on a much smaller scale (say, a 5 minute increment instead of 15 minutes? Or maybe as little as 1-2 minutes?), or whether to stop using timeslices at all, and move to a more event-driven system. I know that I want characters to move through the mansion at a reasonable rate, but I don’t want the player to have to scroll through 72 data points per witness just to find out where they were during the evening (as would happen if I dropped to five minute increments). That just doesn’t sound like much fun.

It’s very interesting to see that Butler treats its hallways the same as rooms, and has a movement rule that a character can only move one room per timeslice. That makes an awful lot of sense for the way its mansions are laid out, but not so much for the way I’m laying out mine; Butler has a lot of discrete, disconnected short hallways, whereas Spratt has just one long winding hallway that all the rooms adjoin. The more I think about it, the more I think that I’m going to need to make use of the underlying grid pattern, and set some speed with which characters can move. But that’s going to require a bit more thought. It’d be a full rewrite of my current generation algorithm, and so I probably don’t want to do it unless I’m certain.

Anyhow. I’m keeping my eyes on Butler, and am hoping that the author notices and fixes whatever my crash bug turns out to have been. I’d love to get a chance to actually play it! :)