top of page
ChessCover.jpg

Chess Soul

Development Period: May 2025 - July 2025

Chess Soul is a networked multiplayer chess game, featuring TCP-based client-server architecture, complete chess rule validation, 3D piece rendering with multiple model sets, and real-time game state synchronization. The project demonstrates expertise in network programming, game state management, and 3D graphics.

Demo

Main Features

Network System

ChessSoul uses the NetworkSystem in IglooEngine, a TCP-based client-server architecture with unified codebase supporting both server and client modes, to support networked gameplay.

Dual-Mode Architecture

  • Single Executable Design: Same binary runs as either Server or Client based on startup configuration. Server listens on configurable port; Client connects to specified IP:Port.

  • NetworkSystem Manager: Central singleton handling socket initialization (WinSock2 WSAStartup), connection lifecycle, and mode switching. Provides IsServer()/IsClient() queries for game logic branching.

  • Non-Blocking I/O: Sockets configured with ioctlsocket(FIONBIO) for non-blocking operations. Game loop polls for data without stalling rendering.
     

NetworkConnection Structure

  • Socket Handle: Platform-specific SOCKET wrapper with connection state tracking (DISCONNECTED, CONNECTING, CONNECTED, ERROR).

  • Bidirectional Buffers: Dual std::deque<uint8_t> for send and receive queues. Outbound data queued immediately; flushed on next network tick. Inbound data accumulated until complete message received.

  • Message Framing: Length-prefixed protocol (4-byte header + payload). Handles TCP stream fragmentation—partial reads accumulated until full message available.

  • Heartbeat System: Periodic ping/pong messages detect stale connections. Timeout triggers automatic disconnect and reconnection attempt.
     

Server Implementation

  • Listen Socket: Binds to port, accepts incoming connections via accept(). Maximum 2 clients (White and Black players).

  • Client Management: Tracks connected clients with player assignment. First connection = White, second = Black. Spectator mode for additional connections (receive-only).

  • Authoritative Game State: Server validates all moves, maintains canonical board state, broadcasts state updates to all clients. Prevents cheating via client-side manipulation.

  • Broadcast System: Server relays validated moves and state changes to all connected clients simultaneously.
     

Client Implementation

  • Connection Flow: DNS resolution → TCP connect() → Handshake (send player info) → Wait for game start signal.

  • Optimistic Updates: Client applies moves locally for responsive feel, then validates against server response. Rollback on rejection.

Reconnection Logic: Automatic reconnection attempts on disconnect with exponential backoff. Rejoins game in progress if still active.

​

Command Protocol

Event-based message protocol with typed commands for all game operations.

OnlineChess_Network_Events.jpg

Game Rules & Interaction System

01

Chess Rules

BasicRules.gif

ChessSould completes implementation of FIDE chess rules with comprehensive move validation.

  • 25+ ChessMoveResult types covering all valid and invalid move cases

  • Piece-specific movement: Axial (Rook), Diagonal (Bishop), L-shape (Knight)

  • Path blocking detection for Rook, Bishop, and Queen

  • Special moves: Castling (kingside/queenside), En passant, Pawn promotion

  • Check detection: Validates moves don't leave own King in check

  • Raycast-based semi-legal move testing for UI feedback

03

Chess Match State Machine

ChessFlow.gif

Finite state machine managing the complete lifecycle of a chess match.

  • States: CONNECTING → SELECTING → PLAYING → OVER

  • ChessStatus: KISHI (player) or SPECTATOR mode

  • Turn management with currentMoveKishiIndex tracking

  • Event-driven state transitions (OnMatchStateChange, OnJoinGame)

  • Board state serialization for network sync and game reset

02

Chess Piece Interaction

GrabPiece.gif

Raycast-based piece selection and drag-drop movement with visual feedback.

  • First-person camera raycast against board AABB and piece meshes

  • ChessRaycastResult returns impacted ChessObject (piece or square)

  • Grab/Ungrab state with tint color feedback (OnImpacted, OnGrabbed)

  • Lerp-based smooth piece movement animation between coordinates

  • Promotion UI widget triggered on pawn reaching back rank

04

UI & Game Flow

ChessUIFlow.gif

Widget-based UI for menu navigation and in-game actions.

  • Game states: ATTRACT → LOBBY → PLAYING with smooth transitions

  • Lobby widgets: Remote/Local mode, Server/Client selection, Model set picker

  • In-game promotion widget for pawn upgrade selection

  • DevConsole integration for board state debugging

Other Solo (Individual) Projects

Lumina Global Illumination

RedCraft

bottom of page