Skip to content

Repository files navigation

Multiplayer Battle Architecture

A C++ multiplayer room battle architecture that separates the server-authoritative game logic from the Unreal Engine presentation layer.

Highlights

  • Implements a WinSock-based TCP command server and console client for account, matchmaking, session, game action, and state query flows.
  • Abstracts game modes through IGameMode, GameModeFactory, and BattleRoom, allowing different room modes such as strategy battle and racing duel to share the same session layer.
  • Runs server-authoritative room logic with a fixed 60 Hz tick, including unit movement, attack, healing, resources, cooldowns, and win/loss detection.
  • Uses a matchmaking thread to group players by requested mode and score, create battle rooms, and clean up disconnected sessions.
  • Persists users, battle records, session records, scores, wins, and losses through MySQL, with transactional updates for match results.
  • Broadcasts UESTATE snapshots through UDP so Unreal Engine can render actors, positions, teams, health bars, and base state without owning core game logic.

Repository Layout

Server1/        C++ WinSock server, matchmaking, room runtime, MySQL persistence
Client1/        C++ console client and command protocol integration
UE_MyProject/   Unreal Engine C++ state reader and UDP-driven presentation sync

Database Configuration

The server reads MySQL settings from environment variables:

GAME_DB_HOST
GAME_DB_USER
GAME_DB_PASSWORD
GAME_DB_NAME
GAME_DB_PORT

If not provided, the server uses local development defaults: 127.0.0.1, root, empty password, game_db, and 3306.

About

C++ WinSock multiplayer room battle architecture with MySQL persistence and Unreal Engine UDP state sync.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages