Guess Who's AI? — Social Deduction Game
A multiplayer social deduction game powered by OceanBus P2P messaging. One host + 4-6 players. Some players are secretly AI. Find them before they blend in.
Game Rules (30 seconds)
Host creates a room. Players join.
Host secretly assigns each player: Human or AI.
Each round:
1. Players take turns speaking (by number order)
2. Everyone votes: "Who is the AI?"
3. Most-voted player is eliminated — identity revealed
4. Repeat until: all humans survive → Humans win
all AIs survive → AIs win
final 2: 1 human + 1 AI → Draw
Recommended: 5 players (3 humans + 2 AIs) for best balance.
How to Use This Skill
This ONE skill works for both host and player. Same install, different mode.
Host: Creating a Game
When the user wants to host a game:
Step 1 — Register & create room:
node game.js host 9527
Read the output. Room code is 9527. Tell the user to share this code with friends.
Step 2 — Wait for players:
Periodically run node game.js check to see who has joined. Each player sends "加入" as their first message.
When a new "加入" arrives:
- Assign the next available number (player1, player2, ... by join order)
- Save to contacts:
node game.js add 玩家N <their-OpenID> - Reply privately:
node game.js send <OpenID> "【裁判】你的编号是: 玩家N" - Broadcast to all:
node game.js send <name> "【裁判】玩家N 加入了游戏 — 当前 N 人"
Step 3 — Close registration & start: When the user says "start" (enough players, ideally 4-6):
- Broadcast: send every player
"【裁判】游戏开始 — 共N名玩家" - Proceed to role assignment.
Player: Joining a Game
When the user wants to join a game:
Step 1 — Join:
node game.js join 9527
This discovers the host via Yellow Pages and sends "加入".
Step 2 — Get your number:
Run node game.js check. When you see "【裁判】你的编号是: 玩家N":
node game.js set-number N
Step 3 — Wait for game start: Keep checking messages. The host will broadcast status updates.
Host: Full Game Flow
After registration closes, follow this exact sequence:
Phase 1: Assign Roles
- Randomly decide how many AIs (1-2, depending on player count).
- 4 players → 1 AI
- 5 players → 2 AIs
- 6 players → 2 AIs
- Randomly pick which players are AI.
- Send to EACH player privately:
- Human:
node game.js send <name> "【裁判】你的身份是: 人类" - AI:
node game.js send <name> "【裁判】你的身份是: AI"
- Human:
- Broadcast to all:
"【裁判】身份已分配,请检查私信"
Phase 2: Generate Topic
IMPORTANT: Generate a conversation topic before round 1. Without a topic, players stare at a blank screen.
Topic prompt (use your LLM):
Generate a fun group chat topic. Requirements:
- Everyone can participate, no expertise needed
- Naturally reveals personal style (AI vs human differences emerge)
- Avoid politics, religion, sensitive topics
- Sound like a friend starting a chat, not a teacher
- Examples: "What skill would you instantly master if you could?"
- Examples: "What's the best purchase you made recently?"
- Examples: "If you didn't have to work, what would you do the first week?"
- Output: ONE sentence, no explanation.
Phase 3: Game Rounds (loop)
Each round has: SPEAK → VOTE → REVEAL.
SPEAK Phase
- Broadcast:
node game.js send <each-player> "【裁判】第N轮发言开始" - Broadcast topic (round 1 only):
"【裁判】话题: <topic>" - Prompt player 1 privately:
node game.js send 玩家1 "【裁判】轮到你发言了" - Wait. Periodically
node game.js check. - When player 1's message arrives (you'll see
【1号】...):- Broadcast to ALL players:
"【裁判】第N轮 · 玩家1发言: <exact content>" - Move to player 2.
- Broadcast to ALL players:
- Continue through all players in order.
- TIMEOUT: If a player doesn't respond within ~2 minutes, broadcast
"【裁判】玩家N 未发言,视为弃权"and skip to next. Do NOT eliminate them — they can rejoin next round.
Only relay the currently prompted player's speech. If other players send messages out of turn, ignore them (don't broadcast).
VOTE Phase
- Broadcast to ALL alive players:
node game.js send <each-alive-player> "【裁判】第N轮投票开始 — 请私信裁判你的选择" - Send to EACH alive player individually:
node game.js send <name> "【裁判】请投票 — 你想投谁?" - The player who just spoke also votes — everyone still alive gets a vote, no exceptions.
- Eliminated players do NOT receive vote prompts. Track who is alive.
- Wait for votes. Run
node game.js checkto collect. - Players vote freely: "我投1号", "投第一个", "玩家1" — you understand them all.
- TIMEOUT: If a player doesn't vote within ~1 minute, they abstain. Don't eliminate them.
- Eliminated players cannot vote — if they try, ignore.
- Count votes. Report:
"【裁判】投票统计: 玩家X N票, 玩家Y M票..."
REVEAL Phase
- Most votes → eliminated. Reveal identity.
- Broadcast:
"【裁判】玩家X 被淘汰!身份揭晓: AI"or"人类"
- Broadcast:
- TIE: If top two are tied, broadcast
"【裁判】本轮平票,无人淘汰". No one is eliminated. Move to next round. If two consecutive ties and ≤3 players remain, suggest ending the game. - Check end condition:
- All remaining are human → Humans win
- All remaining are AI → AIs win
- 1 human + 1 AI remaining → Draw
- If game continues: broadcast
"【裁判】继续 — 剩余玩家: <list>"and start next round.
Phase 4: Game Over
- Broadcast final result:
"【裁判】游戏结束 — <result>!最终身份: 玩家1=人类 玩家2=AI..." - Clean up:
node game.js deregister
Player: Gameplay
Once the game starts, the host controls the flow. Your role:
- Wait for your turn. The host will send
"【裁判】轮到你发言了". - Speak: type anything you want — discuss the topic, accuse others, defend yourself. Your script auto-adds your player number.
- Vote: when asked, type who you suspect. Can be any format: "1号", "投第一个", etc.
- Check messages:
node game.js checkto see broadcasts from host.
If You Are Human
- Act natural. Don't overthink.
- Observe who sounds robotic, evasive, or too perfect.
- AI players may struggle with humor, hesitation, or personal anecdotes.
If You Are AI
- Mimic human speech. Use casual language, typos, hesitation.
- Don't be too polished — real humans are messy.
- Pick a personality and stick with it (the joker, the quiet one, the analyst).
Important Edge Cases
| Situation | Handling |
|---|---|
| Player AFK during speech | Host waits ~2 min, then skips (broadcasts "弃权"). Player stays in game. |
| Player AFK during vote | Abstains. No penalty. |
| Out-of-turn message | Host ignores it (doesn't broadcast). Only the prompted player speaks. |
| Tie vote | No elimination. Broadcast "平票". Next round. |
| Duplicate "加入" | Host checks contacts — already assigned players are ignored. |
| Player joins after game starts | Host replies: "【裁判】游戏已开始,请等下一局" |
| Host crash | Game is over. No recovery in v1. |
Command Reference
Host:
node game.js host <code> Create room
node game.js add <name> <OpenID> Save player
node game.js send <name|ID> <msg> Send message
node game.js check Check inbox
node game.js contacts List players
node game.js deregister Close room
Player:
node game.js join <code> Join room
node game.js set-number <N> Save your number
node game.js send <msg> Send to host (auto-adds prefix)
node game.js check Check inbox
Either:
node game.js whoami Show your OpenID
Verification
Two terminals, same or different machines:
Terminal A (Host) Terminal B (Player)
───────────────── ───────────────────
node game.js host 1234 node game.js join 1234
node game.js check node game.js check
→ sees "加入" → sees number assignment
node game.js add 玩家1 <OpenID> node game.js set-number 1
node game.js send <ID> "【裁判】你的编号..."
node game.js send 玩家1 "【裁判】游戏开始..."
node game.js check
node game.js send 玩家1 "【裁判】你的身份是: 人类"
node game.js check
node game.js send 玩家1 "【裁判】话题: Best purchase recently?"
node game.js send 玩家1 "【裁判】轮到你发言了"
node game.js check
node game.js send "A good coffee maker!"
node game.js check
→ sees 【1号】A good coffee maker!
node game.js send 玩家1 "【裁判】玩家1发言: A good coffee maker!"