← Selected work Real-time product · Multiplayer systems

Battle 2048

A real-time PvP adaptation of 2048 where two players develop separate boards and attack each other by converting their own tiles into damage.

SystemClient + realtime server
Interface13 languages
DataPersistent match statistics
Live productPlay online ↗
Battle 2048 live match with player and opponent boards, health indicators, and a damaged board cell
Challenge

Turn a solitary puzzle into a synchronized contest.

Competitive play adds simultaneous input, shared combat state, disconnects, rematches, matchmaking, AI opponents, and animations that must remain consistent with server state.

System

Separate product interaction from match authority.

A Next.js client owns interaction, animation, localization, and domain-based UI state. A dedicated Node.js and Socket.IO service owns rooms, game rules, concurrent actions, rate limits, and match lifecycle. Supabase stores users, history, statistics, server registry, and operational metrics.

Engineering decisions

Design explicitly for concurrency and recovery.

Serialized actions per room.

A FIFO action queue prevents simultaneous socket events from racing and corrupting either board.

Client-side board diffing.

The interface compares previous and current board state to classify spawns, movement, attack removal, and persistent tile identities.

Adaptive AI behavior.

Difficulty changes heuristic weights, attack thresholds, lookahead depth, choice randomness, and human-paced timing rather than applying a simple speed multiplier.

Incremental leaderboard statistics.

Postgres updates period aggregates when a game is recorded, avoiding a full-history aggregation for every leaderboard request.

Product evidence

Interaction follows a clear information hierarchy.

Battle 2048 home screen with region, language, quick game, friends, and leaderboard controls
Entry point. Region selection, localization, quick matchmaking, private matches, and leaderboards share one focused start screen.
Battle 2048 match showing both players and their synchronized boards
Live match. Both boards and health states remain visible while the player’s board keeps interaction priority.
Battle 2048 match after an attack with reduced health and a blocked board cell
Responsive combat state. The player’s full interactive board remains primary; the opponent’s board is secondary context and may crop when vertical space is limited. Health and blocked cells preserve the information needed for the next move.
Technology

Stack

  • Next.js 15
  • React 19
  • Node.js
  • Socket.IO
  • Supabase
  • Zustand
  • Framer Motion
  • next-intl
  • Fly.io