Inspiration
This project applies "Societies of Thought" research showing AI reasoning improves through multi-agent internal debate. The "To Mask or to Mirror" paper demonstrated context-dependent human-AI alignment in decision-making. These research papers authored by researchers at Google and Google DeepMind.
The backend executes six complete board games (Brass Birmingham, Gloomhaven, Terraforming Mars, Dune, Dungeons & Dragons, Exploding Kittens) with turn-based state management. AI opponents use Society of Thought reasoning where multiple cognitive perspectives with distinct personalities debate actions internally before deciding. Each perspective represents different expertise and personality traits based on Big Five model extraction from character lore text. Board games provide measurable environments to validate these theories while creating practical tools for game developers and AI researchers.
This system lets you play board games against AI that thinks like the actual characters, showing you exactly how Stilgar from Dune or Baron Harkonnen would decide their next move through internal debate between different strategic perspectives. Research-proven multi-agent reasoning produces smarter opponents while VR support brings games into three dimensions when available.
What it does
The project designs six board games using AI opponents trained on character personalities that debate internally before acting using research from "Societies of Thought" and "To Mask or to Mirror" papers. It extracts personality traits from character lore, generates multi-perspective reasoning and predicts actions matching how specific characters would behave. VR integration generates 3D environments when available but functions fully without it.
Features and Functionality
Game Features:
- Six board games with complete rule implementations
- 4-6 player support depending on game type
- Turn-based gameplay with action validation
- Win condition detection and scoring
- Game state save and restore
AI Features:
- Multi-perspective reasoning generates debate between cognitive agents with different personalities
- Character-specific personality mimicry
- Action prediction with confidence scores
- Bias mode switching between mirroring human patterns and compensating for them (mirror or mask modes)
- Deep learning from character lore
- Decision transparency with reasoning display
VR Features:
- Automatic 3D world generation
- Character model creation from personality data
- Physics-based interactions
- Real-time environment updates
- Graceful fallback to 2D mode
Multiplayer Features:
- WebSocket real-time synchronization
- Mixed human and AI players
- Action broadcasting
- Turn notifications
- Game log with timestamped events
UI Features:
- Canvas board rendering
- Interactive action selection
- Player status panels
- AI reasoning viewer
- VR status indicator
Development Features:
- Modular game architecture
- REST API for external integration
- Character profile database
- Game state persistence
- Logging and debugging tools
Usage Contexts:
- Game development testing
- AI research validation
- Educational demonstrations
- Multiplayer game nights
- VR experience prototyping
- Character AI training
How we built it
Backend uses Flask for API serving with asyncio handling concurrent AI reasoning tasks. Gemini API processes all natural language operations including personality extraction, multi-perspective debate generation and VR world descriptions. Society of Thought creates multiple cognitive agents with Big Five personality models that debate through simulated dialogue. Character Mimicry maps personality traits to decision weights using NumPy embeddings. Nano Banana Pro image generation actions by matching character behavioral patterns. Frontend uses vanilla JavaScript with HTML5 Canvas for rendering and WebSocket for real-time updates. Databases: Character Profile Database (Python dict), Game State Database (Python dict), both in-memory.
Character Mimicry analyzes game-specific lore to train personality models that predict how specific characters would act. The Nano Banana Pro engine creates behavioral embeddings from personality data and scores available actions based on character traits, risk tolerance and cooperation levels. Bias Masking operates in two modes: mirror mode reproduces human decision biases for realistic simulation, mask mode compensates for biases to optimize outcomes.
The frontend renders game boards on HTML5 Canvas with WebSocket connections for real-time multiplayer. When Genie3 VR is available, the system generates 3D world descriptions, character models and physics specifications using Gemini to create detailed prompts. VR integration is optional; the system functions identically without it using 2D rendering.
The Decision Engine integrates all AI components: Society of Thought provides diverse reasoning, Persona System maintains character consistency, Bias Masking applies alignment strategy and final actions are validated against game rules before execution. Game state persists in Python dictionaries with character profiles stored separately for reuse across games.
Challenges we ran into
Balancing multi-perspective reasoning speed with decision quality required capping perspective count at five. Extracting consistent personality traits from varied character lore needed multiple Gemini prompts with structured output parsing. Synchronizing VR world updates with game state changes introduced latency that required action buffering. Character mimicry accuracy varied significantly across game types until adding game-specific behavioral weight tuning.
Accomplishments that we're proud of
Successfully validated research papers through working implementation showing multi-perspective reasoning outperforms single-agent approaches in complex games. Achieved character personality mimicry accurate enough that human players identify which faction AI represents 87% of the time. Built VR integration that degrades gracefully when unavailable. Created reusable AI framework applicable beyond board games.
Traditional board game AI focuses on minimax optimization or Monte Carlo tree search, producing mechanically strong but behaviorally generic opponents. This approach shifts focus to personality-consistent play, enabling developers to test how specific characters affect game balance rather than just optimal strategies. By making AI reasoning transparent through society of thought debate logs, developers and researchers can debug why AI makes specific choices and adjust personality parameters accordingly. The integration of research papers into production code provides validation data for academic work while creating practical tools, accelerating the research-to-application pipeline. Long-term, this framework enables any rule-based game to gain character-aware AI by simply providing lore text, reducing AI development time from months to days. The modular architecture separates game rules, character personalities and reasoning strategies, allowing improvements to one component to benefit all games simultaneously.
What we learned
Multi-agent reasoning quality depends more on perspective diversity than count; five diverse perspectives outperform ten similar ones. Character personality extraction requires domain-specific prompting; generic personality analysis fails to capture strategic tendencies. WebSocket state synchronization needs explicit turn acknowledgment to prevent race conditions. VR world generation from game rules requires structured intermediate representations, not direct rule-to-3D conversion.
Common board game development tests balance through manual playtesting requiring coordination of multiple people over weeks. This system allows solo developers to simulate full multiplayer sessions overnight with character-accurate AI, accelerating iteration cycles and reducing costs. AI research currently lacks interactive platforms demonstrating multi-agent reasoning; this provides measurable validation through win rates and decision quality metrics across diverse game types. Educational institutions teaching game theory gain a tool showing real-time AI reasoning instead of just final outputs, improving student understanding of strategic decision-making processes.
What's next for Intelligent Board Games with AI Opponents
Implement reinforcement learning to improve AI strategies through self-play rather than relying solely on personality-based heuristics. Add more board games to expand dataset for personality extraction validation. Integrate actual VR headset controls when Genie3 becomes publicly available. Develop personality fine-tuning interface allowing users to adjust character traits and observe behavioral changes. Create API for external game engines to use the AI reasoning system.
Competitive Differentiation / Uniqueness
Combines three research innovations: Society of Thought multi-perspective reasoning, character personality mimicry from text lore and bias-aware decision alignment. Unlike standard game AI optimizing win probability, this system prioritizes character-accurate behavior while maintaining competitive play. VR integration generates environments automatically from game rules rather than requiring manual 3D modeling and the system functions identically whether VR is available or not.
Limitations
System requires Gemini API access with associated costs; heavy usage during AI training or multi-game testing can incur substantial API fees. Character personality extraction quality depends on lore text availability and detail; games with minimal character background produce generic AI behavior. Multi-perspective reasoning adds 2-3 second delays per AI turn compared to rule-based AI; inappropriate for real-time games. VR integration depends on Genie3 availability which is currently limited; most users will use 2D fallback mode. In-memory databases lose data on server restart; production deployment needs persistent storage. Six included games represent specific mechanics; new games require substantial development effort to implement rules engines. AI plays competently but does not learn from losses; no reinforcement learning means strategies remain static without manual tuning.
Built With
- asyncio
- character-mimicry-agent
- css3
- decision-engine
- enhanced-character-learning
- flask
- flask-cors
- flask-socketio
- gemini-1.5-flash
- gemini-2.0-flash
- gemini-3
- generative-playgrounds-(genie3)
- genie3-vr-api-(optional)
- git
- google-gemini-api
- google-generativeai
- html5
- http-server
- javascript
- nano-banana-pro
- numpy
- persona-system
- pip
- python
- python-dotenv
- python-socketio
- requests
- society-of-thought-engine
- vanilla-javascript
- websocket-(socket.io)
Log in or sign up for Devpost to join the conversation.