RACOON-IN-THE-HOLE
Real-time online multiplayer hide-and-seek game. Players are divided into seekers and hiders, enjoying tag in a limited space, and can use various items for dynamic hide-and-seek gameplay.
프로젝트 개요
A real-time multiplayer game that recreates the nostalgic memories of playing flash games with friends during breaks in school computer labs.
Beyond simple game implementation, this project focused on building a server architecture capable of stably handling 300+ concurrent users and a WebSocket-based communication system for real-time synchronization. By introducing a Server-Authority model, we ensured cheat prevention and game state consistency, while maximizing network efficiency through event-based broadcasting.
As a backend developer, this was a valuable experience implementing and optimizing core server-side technologies such as concurrency control in real-time multiplayer environments, token-based authentication systems, and game lifecycle management using state machines.
나의 역할
Server-authority 모델 도입으로 한 게임을 같이 즐기는 클라이언트들의 요청을 서버에서 통제하여 일관된 환경 유지
게임 진행 라이프 사이클 구현 (게임 시작, 진행, 종료 관리)
WebSocket을 활용한 실시간 멀티플레이어 동기화
아이템 효과 시스템 구현: 아이템 효과 로직, 적용 메커니즘, 지속 시간 관리, 우선순위 알고리즘 개발
인증/인가 시스템 구현
전적 집계 및 통계 시스템 개발: 쿼리 튜닝 및 인덱스 최적화를 통한 대량 데이터 조회 성능 향상, 커서 기반 페이징으로 offset 기반 페이징의 성능 문제 해결, 배치 작업 최적화를 통한 통계 집계 처리
맵 축소 전략 및 게임 밸런스 로직 개발
Selenium을 활용한 자동 QA 테스트 구현 (Web 기반 게임의 기능 및 성능 검증)
기술적 도전과제
Handling High Concurrent Users
Designed server architecture to handle 300+ concurrent users. Separated game logic from network I/O to eliminate bottlenecks and efficiently utilized CPU resources through asynchronous processing and thread pool optimization. Also implemented concurrency control mechanisms to stably handle multiple user requests.
Maintaining Game State Consistency and Preventing Cheating
Introduced centralized game logic management to maintain consistent game states even when multiple clients send simultaneous requests. Designed the system to process all game logic on the server with clients only sending inputs, preventing client manipulation and ensuring the same game state for all players.
Minimizing Real-time Sync Latency and Network Load
Optimized to selectively broadcast only to necessary players on game state changes. Adopted event-based updates instead of frame-based updates, significantly reducing network traffic and latency.
Item Effect Priority and Conflict Resolution
Designed a priority algorithm for when multiple item effects are applied simultaneously. Defined item effect stack management, duration tracking, and application order to maintain consistent game balance. Implemented effect application based on priority when triggered simultaneously, and efficiently merged duplicate effects.
QA Efficiency for Web-based Game
Leveraged web-based game characteristics to implement automated testing using Selenium. Automated E2E tests for key features such as game flow, login/logout, and game creation/participation, significantly reducing manual testing time and ensuring quality before deployment.
프로젝트 성과
Locust load test: Achieved p95 latency of 50ms for game state synchronization APIs with 1000 concurrent users scenario
Attracted 300+ actual concurrent users
Achieved 99.9% server uptime, implemented Server-Authority architecture to prevent cheating
기술 선택 이유
Spring Boot
A proven framework for enterprise-grade web applications, offering excellent REST API and WebSocket/STOMP support along with a rich ecosystem and stability. Particularly effective for implementing authentication/authorization systems through Spring Security and efficiently managing thread pools for concurrency control.
WebSocket + STOMP
In multiplayer games where real-time bidirectional communication is essential, WebSocket provides low latency and persistent connections. By utilizing the STOMP protocol, we implemented a topic-based pub-sub pattern, enabling granular message broadcasting at Room/Game/Player/Team levels. We secured the system by applying token-based authentication to STOMP headers.
MySQL
Relational database for reliably storing and managing structured data such as user information, room data, and match history. Ensures data consistency through transaction support and provides fast query performance through indexing.
Java (ConcurrentQueue, Thread Pool)
Utilized Java's concurrent collections and Executor framework to implement safe and efficient asynchronous request processing in a multithreaded environment. Built a thread-safe task queue using ConcurrentQueue and optimized CPU resources through Thread Pool to achieve high concurrency.
Phaser.js
A JavaScript framework specialized for browser-based game development, simplifying complex game logic such as rendering, physics engine, and input handling. Provides friendly pixel art graphics and can be integrated with WebSocket to visualize server game states in real-time.
시스템 아키텍처
Click to enlarge.Client-Server Interaction Architecture

Client-server communication flow from room entry to game start: Initial authentication and token issuance via HTTP, real-time game state synchronization via STOMP over WebSocket
Game Flow Architecture

Complete game flow: Room creation and entry, ready state management, game start and progression (hide/seek), game lifecycle through win/loss determination
성능 최적화
Asynchronous Request Processing Optimization
Built an asynchronous request processing system using Java's ConcurrentQueue and Thread Pool. Separated game logic from network I/O to eliminate bottlenecks and optimized CPU resources through thread pools, enabling stable handling of 300+ concurrent users.
Event-based Broadcasting
Adopted event-based updates instead of frame-based updates, significantly reducing network traffic. Optimized to selectively broadcast only to necessary players on game state changes, achieving p95 latency of 50ms.
데이터베이스 최적화
Query Tuning and Index Optimization
Optimized query performance through execution plan analysis when developing match history aggregation and statistics systems. Improved bulk data query performance by adding appropriate indexes and resolved performance issues of offset-based pagination by applying cursor-based pagination.
Concurrency Control and Transaction Management
Utilized MySQL's MVCC (Multi-Version Concurrency Control) and transaction isolation level (READ COMMITTED) to ensure data consistency during concurrent game state updates. Implemented distributed concurrency control by appropriately combining optimistic and pessimistic locks.
API 설계
Designed a consistent API structure following RESTful API design principles. Provided intuitive APIs using resource-centered URL structures and appropriate HTTP methods (GET, POST, PUT, DELETE). Also standardized error response formats to enable clients to easily handle errors.
보안 구현
Token-based Authentication System
Implemented a token-based authentication system using JWT (JSON Web Token). Enhanced security by adding token expiration times and refresh token mechanisms, and performed authentication during WebSocket connections by including tokens in STOMP headers.
Server-Authority Architecture
Introduced a Server-Authority model where all game logic is processed on the server to prevent client manipulation. Clients only send inputs, and the server calculates all game states to ensure the same game state for all players.
테스트 전략
Implemented automated QA testing using Selenium to verify functionality and performance of web-based games. Automated E2E tests for key features such as game flow, login/logout, and game creation/participation, significantly reducing manual testing time and ensuring quality before deployment. Also validated concurrent user handling capabilities through load testing using Locust.
KPT 회고
Keep
Centralized game logic management through the Server-Authority model maintained consistent game states even when multiple clients sent simultaneous requests. Achieved p95 latency of 50ms by minimizing network load through event-based broadcasting and selective message delivery.
It was a valuable learning experience to implement various technologies including randomness algorithms, state machines, token-based authentication, and asynchronous processing within a single project.
Problem
In the process of focusing on technical implementation and performance optimization, we lacked consideration for the originality of gameplay mechanisms or differentiation of user experience.
We failed to clearly define the core fun elements and differentiation points of the game early on, and lacked a process to collect user testing and feedback from the beginning of the project.
Try
In the game planning stage, I will ask 'Why would this game be fun?' and invest more time in competitor analysis and gameplay loop design.
Before selecting the tech stack, I would like to apply a 'gameplay-centered development methodology' that first defines the core fun elements and then selects optimal technology accordingly.
I will conduct playtests with acquaintances from the prototype stage and create a continuous improvement cycle by introducing metrics to quantitatively measure 'fun'.