Skip to content
md ~/projects/casus-oyunu
Project archive

2025Live

Spy Game

  • C#
  • ASP.NET Core MVC
  • SignalR
  • Redis
  • PostgreSQL
  • Entity Framework Core
  • Docker

Overview

A real-time spy party game for 3 to 12 players, each on their own phone. Play together or apart: apart, questions are typed in turn and the room gets a chat. Join with a room code or a QR code, secret cards that show only while held, a choosable list of 102 places, live voting, optional accounts and a weekly leaderboard.

01 · Problem

In a spy game each player must see only their own card, several rooms must play at once, and every action must reach everyone immediately. Friends who were not in the same place could not play at all, and when one person kept asking the first question, the game felt unfair.

02 · Solution

The game state is kept per room in Redis, and simultaneous actions are saved safely with Lua scripts. The rules run on the server, and SignalR sends each player only what they may see; the place never reaches the spy's device. Playing apart, questions are typed in turn: the asker picks someone, and whoever answers takes the turn. The room also gets a chat; both live in a bottom sheet built for phones that never loses what you are typing when others write. The first question skips the last two first askers. Between rounds the host can strike places out, hide chat lines and remove players. Accounts use ASP.NET Core Identity, and the weekly leaderboard uses Redis and PostgreSQL.

03 · Outcome

A live game that up to 12 players can play in one room, together or apart. Its randomness was measured over 100,000 rounds of the real engine: spy and first asker came out at 20% for everyone. It has 177 automated tests, some of which play whole rounds over real connections.