Obscura

Inspiration

The idea for Obscura emerged from a simple yet profound realisation: traditional murder mystery games follow predictable patterns. Players memorise solutions, walkthroughs proliferate online, and the element of genuine surprise evaporates after the first playthrough. But what if we could create a murder mystery where every case was genuinely unique, where no two players would ever experience the same story?

The breakthrough moment came during late-night exploration of Google's Gemini Flash and ElevenLab's multimodal TTS voice API capabilities. While most developers were using AI for chatbots and content generation, we saw something different—the potential to create an entire procedural narrative universe where artificial intelligence could weave complex webs of alibis, motives, and red herrings with human-like sophistication.

We were inspired by classic detective fiction—Sherlock Holmes, Agatha Christie, and modern crime dramas—but frustrated by the limitations of traditional games. (Spoiler Alert - You also will have your personal AI assistant. Could you guess who it could be?). We wanted to capture the genuine thrill of discovery that comes with solving a mystery for the first time, every single time.

What it does

Obscura is an AI-powered murder mystery game where every case is completely unique and procedurally generated. Here's what makes it special:

Infinite Unique Cases

  • Every playthrough generates a completely new murder mystery with unique victims, suspects, locations, and storylines
  • AI crafts complex narratives with believable motives, alibis, and red herrings
  • 13 different story archetypes ensure variety (Love Triangle Gone Wrong, Corporate Espionage, Revenge Plot, etc.)

Voice-Based Interrogations

  • Players interrogate suspects and witnesses through AI-generated voice conversations
  • Each character has a distinct voice personality that conveys emotions like nervousness, confidence, or deception
  • Voice cues become part of the evidence—hesitation might indicate guilt, confidence might suggest innocence

Watson AI Assistant

  • A sophisticated AI companion that analyzes your investigation progress
  • Provides contextual hints based on discovered evidence without giving away solutions
  • Engages in Socratic dialogue to guide your thinking like a real detective partner

Dynamic Investigation System

  • Explore AI-generated crime scene maps with multiple locations
  • Progressive clue revelation system—evidence must be earned through genuine investigation
  • Time constraints add pressure (one interrogation per suspect per day)

Adaptive Difficulty

  • Rookie: Clear motives and obvious inconsistencies
  • Field Agent: Complex relationships and multiple red herrings
  • Elite: Unreliable narrators, cryptic clues, and tightly-woven alibis

How we built it

AI-First Architecture

Unlike traditional games where AI is supplementary, Obscura was built AI-first. Every component was designed around Gemini Flash's capabilities:

// Our core philosophy: Let AI drive the narrative engine
const generateUniqueCase = async (playerPreferences, difficulty) => {
  const storyStructure = await generateStoryStructure(preferences);
  const characters = await generateCharacters(storyStructure);
  const timeline = await generateTimeline(characters, difficulty);
  const clues = await generateClues(timeline, characters);
  return weaveNarrative(storyStructure, characters, timeline, clues);
};

Multi-Modal AI Integration

We pioneered the integration of multiple AI modalities in gaming:

  • Text Generation: Gemini Flash creates narratives, dialogue, and clues
  • Voice Synthesis: Multi-speaker TTS using ElevenLabs for high-fidelity, emotionally rich character voices
  • Image Generation: AI creates crime scene maps and location visuals
  • Analysis AI: Watson assistant analyzes player progress and provides hints

Technical Stack

  • Frontend: Next.js 15, TypeScript, Tailwind CSS, Framer Motion
  • AI/ML: Google Gemini Flash 2.5 (Text, Image Generation), ElevenLabs for realistic voice synthesis
  • Backend: Next.js API Routes, Firebase Firestore
  • Authentication: Firebase Auth
  • Media Storage: Cloudinary for audio/image hosting
  • UI Components: Radix UI primitives with custom dark academia styling

Deterministic Randomness System

We implemented seeded story generation to ensure consistency:

function seededRandom(seed: string): number {
  let hash = 0;
  for (let i = 0; i < seed.length; i++) {
    hash = ((hash << 5) - hash) + seed.charCodeAt(i);
    hash |= 0; // Convert to 32bit integer
  }
  // Use Linear Congruential Generator for consistency
  let value = Math.abs(hash);
  value = (value * 9301 + 49297) % 233280;
  return value / 233280;
}

Challenges we ran into

The Consistency Paradox

Our biggest technical challenge was what we called the "Consistency Paradox": AI excels at being creative and varied, but mystery games require strict logical consistency. We solved this through:

  • Multi-pass validation: Every generated story goes through consistency checks
  • Constraint-based generation: Using detailed prompts that enforce logical rules
  • Cross-referential verification: Characters' stories are validated against each other

The Uncanny Valley of AI Voices

Early voice generation attempts fell into the "uncanny valley"—technically correct but emotionally flat. We overcame this by:

  • Emotional prompting: Instructing the AI on the character's emotional state
  • Contextual voice modulation: Adjusting tone based on the question being asked
  • Dynamic pacing: Varying speech patterns to match personality types

Firebase Real-time Synchronization

Managing game state across multiple API calls while maintaining data consistency proved challenging:

// Our solution: Atomic case state management
const updateCaseProgress = async (caseId, updates) => {
  const batch = db.batch();
  // Ensure all related documents update atomically
  batch.update(caseRef, updates.case);
  batch.update(progressRef, updates.progress);
  batch.update(findingsRef, updates.findings);
  await batch.commit();
};

ElevenLabs TTS API Rate Limiting

Heavy usage for TTS voice generation hit ElevenLabs API limits during testing. We implemented:

  • Smart caching: Storing generated audio files in Cloudinary
  • Request queuing: Managing API calls to stay within limits
  • Graceful degradation: Fallback text mode when voice generation fails

Teaching AI to Lie Convincingly

Building Obscura was fundamentally an exercise in teaching machines to lie convincingly. Traditional AI excels at providing helpful, truthful responses. But mystery games require AI that can create believable inconsistencies and contradictory alibis that seem logical individually but reveal guilt when analyzed together.

Accomplishments that we're proud of

World's First Multi-Modal AI Mystery Game

We successfully created the first murder mystery game that integrates text, voice, and image generation AI into a cohesive gaming experience. Our multi-speaker voice system generates distinct character personalities that convey emotions through vocal cues.

Teaching AI to Create Believable Lies

We solved one of the most complex challenges in AI gaming: making artificial intelligence generate contradictory but individually logical alibis. Our constraint-based generation system creates suspects who lie convincingly while maintaining internal story consistency.

Infinite Replayability Achievement

We proved that AI can create genuinely unique gaming experiences. Every case is procedurally generated with different victims, suspects, motives, and locations—no two players will ever solve the same mystery.

Revolutionary AI Assistant Integration

Watson AI represents a paradigm shift from static game tutorials to dynamic, context-aware assistance. It analyzes player progress and provides Socratic dialogue without spoiling solutions.

Technical Innovation Breakthroughs

  • Deterministic randomness: Consistent story generation using seeded algorithms
  • Real-time voice synthesis: Multi-character conversations generated on-demand using ElevenLabs TTS API
  • Progressive clue revelation: Evidence must be earned through genuine investigation
  • Atomic game state management: Consistent data across multiple Firebase operations

What we learned

AI Constraint Engineering

The biggest learning was that AI creativity must be carefully constrained for gaming. We developed sophisticated prompt engineering techniques that enforce logical consistency while maintaining narrative creativity.

// Example: Constraining AI to create logical but contradictory alibis
const generateSuspectAlibis = async (timeline, otherSuspects) => {
  const constraints = {
    timeframe: timeline.crimeWindow,
    location_conflicts: otherSuspects.locations,
    consistency_rules: ALIBI_LOGIC_CONSTRAINTS
  };
  return await generateWithConstraints(prompt, constraints);
};

Voice Changes Everything

Adding voice to text-based interactions fundamentally transforms user experience. We learned that:

  • Emotional context matters: Voice tone conveys guilt/innocence better than text
  • Personality through speech: Accents, pacing, and vocal patterns create character depth
  • Technical complexity is worth it: Despite challenges, voice makes mysteries feel authentic

Progressive Revelation Psychology

We discovered that information pacing is crucial for engagement:

  • Don't dump everything at once: Players need to work for discoveries
  • Layer complexity gradually: Start simple, add nuance through investigation
  • Time pressure creates urgency: Limited interrogations per day increase tension

Multi-Modal AI Integration Challenges

Combining text, voice, and image AI taught us about:

  • Rate limiting management: Heavy AI usage requires smart caching and queuing
  • Consistency across modalities: Generated images must match text descriptions
  • Graceful degradation: Systems must work even when AI APIs fail

Player Psychology in AI Games

Testing revealed unique player behaviors with AI-generated content:

  • Trust vs. skepticism: Players initially distrust AI-generated narratives but engage deeply once immersed
  • Pattern seeking: Players try to find "tells" in AI writing style rather than story content
  • Increased engagement: Unique cases create genuine investment compared to scripted stories

What's next for Obscura

Multiplayer Detective Teams

Our next major feature: Collaborative Investigations

  • Teams of 2-4 detectives work together on the same case
  • AI generates different clues for each player based on their investigative approach
  • Real-time sharing of evidence and theories through integrated chat
  • Competitive scoring based on individual contributions to the solution

Historical Mystery Expansion

We're developing Time Period Modules:

  • Victorian London: Sherlock Holmes-era mysteries with period-accurate language and technology
  • 1920s Chicago: Prohibition-era cases involving speakeasies and organized crime
  • Ancient Rome: Political intrigue and assassination plots in the Roman Empire
  • Medieval England: Castle murders with feudal politics and limited forensic tools

Player-Generated Content System

Introducing Mystery Creator Mode:

  • Players input basic premises (victim type, setting, theme)
  • AI expands simple ideas into full-fledged cases
  • Community sharing of player-created mystery templates
  • Rating system for the most engaging user-generated cases

Cross-Platform Investigation Hub

Developing Omnipresent Detective Experience:

  • Mobile app for discovering clues through location-based AR
  • Smartwatch integration for receiving "anonymous tips" throughout the day
  • Desktop deep-dive analysis with Watson AI
  • Tablet evidence board for visual case mapping

Advanced AI Behavioral Analysis

Next-generation features powered by enhanced AI:

  • Micro-expression analysis: AI analyzes player questioning patterns to provide deeper insights
  • Behavioral profiling: Watson learns individual detective styles and adapts hints accordingly
  • Dynamic difficulty scaling: AI adjusts case complexity based on solving patterns
  • Psychological profiling: Characters develop more nuanced personalities based on player interactions

Expanded Voice Acting AI

Enhanced character immersion through cutting-edge voice synthesis powered by ElevenLabs:

  • Regional accent authenticity: Location-specific speech patterns and dialects
  • Emotional state tracking: Voices change based on stress, guilt, and questioning pressure
  • Background noise integration: Realistic environments with ambient sounds during interrogations
  • Multiple language support: Cases generated and voiced in different languages By leveraging ElevenLabs’ industry-leading TTS voice AI, we plan to bring each character to life with nuanced emotion, pacing, and personality—making every interrogation feel like a scene from a true crime thriller.

Competitive Detective League

Community features to build engagement:

  • Monthly mystery challenges: Global leaderboards for fastest/most accurate solutions
  • Detective ranking system: Progression from Rookie to Master Detective based on case success
  • Specialized case types: Espionage, corporate crime, supernatural mysteries
  • Live mystery events: Real-time cases that unfold over days with the community

AI Research Collaboration

Contributing to broader AI development:

  • Open-source constraint libraries: Sharing our prompt engineering techniques
  • Academic partnerships: Collaborating on procedural narrative generation research
  • AI ethics in gaming: Establishing best practices for AI-generated content
  • Voice synthesis advancement: Contributing to more natural AI speech patterns

"The future of gaming isn't about replacing human creativity with AI—it's about amplifying human storytelling capabilities through intelligent automation."

Built With

Share this project:

Updates