Skip to content

abbasmir12/amongliars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Among Liars

One room. Six humans. One hidden Gemini-powered liar.

Among Liars is a realtime social deduction game built for the DEV June Solstice Game Jam. It turns the Turing Test into a playable elimination game: Detectives are not just looking for a role, they are reading tone, hesitation, fake memories, strange confidence, and the little tells that make a message feel human or not.

The twist is that the AI is not a chatbot sitting outside the game. It is a hidden spy-side player.

The Game

Seven total players exist in each match:

  • 3 Detectives trying to expose the hidden AI
  • 3 Human Spies trying to protect the AI
  • 1 Gemini AI player hidden inside the spy side

Only six people join the room. The seventh player is created by the backend and controlled through the Gemini API.

Detectives win when the AI has nowhere left to hide. Spies win when every Detective is eliminated first.

How A Round Works

  1. Planning Detectives get a private room. Spies get a different private room. Teams can talk, suggest suspects, plan questions, and coordinate pressure.

  2. Cover Names Spy-side players receive new cover names every round. A spy might be TAVI in one round and ORION in the next. This keeps identity, order, and memory from becoming cheap tells.

  3. Detective Question One living Detective is selected. They ask the spy side one question, usually something hard to fake quickly.

    Good questions are things like:

    • “What did you eat three days ago?”
    • “What sound does Tuesday feel like?”
    • “Who in this room seems like they are trying too hard?”
  4. Spy Answers Every living spy-side player answers, including Gemini. Answers appear as evidence cards.

  5. Final Read The selected Detective clicks the answer card they believe belongs to the AI.

  6. Resolution A correct guess removes a human spy bodyguard. A wrong guess eliminates the Detective. The AI survives until the spy side is stripped away.

Why This Fits The Jam

The jam theme is the June solstice and June celebrations. Among Liars leans into June as a moment of transition, identity, visibility, and hidden truth.

It also directly targets the Best Ode to Alan Turing category. The game is built around Turing’s imitation game, but instead of asking “Can a machine answer correctly?”, it asks:

Can a machine survive being read by people?

That felt more interesting for a game. The AI does not need to be perfect. Sometimes perfect is suspicious. Sometimes messy is safer. Sometimes a human spy intentionally sounds robotic to protect it.

Gemini Usage

Gemini is core to the gameplay.

The AI player answers wildcard and detective questions through a Supabase Edge Function. The frontend never receives the Gemini API key.

The Edge Function:

  • receives the current room and round
  • finds the hidden AI player
  • reads the active question
  • finds the AI’s current cover name
  • chooses one of several behavior styles
  • calls Gemini server-side
  • saves the AI answer into Supabase so everyone sees it in realtime

This is not a decorative AI feature. Without Gemini, the central mystery does not exist.

Tech Stack

  • React
  • Vite
  • Framer Motion
  • Supabase Postgres
  • Supabase Realtime
  • Supabase Edge Functions
  • Gemini API

Local Setup

Install dependencies:

npm install

Create a local env file:

cp .env.example .env

Set:

VITE_SUPABASE_URL=...
VITE_SUPABASE_PUBLISHABLE_KEY=...

Run the app:

npm run dev

Build:

npm run build

Supabase Setup

Apply the migrations in supabase/migrations.

Deploy the Edge Function:

supabase functions deploy ai-wildcard-answer

Set server-side secrets in Supabase:

supabase secrets set GEMINI_API_KEY=...
supabase secrets set GEMINI_MODEL=gemini-2.5-flash

Do not put Gemini or Supabase service-role secrets in frontend environment variables.

Security Notes

This repo intentionally does not include real secrets.

Safe to expose:

  • Supabase project URL
  • Supabase publishable key

Never expose:

  • Gemini API key
  • Supabase service role key
  • local .env files

Current Status

The game supports:

  • room creation and random room joining
  • 6-player waiting room and countdown
  • private role reveal
  • rotating spy cover names
  • public chat
  • team-only private chat
  • unread private-room indicators
  • wildcard questions
  • Gemini AI answers
  • answer evidence cards
  • detective guessing
  • round resolution
  • elimination tracking
  • final win states

License

MIT

About

Multiplayer Elimination game where AI hides among human players and must avoid detection to survive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors