- ๐ฒ Dynamic Role Assignment: Players randomly assigned to Red/Blue Spymaster/Operative each game
- ๐ค Multi-LLM Tournament: GPT-4 vs Claude Sonnet head-to-head competition
- ๐ญ Personality-Driven AI: Risk tolerance, creativity, and confidence affect gameplay
- ๐ Real-Time Monitoring: Comprehensive web interface with live game tracking
- ๐ค ROS2 Distributed: Scalable, robust multi-node architecture
- ๐ฌ Research Ready: Perfect for AI model comparison and behavioral analysis
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ ๐ฎ Frontend โ โ ๐ญ Players โ โ ๐ค Isaac Sim โ
โ โ โ โ โ (Optional) โ
โ โข Game View โ โ โข Alice (GPT-4) โ โ โ
โ โข Admin Panel โ โ โข Bob (GPT-4) โ โ โข Robot Viz โ
โ โข Player Stats โ โ โข Charlie(Claudeโ โ โข Speech/TTS โ
โ โ โ โข Diana (Claude)โ โ โข Animations โ
โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โ โโโโโโโโโผโโโโโโโโ โ
โ โ โ โ
โโโโโโโโโโโโโโโถโ ๐ฏ Orchestratorโโโโโโโโโโโโโโโ
โ โ
โ โข Role Managerโ
โ โข Game Master โ
โ โข Turn Logic โ
โ โข Win Detectionโ
โโโโโโโโโโโโโโโโโ
- ๐ Startup: 4 AI players announce readiness
- ๐ฒ Role Assignment: Random team/role distribution each game
- ๐ฎ Gameplay: Turn-based Codenames with LLM-powered decisions
- ๐ Monitoring: Real-time performance tracking and visualization
- ๐ Results: Comprehensive game analysis and player statistics
- Linux Os
- Docker & Docker Compose
- OpenAI API key
- Anthropic API key (optional, for Claude players)
git clone <your-repo-url>
cd codenames_robotics
chmod +x start.shcp .env.template .env
# Edit .env with your API keys
nano .env# First time (with build)
./start.sh --build
# Subsequent runs
./start.sh
# Include Isaac Sim robots
./start.sh --isaac- ๐ฎ Game Interface: http://localhost:8080
- โ๏ธ Admin Panel: http://localhost:8080/admin
- ๐ฅ Player Stats: http://localhost:8080/players
- ๐ก API Status: http://localhost:8080/api/status
Set different AI models for competitive variety:
# In .env file
PLAYER1_MODEL=gpt-4 # Alice
PLAYER2_MODEL=gpt-4 # Bob
PLAYER3_MODEL=claude-3-5-sonnet-20241022 # Charlie
PLAYER4_MODEL=claude-3-5-sonnet-20241022 # DianaEach player has unique behavioral traits:
personality = {
'risk_tolerance': 0.7, # 0.0=conservative, 1.0=risky
'creativity': 0.8, # 0.0=basic, 1.0=creative
'confidence': 0.6 # 0.0=hesitant, 1.0=confident
}- OpenAI:
gpt-4,gpt-3.5-turbo - Anthropic:
claude-3-5-sonnet-20241022,claude-3-haiku-20240307
# ๐ Check system status
./start.sh --status
# ๐ View real-time logs
./start.sh --logs
# ๐งช Run connectivity tests
./start.sh --test
# ๐ Stop tournament
./start.sh --stop
# ๐งน Complete cleanup
./start.sh --clean
# ๐ง Force rebuild
./start.sh --build- Live Game Board: 5x5 Codenames grid with real-time updates
- Team Panels: Red vs Blue with assigned players
- Turn Tracking: Current team, remaining cards, game state
- Game Log: History of clues, guesses, and results
- System Metrics: Container health, ROS2 connectivity
- Player Monitoring: Individual AI status and performance
- Game Control: Start/stop games, reassign roles
- Performance Analytics: Success rates, response times
- Team Assignments: Current role distribution
- AI Personalities: Risk tolerance, creativity, confidence
- Performance Stats: Clues given, guesses made, accuracy
- Model Information: Which LLM each player is using
# Start with Isaac Sim support
./start.sh --isaac
# Configure in .env
ISAAC_SIM_HOST=localhost
ISAAC_SIM_PORT=8211
ISAAC_ENABLED=true- ๐ค Speech Synthesis: Robots announce clues and guesses
- ๐ค Gesture Control: Pointing, thinking, celebration animations
- ๐ฌ Scene Management: Dynamic board visualization
- ๐ Pose Tracking: Real-time robot position monitoring
codenames_robotics/
โโโ ๐ณ Docker Files
โ โโโ Dockerfile.base # ROS2 + AI dependencies
โ โโโ Dockerfile.frontend # Web interface
โ โโโ docker-compose.yml # Complete system
โ โโโ entrypoint.sh # Container initialization
โ
โโโ ๐ค ROS2 Package: src/codenames_game/
โ โโโ orchestrator_node.py # ๐ฏ Game master & role manager
โ โโโ player_node.py # ๐ญ Universal AI player
โ โโโ isaac_bridge_node.py # ๐ค Robot integration
โ โโโ game_logic.py # ๐ฒ Core Codenames rules
โ โโโ llm_client.py # ๐ง Multi-LLM interface
โ โโโ similarity_model.py # ๐ Word relationship analysis
โ
โโโ ๐ Frontend/
โ โโโ web_server.py # Flask + SocketIO server
โ โโโ templates/
โ โ โโโ index.html # Game interface
โ โ โโโ admin.html # Admin panel
โ โ โโโ players.html # Player monitoring
โ
โโโ ๐ Launch Files/
โ โโโ 4_player_launch.py # Full tournament system
โ โโโ game_launch.py # Basic game mode
โ โโโ isaac_launch.py # With robot simulation
โ
โโโ โ๏ธ Configuration/
โโโ .env.template # Environment template
โโโ game_config.yaml # Game rules & timing
โโโ llm_config.yaml # AI model settings
โโโ robot_config.yaml # Isaac Sim configuration
- Update LLM Client (
llm_client.py):
def _call_new_provider(self, prompt: str, model: str) -> str:
# Implement new API integration
pass- Configure Model (
.env):
PLAYER1_MODEL=new-model-name
NEW_PROVIDER_API_KEY=your_key_hereCreate specialized AI behaviors:
# Conservative player
conservative = {
'risk_tolerance': 0.2,
'creativity': 0.4,
'confidence': 0.6
}
# Aggressive player
aggressive = {
'risk_tolerance': 0.9,
'creativity': 0.8,
'confidence': 0.9
}GET /api/status # System status
GET /api/players # Player information
POST /api/start_game # Start new game// Real-time game updates
socket.on('board_update', (data) => { ... });
socket.on('role_assignments', (assignments) => { ... });
socket.on('player_status', (status) => { ... });
socket.on('game_status', (status) => { ... });# Game coordination
/game/board_state # Game board updates
/game/role_assignments # Player role distribution
/game/clue_request # Spymaster clue requests
/game/clue_response # Clue responses
/game/guess_request # Operative guess requests
/game/guess_response # Guess responses
# Player management
/game/player_1_status # Individual player status
/game/player_2_status # (one topic per player)
/game/player_3_status
/game/player_4_status
# Isaac Sim integration
/isaac/robot_commands # Robot control
/isaac/speech_commands # Text-to-speech
/isaac/scene_updates # 3D scene managementโ "API key not found"
# Check .env configuration
cat .env | grep API_KEY
# Restart containers after .env changes
./start.sh --stop && ./start.shโ "ROS2 nodes not communicating"
# Check ROS2 connectivity
docker-compose exec orchestrator ros2 node list
docker-compose exec orchestrator ros2 topic list | grep gameโ "Web interface not loading"
# Check frontend container
docker-compose logs frontend
# Verify port mapping
docker-compose psโ "Players not joining"
# Check player container logs
docker-compose logs player1
# Verify environment variables
docker-compose exec player1 env | grep PLAYER# Enable detailed logging
export LOG_LEVEL=DEBUG
./start.sh --build
# Access container shells
docker-compose exec orchestrator bash
docker-compose exec player1 bash