Skip to content

54MDev/Echo

Repository files navigation

Echo

Echo is a party game about catching an AI pretending to be your friend.

Everyone joins the same room from their phones, one big screen acts as the "TV" for the whole group, and each round one person becomes the target. The game quietly builds an AI clone of that person, then asks both the real human and the clone the same question. Two answers show up on the screen, labeled A and B. Nobody is told which one is real. Everyone votes. The clone is trying to blend in, the human is trying to stand out, and you find out who fooled who when the scores come up.

That's the whole thing. It's meant to be loud, fast, and played in a room with people you know well enough to argue about whether "that's totally something they'd say."

How a round works

  1. Lobby. The host opens a room and gets a short code like ECHO-4729. Everyone else types that code into their phone browser. No app to install.
  2. Pick a target. The host chooses whose turn it is to get cloned.
  3. Seed. The target answers a handful of quick personal questions on their phone (stuff like "how do you text" or "your honest hot take on something everyone likes"). These answers teach the clone how that person talks.
  4. Question. A question pops up. The real target types an answer. At the same time, the clone writes its own answer and streams it onto the big screen letter by letter, like it's typing.
  5. Vote. Both answers sit on screen as A and B. Everyone except the target votes for the one they think is the real human. The tally updates live.
  6. Results. The screen reveals which was which, shows the vote breakdown, and updates the leaderboard.

Then it rotates to a new target and goes again. If someone gets picked a second time, their clone remembers everything they said before, so it gets better at sounding like them.

Scoring

  • Guess the human correctly: +1 for you.
  • Every person the target manages to fool: +2 for the target.

So spectators are rewarded for spotting the human, and the target is rewarded for being hard to imitate (or for having a clone that nails their voice). The leaderboard adds up across rounds. Close the room and it all resets, nothing is saved.

How it's built

Nothing fancy, and that's on purpose. The whole game lives in three pieces:

  • A React front end (built with Vite). This is the same app for both the host screen and the player phones. It just renders whatever the server tells it to. The phones and the TV are running the exact same code, they only look different because of what role you have and what phase the game is in.
  • A PartyKit server that holds all the real state. Every room is its own little server. It tracks players, runs the game phases, counts votes, does the scoring, and talks to the AI. The clients are deliberately dumb, the server is the source of truth and broadcasts updates to everyone over WebSockets.
  • The OpenAI API, called only from the server. When it's time for the clone to answer, the server builds a prompt out of the target's seed answers, asks the model to mimic that person, and streams the response straight to the big screen. The API key never touches the browser.

If you want the deeper version, PLAN.md has the architecture and state machine, REQUIREMENTS.md has the full feature list, and ROADMAP.md shows how it got built.

Running it yourself

You'll need Node and an OpenAI API key.

# 1. Install dependencies
npm install

# 2. Add your key
cp .env.example .env
# then open .env and paste in your OPENAI_API_KEY

# 3. Run the game server and the front end (two terminals)
npm run dev:party   # the PartyKit room server
npm run dev         # the React app

Open the front end in your browser for the host screen, then hit the same URL on a couple of phones (or extra browser tabs) to join as players. You need at least 3 people for a real game: one target and two spectators. It tops out around 8.

Putting it online

PartyKit deploys the server and the front end deploys as a plain static site. The shortcut is:

npm run deploy

That deploys the room server and then builds and ships the front end. You'll want to store your OpenAI key as a server secret rather than committing it, which is what npm run deploy:secret is for. Once it's live, players just need the URL, it works the same as it does locally.

Good to know

  • It's built for phones. Works in mobile Safari and Chrome with no install.
  • The big screen is meant to be read from across a room, so the text is large and high contrast.
  • There's no database. Scores live in memory for as long as the room is open and disappear when it closes. That's intentional, this is a play-once, laugh, and move on kind of game.

About

this'll be fun

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors