Inspiration
Coup was inspired by classic social deduction games where players must make decisions with incomplete information.
Bluffing, hidden roles, and uncertainty create a unique environment for studying human behavior, trust, and strategic thinking.
I wanted to build not just a playable game, but a clean and extensible system that could later support AI agents, spectators, and analytics — turning a social game into an experimental platform.
What I learned
Through this project, I learned how to design a deterministic game engine that stays fully decoupled from UI and networking layers.
Handling real-time multiplayer synchronization, turn-based state transitions, and edge cases like reconnection and game recovery was a major focus.
I also explored how small UX details — such as logs, visual feedback, and subtle animations — significantly affect player understanding and engagement in complex games.
How I built it
The core of Coup is a framework-agnostic TypeScript game engine that defines all game rules, actions, and state transitions.
This engine is shared across clients and communicates through a real-time Socket.io server.
The frontend is web-first and mobile-friendly, with a responsive UI, internationalization (English and Chinese), and a clean separation between game logic and presentation.
The architecture allows the same engine to be reused for future mobile apps or AI-driven players.
Challenges
One of the biggest challenges was maintaining consistent game state across multiple clients while supporting reconnections and partial updates.
Another challenge was designing UI interactions that remain intuitive on both desktop and mobile for a complex turn-based game.
Balancing technical correctness with a smooth and enjoyable user experience required multiple iterations and careful design decisions.
Built With
- css3
- html5
- node.js
- react
- socket.io
- tailwind-css
- typescript
- vite
- websockets
Log in or sign up for Devpost to join the conversation.