kronologic

Kronologic Mystery Game - Scenario Generator

View on GitHub Pages

A deduction game where players ask questions about character movements through rooms over time to solve mysteries. This tool generates valid scenarios with configurable difficulty using SAT solving.

How the Game Works

Core Mechanics

Players investigate what happened during a night at a mansion (or other location) by asking two types of questions:

1. Location + Time Questions

“How many different characters were in [Location] at [Time X]?”

Example: “How many characters were in the Gallery at t=3?”

2. Location + Character Questions

“How many times did [Character] visit [Location] across all timesteps?”

Example: “How many times did Servant visit the Foyer?”

Winning the Game

Players must deduce the secret scenario by combining:

Scenarios

Note: You can only select ONE scenario per puzzle generation. Each scenario creates a unique mystery to solve.

S1: Poison (Assassin)

Mystery: One character poisoned someone at a specific time and location.

Rules:

Goal: Identify the victim, poison time, and poison room.

Difficulty Factors: Other character pairs being alone together at various times creates red herrings that look like potential poison moments.


S2: Phantom

Mystery: One character was mysteriously alone at every single timestep.

Rules:

Goal: Identify which character is the phantom.

Difficulty Factors: Characters who are alone frequently (but not at every timestep) are harder to distinguish from the true phantom. The more timesteps a non-phantom spends alone, the harder the puzzle. Difficulty scoring adds 100 × (alone proportion) for non-phantoms who are alone in at least T−2 timesteps, and 50 × (alone proportion) for anyone alone at least half the time.


S3: The Singer’s Jewels

Mystery: A priceless necklace keeps changing hands. The first thief is the first person to reach the alphabetically first room alone, and any time the holder meets exactly one other person, the jewels pass.

Rules:

Goal: Track who entered the key room and build the story of how the jewels moved.

Difficulty Factors: With more characters and longer timelines, multiple suspects may plausibly be first to reach the room, complicating deduction.


S4: Bomb Duo

Mystery: Two accomplices are planning something suspicious.

Rules:

Goal: Identify the two bombers.

Difficulty Factors: The constraint is very restrictive. Bombers being in larger groups (camouflage) and groups of exactly 3 people (near-misses) increase difficulty. Difficulty scoring adds 40 points each time both bombers share a room with extra people and 30 points for every room-time with exactly three occupants.


S5: Lovers

Mystery: Two characters are secret lovers who never meet.

Rules:

Goal: Identify the two lovers.

Difficulty Factors: Other character pairs who rarely meet (but do meet at least once) create confusion about who the actual lovers are. Pairs that meet exactly once are strong red herrings. Difficulty scoring adds 80 points to pairs that meet exactly once and 40 points to pairs that meet exactly twice.


S6: Phantom + Lovers

Mystery: One character is a phantom (alone at every timestep) AND there are two lovers who never meet.

Rules:

Requirements: At least 4 characters, 3 rooms, and 2 timesteps.

Goal: Identify the phantom and the two lovers.

Difficulty Factors: The phantom is easy to identify (always alone). The two lovers must avoid each other while still meeting all other non-phantom characters. Other pairs who rarely meet create confusion about who the lovers are. Lover difficulty scoring ignores all pairs containing the phantom.


S7: Aggrosassin

Mystery: One character is a serial poisoner who kills everyone they meet one-on-one.

Rules:

  1. Exactly one aggrosassin exists (can be any character, not necessarily the first)

  2. Minimum kill quota: The aggrosassin must secure at least max(2, ⌈T/2⌉) kills across the timeline
    • Every required kill happens during a 1-on-1 meeting (exactly two people in a room)
    • Examples mirroring the solver: with T=6, the aggrosassin must notch 3 kills; with T=2, they still need 2 kills (minimum-two-kills rule)
  3. Exclusive two-person meetings: Any room that contains exactly two people must include the aggrosassin
    • Non-aggrosassin characters can be alone or in groups of 3+, but they are never alone together
    • Every 1-on-1 meeting therefore marks a confirmed kill moment for the aggrosassin
  4. Victims: The aggrosassin kills everyone they meet 1-on-1
    • Victims = all characters who were alone with the aggrosassin at any timestep
    • No repeat kills: once a character has met the aggrosassin 1-on-1, they cannot be targeted again, so scenarios must include at least requiredKills + 1 characters (the aggrosassin plus enough distinct victims)
    • Example: With T=6 (requiredKills=3), the scenario needs at least 4 characters so every kill can target a unique victim
  5. Flexibility otherwise: The aggrosassin can spend other timesteps alone, in pairs with victims, or in larger groups (which help disguise them between kills)

Goal: Identify the aggrosassin and determine how many victims they claimed.

Difficulty Factors:

Scoring: Difficulty = (number of victims × 10) + camouflage points


S8: The Freeze

Mystery: Mr. Freeze is on the loose. Anyone they catch alone is frozen in place for the rest of the timeline.

Rules:

Goal: Identify Mr. Freeze and list every frozen victim (with their freeze moments).

Difficulty Factors:

Scoring: Difficulty = (number of victims × 100) + (non-Freeze 1-on-1 meetings × 5)


S9: Doctor’s Cure

Mystery: A doctor starts the game with a handful of already-frozen victims. Mid-game house calls thaw them out and send them moving again.

Rules:

Goal: Identify the doctor, list who started frozen, and note the heal times/rooms when they were thawed.

Difficulty Factors:

Scoring: Difficulty = 80 + (number of frozen characters × 40) + clustering bonuses. Each additional heal on the same timestep adds 15 points.


S10: Contagion

Mystery: The alphabetically first room on the map is contagious. Anyone who steps inside becomes infected, and infections spread to everyone who shares a room with an infected character.

Rules:

Goal: Determine when each character was first infected and reconstruct the infection order.

Difficulty Factors:


S11: The Vault

Mystery: The alphabetically earliest room is designated as The Vault, and only the key holder can unlock it.

Rules:

Requirements: At least 3 characters, 3 rooms, and 3 timesteps.

Goal: Using the known Vault room, identify the key holder and list everyone who ever entered it.

Difficulty Factors:


S12: Glue Room

Mystery: One randomly chosen room is covered in glue. Anyone who steps inside is stuck there for one extra turn.

Rules:

Goal: Identify which room is the glue room and when each character first entered it.

Difficulty Factors:


S13: Glue Shoes

Mystery: One character has glue on their shoes. Anyone who shares a room with them becomes stuck for an extra turn.

Rules:

Goal: Identify which character has the glue shoes and when each affected character was first stuck by them.

Difficulty Factors:


S14: The Curse of Amarinta

Mystery: A supernatural curse jumps between people whenever the current carrier meets someone who isn’t cursed yet.

Rules:

Goal: Use the post-handoff Time 6 cursed list and the meeting pattern to deduce who began Time 1 cursed.

Difficulty Factors:


S15: World Travelers

Mystery: Three characters are the top travelers, ranked by how many unique rooms they visited.

Rules:

Goal: Deduce who is 1st, 2nd, and 3rd place by analyzing which rooms each character visited.

Difficulty Factors:


S16: Homebodies

Mystery: Each character visited a different number of unique rooms. One character—the homebody—never left their starting room.

Rules:

Goal: Determine the complete ranking of who visited how many rooms, and identify the homebody.

Difficulty Factors:

S17: Triple Alibi

Mystery: Three specific characters have a secret pact—they must meet together as a trio at least once during the night. No other group of exactly three can ever share the same room at the same time.

Rules:

Goal: Identify which three characters form the alibi trio.

Difficulty Factors:

S18: Heavy Sofa

Mystery: A heavy sofa needs to be transported from one room to the alphabetically first room. The sofa is so heavy that it requires exactly two people to carry it, and they must be alone together to pick it up.

Rules:

Goal: Identify the two carriers, where the sofa started, and the path it took.

Private Info:

Difficulty Factors:


S19: Crowded Alibi

Mystery: One celebrity blends into the biggest crowds. They are always inside a largest group, and at least once they stand in a uniquely biggest room that proves they were there.

Rules:

Goal: Identify the celebrity who rides the biggest crowd for cover.

Private Info:

Difficulty Factors:


Using the Generator

Basic Setup

  1. Define the Map: Use Mermaid-like syntax to create room connections
    graph TD
      Foyer --- Stairs
      Foyer --- Gallery
      Gallery --- Masks
    
  2. Set Characters: Comma-separated list (e.g., “A, B, C, D, S, J”)

  3. Choose Timesteps: How many time periods (2-10, typically 6)

  4. Movement Rule:
    • Characters move to a connected room every timestep
    • Scenario effects may temporarily force an affected character to stay, such as being frozen, waiting to be healed, or being stuck by glue

Scenario Selection

Enable one scenario:

Difficulty Control

Percentile (0-100): Controls puzzle difficulty

Samples: How many scenarios to generate (10-5000)

Technical Details

Development

Local Development Server

The scenario generator uses ES6 modules, which require a web server (they don’t work with file:// protocol due to CORS restrictions). To run locally:

# Start the development server
bun run dev

Then open your browser to:

Note: The generator works perfectly on GitHub Pages without any build step. The dev server is only needed for local development.

Running Tests

This project uses Bun for running tests:

bun test

To run tests in watch mode:

bun test --watch

Note-Taking Interface

The note-sheet.html file provides an interactive note-taking tool designed for players to track their deductions during gameplay.

Features

Time-Step Mini-Maps

Character Placement Tracking

Visit Count Table

Deduction Notes

Undo/Redo System

Data Persistence

Intended Workflow

  1. Generate a scenario using the main generator (scenario_generator.html)
  2. Open note-sheet.html in a separate tab/window
  3. As you ask questions, record information:
    • Shared counts go in the visit tracking table
    • Private character sightings get placed on the time-step maps
    • Logical deductions go in the notes area
  4. Use visual patterns to spot contradictions:
    • If a character appears in two places at once, you made an error
    • Strikethrough helps track “impossible” placements
    • Color-coding makes it easy to see character movements
  5. Solve the mystery by combining all information sources

Integration with Main Generator

The note sheet is designed to work alongside the scenario generator:

Example Use Case

Scenario: S2 (Phantom) with 6 characters, 6 timesteps

  1. Player asks: “How many characters in Gallery at t=3?” → Answer: “2 characters”
  2. Player records “2” in their notes
  3. Player’s private info: “One character present: Detective”
  4. Player clicks Gallery on t=3 mini-map, adds Detective chip
  5. Later, player learns Detective was also in Foyer at t=3 (contradiction!)
  6. Player uses strikethrough on Gallery placement to mark it as wrong
  7. Player writes in notes: “Detective NOT in Gallery at t=3 - must be in Foyer”

Example Workflow

  1. Generate 100 scenarios at 75th percentile with S2 (Phantom) enabled
  2. System creates 100 valid solutions, scores them by difficulty
  3. Selects a scenario from the 60-80th percentile range
  4. Players ask questions using the Question Interface
  5. Players use the note-taking interface to track deductions
  6. Players deduce which character is the phantom based on:
    • How many people were in each room at each time (shared)
    • Specific character sightings (private to each player)
    • Logical elimination using their notes

Tips for Game Masters