A Real-Time Multiplayer Social Deduction Game
Play now: [Coming Soon - AWS App Runner Deployment]
AmongHumans is a web-based multiplayer game where human players interact in a chat-like environment to identify a hidden AI player ("Imposter") among them. Players submit text answers to creative prompts each round. What makes it unique:
- Player-Influenced AI: Players can submit instructions to influence how the AI behaves, making each game unique and challenging.
- Dynamic AI Player: The AI opponent generates its answers using an LLM, gets a "vibe-based" name to blend in, and votes strategically based on heuristics.
- Dual-Objective Gameplay: While the main goal is to catch the AI, human players can also win rounds by successfully deceiving others into voting for them as the AI!
Can you outsmart the AI player? Or can you fool everyone into thinking you're the machine?
- Join: Players connect via their browser and join a room with a shareable code.
- Game Configuration:
- Players set the number of rounds for the game (1-10)
- Players can submit instructions to influence the AI's behavior
- Players can suggest question topics for the game
- AI Activation: The server activates the AI player ("Imposter") with a name designed to blend in with the human players.
- Game Rounds:
- Prompt: A text-based prompt appears for all players (e.g., "Describe your perfect Sunday").
- Answering: Players submit their answers within a time limit.
- Voting: All answers are displayed (anonymously), and players vote for who they think is the AI.
- Results & Scoring:
- AI Identification: Humans who correctly vote for the AI score points (+2).
- Human Deception: Humans receive +1 point for each vote they receive from other humans.
- Final Results: At the end of all rounds, the game reveals the AI's identity and shows detailed statistics about detection success, player scores, and influence instructions.
- Real-Time Multiplayer: Uses Socket.IO for seamless interaction between players with instant updates.
- Player Room System: Create private game rooms with shareable codes for friends to join.
- Dynamic AI Player:
- Player-Influenced Behavior: Each player can submit instructions on how the AI should behave.
- Adaptive Responses: AI analyzes human answers and adapts its style to blend in better.
- Smart Naming: AI gets a name that fits stylistically with the human players' names.
- Strategic Voting: AI employs multiple strategies to vote for human players.
- Reconnection Support: Players can rejoin active games if they get disconnected.
- Detailed Game History: Complete round-by-round history of questions, answers, and voting patterns.
- Dual-Goal Social Deduction: Balance finding the AI with the possibility of winning through deception.
- Player-Generated Questions: Suggest topics for the game to create custom question prompts.
Note: This codebase was largely generated with Claude Code
- Backend: Node.js, Express.js, TypeScript
- Real-time Communication: Socket.IO
- Frontend: HTML5, Tailwind CSS 4.x, TypeScript
- AI: AWS Bedrock (openai.gpt-oss-120b-1:0 model via OpenAI-compatible API)
- Environment Variables:
dotenv - Code Quality: Biome (linting and formatting)
-
Clone the repository:
git clone https://github.com/yourusername/among-humans-io.git cd among-humans-io -
Install dependencies:
npm install
-
Create Environment File: Create a file named
.envin the project root. -
Configure AWS Bedrock:
Step 1: Generate a Bedrock API Key
- Open the AWS Bedrock Console
- Navigate to "API Keys" in the left sidebar
- Click "Create API Key"
- Choose either:
- Long-term key (30 days) - Good for testing and development
- Short-term key (up to 12 hours) - Recommended for production
- Save the generated API key securely (it won't be shown again!)
Step 2: Add Configuration to
.env# Required for the AI player functionality BEDROCK_API_KEY=your_bedrock_api_key_here AWS_REGION=us-west-2
- Important: Ensure the
.envfile is added to your.gitignorefile to avoid committing your API key! - Note: Your AWS account must have access to the
openai.gpt-oss-120b-1:0model in AWS Bedrock. - Security: Consider using short-term keys for production deployments
-
Ensure
.gitignore: Verify that.envandnode_modules/are listed in your.gitignorefile.
- Build the project:
npm run build
- Start the server:
npm start
- Access the game:
Open your web browser and navigate to
http://localhost:3000(or the port specified inserver.ts). - Invite friends or simulate multiple players:
- Share your room code with friends to play together
- Or open multiple browser tabs/windows pointing to the same address to simulate multiple players
This project is an actively developed social deduction game with the following features implemented:
- Complete game loop with room management, player reconnection, and round tracking
- Player-influenced AI behavior system
- Dynamic question generation based on player suggestions
- Detailed game statistics and history
- Scoring system rewarding both detection and deception
- Mobile-responsive UI
- Added reconnection support to allow players to rejoin active games
- Improved player count display (excluding AI players)
- Enhanced round history tracking and statistics
- Added URL-based navigation with room codes and player names
- Implemented more robust error handling
- Added visual feedback for game actions (votes, submissions, etc.)
- Added exit room functionality
This application is configured for deployment on AWS App Runner, which provides native WebSocket support required for Socket.IO real-time communication.
Prerequisites:
- AWS Account
- AWS CLI installed and configured
- Docker installed (for local testing)
Deployment Options:
-
Push your code to GitHub
git add . git commit -m "Add AWS App Runner configuration" git push origin main
-
Create App Runner Service
- Go to AWS App Runner Console
- Click "Create service"
- Choose "Source code repository" and connect to your GitHub repo
- Select the repository and branch (main)
- Build settings: Choose "Use a configuration file" and specify
apprunner.yaml - Or manually configure:
- Runtime: Node.js 22
- Build command:
npm install -g pnpm && pnpm install && pnpm run build:server && pnpm run build:client - Start command:
pnpm start - Port: 3000
-
Configure Environment Variables
- In the service configuration, add:
BEDROCK_API_KEY: Your AWS Bedrock API keyAWS_REGION: Your AWS region (e.g., us-west-2)NODE_ENV: production
- In the service configuration, add:
-
Deploy
- Click "Create & deploy"
- Wait for deployment to complete (~5-10 minutes)
- Access your app at the provided App Runner URL
Before deploying, test the Docker build locally:
# Build the image
docker build -t among-humans .
# Run the container
docker run -p 3000:3000 \
-e BEDROCK_API_KEY=your_key_here \
-e AWS_REGION=us-west-2 \
-e NODE_ENV=production \
among-humans
# Access at http://localhost:3000- More sophisticated AI response generation strategies
- Additional game modes and settings
- Persistent player profiles and statistics
- Enhanced mobile experience
- Expanded set of pre-generated question prompts
- Admin controls for game hosts
- More detailed analytics on player performance