I’ve been experimenting with procedurally generated puzzles and developed this proof of concept for a basic logic puzzle. In “Den of Thieves,” you need to find a thief among three suspects through deductive reasoning. Each turn you either investigate to gather clues or accuse one of the suspects. Every game has a different set of suspects and clues.
The procedural generation works by creating three suspects with random properties, choosing a thief, and building a matrix of possible clues. Every turn you investigate, you uncover clues about the thief or one of the suspects. The clues take the form of [subject boolean property], resulting in text like “Greg has brown hair” or “The thief does not have red hair.” Eventually the game will stop giving more clues; when that happens it should always be possible to identify the thief with the information that’s been provided.
Most games should require at least 3 turns to get enough clues. I’m not sure of the exact numbers, but the chances of getting a solvable set of clues on the first turn are low (one in thousands, at least). It already avoids certain combinations of clues that reveal the solution too easily.
Scoring would definitely be cool. First the game will need to be able to solve itself, which should be possible, albeit not quite trivial.
Yeah, it only avoids solutions with one level of indirection. You should never get one this easy:
But you can get one with as few as two:
The game generates a list of clues with four basic classifications:
[suspect true property] e.g. [Greg true hair] => "Greg has red hair."
[suspect false property] e.g. [Bob false hair] => "Bob does not have red hair."
[property true property] e.g. [hair true meal] => "The red-haired suspect ate the salad."
[property false property] e.g. [hair false meal] => "The gray-haired suspect did not eat the salad."
Clues about the thief are just [suspect] clues that get special handling.
If a [suspect true property] clue gets revealed, the other [suspect true] clues for the same property get eliminated.
I’m still experimenting with ways to increase the difficulty by eliminating other clues without inadvertently making the puzzle unsolvable. I noticed, for example, that it was possible to enter an unwinnable state if the game didn’t reveal at least one [suspect true property] clue about the thief.