ConnX4

Real-Time Multiplayer Connect 4 Game

ROLE

Full Stack Developer

TIMELINE

Jul - Aug 2024

FRONTEND

Go

BACKEND

WebSockets

Docker

Kubernetes

Azure

ConnX4 game interface showing Connect 4 gameplay

Project Overview

ConnX4 is a real-time multiplayer Connect 4 game developed in Go, featuring a cross-platform GUI client and a WebSocket-based server. The project demonstrates modern software architecture principles with containerization using Docker and deployment on a Kubernetes cluster for scalability and reliability.

The game allows players from anywhere in the world to connect and play Connect 4 in real-time, providing a seamless gaming experience across Windows, macOS, and Linux platforms through the Fyne GUI framework.

Real-Time Multiplayer

ConnX4 implements true real-time multiplayer gameplay using WebSocket communication protocols for instant, bidirectional data exchange between clients and server. Players can connect to matches instantly across Windows, macOS, and Linux platforms through Go's Fyne GUI framework, which provides native performance while maintaining a single, portable codebase.

The game features comprehensive matchmaking capabilities, room creation, and spectator modes with live game state synchronization. The cross-platform architecture eliminates OS-specific development overhead while ensuring consistent user experience and feature parity across all supported operating systems.

Scalable Server Infrastructure

The server is containerized using Docker and deployed on Azure Kubernetes Service (AKS), enabling automatic scaling based on player demand. The Kubernetes deployment utilizes Horizontal Pod Autoscaling (HPA) to dynamically adjust server capacity based on current load and ensure consistent performance during peak usage.

The containerized architecture allows for easy deployment, updates, and rollbacks while maintaining high availability. The Azure deployment provides global accessibility with a public IP address, allowing players from anywhere to connect to the game servers.

Technical Implementation

The server architecture leverages Go's goroutines and channels for handling concurrent player connections, with each game room managed by dedicated goroutines that coordinate WebSocket message broadcasting. The implementation uses Go's net/http package for WebSocket upgrades and custom JSON message protocols for game state management, move validation, and player synchronization.

Deployment utilizes Docker multi-stage builds for optimized container images, deployed on Azure Kubernetes Service with YAML manifests defining pod specifications, service discovery, and ingress controllers. The infrastructure includes Redis for session management, Azure Load Balancer for traffic distribution, and Kubernetes HPA configured with CPU/memory metrics for automatic scaling based on concurrent player load.

Impact and Learning Outcomes

Developing ConnX4 significantly enhanced my expertise in Go programming, distributed systems architecture, and cloud-native application deployment. The project provided hands-on experience with containerization technologies and Kubernetes orchestration in a production environment.