Inspiration

Most AI games let the model act like the whole game master. That can feel magical, but it also makes a mystery unfair: if the model can decide the truth, the player is really arguing with a chatbot instead of solving a case.

Liarline started from the opposite idea:

AI suspects can lie. Only evidence can convict.

I wanted to build a mobile detective game where AI makes suspects feel alive, nervous, evasive, or defensive, but the actual culprit, motive, clues, contradictions, accusation result, and ending are controlled by deterministic game logic.

What it does

Liarline is a mobile-browser AI detective game with one playable case.

The player interrogates four suspects, watches their answers shift under pressure, catches a contradiction, opens a notebook of evidence, and makes one final accusation with a suspect, motive, and supporting clues.

The AI performs suspect dialogue, but it does not know the hidden truth table and cannot decide who is guilty. The local game engine owns the fair-play logic.

How I built it

I built Liarline as a Next.js mobile web app with React and Tailwind CSS. The game state is local-first and stored in LocalStorage so the case can continue in the browser.

The AI path runs through a serverless /api/npc-turn proxy. Groq llama-3.1-8b-instant generates compact suspect answers from public case facts, the active suspect profile, allowed knowledge, recent dialogue, and the player's question.

The important game decisions stay outside the model:

  • clue unlocks
  • suspicion changes
  • contradiction detection
  • accusation scoring
  • detective rating
  • final resolution

If the AI provider fails, times out, or returns invalid output, the game shows a visible fallback answer and keeps the case playable without pretending that fallback was live AI.

Challenges

The hardest part was keeping the mystery fair while still using AI meaningfully.

A detective game needs consistency. If the model invents evidence, leaks hidden state, repeats generic filler, or decides the culprit by itself, the player cannot trust the case. I had to separate the AI actor layer from the deterministic judge layer and add validation around AI answers.

The second challenge was mobile UX. The interrogation screen needs suspects, evidence, notebook access, questions, pressure states, and final accusation controls to work on a phone-sized viewport without feeling cramped.

The third challenge was making the demo honest for judges. The submission shows one polished playable case, not a fake multi-case season or unlimited procedural mystery system.

What I learned

I learned that AI works best in this kind of game when it adds performance, not authority.

The model is great at making a suspect sound nervous or evasive. The engine is better at deciding whether the player's evidence is enough. That split made the game more reliable, more testable, and more fair.

What's next

The current submission is one playable case. Future work could add more cases, stronger suspect memory, better post-case feedback, and a larger mystery structure, but this Devpost build focuses on a stable, honest, mobile-first detective experience.

Built With

Share this project:

Updates