A multiplayer horizontal shoot'em up (Shmup) game implemented in C++ with a client-server architecture.
- Overview
- Features
- Documentation
- Requirements
- Building
- Running the Game
- Project Structure
- Authors
- License
R-Type is a classic arcade-style horizontal scrolling shooter game reimagined as a modern multiplayer experience. The game supports up to 4 players simultaneously and features an authoritative server architecture for fair and synchronized gameplay.
- Multiplayer: Up to 4 players can play together
- Authoritative Server: Server maintains game state for fair gameplay
- Binary Protocol: Efficient UDP protocol for real-time gameplay
- Delta Compression: Optimized bandwidth with delta encoding and LZ4 compression
- Modular Engine: Reusable game engine with ECS architecture
- Cross-Platform: Supports Linux (primary) and Windows
- Horizontal scrolling star-field background
- Multiple enemy types with unique behaviors
- Boss battles at the end of each level
- Power-ups: Spread shot, Laser beam, Shield, Speed boost
- Force Pod companion
- Multiple levels
- Entity Component System (ECS) architecture
- Plugin-based module system
- TCP lobby for room management
- UDP game protocol for low-latency gameplay
- Client-side prediction with server reconciliation
- Delta encoding for bandwidth optimization
- LZ4 compression support
- UDP Game Protocol - Real-time game communication protocol
- TCP Lobby Protocol - Lobby and room management protocol
- Engine & ECS Documentation - Game engine architecture and ECS system
- Breakout Game - Proof of concept demonstrating engine reusability
- C++17 compatible compiler (GCC 9+, Clang 10+, MSVC 2019+)
- CMake 3.16 or higher
- vcpkg (included as submodule)
- SFML 2.6.2 (graphics, audio, window)
- Asio (networking)
- nlohmann-json (JSON parsing)
- LZ4 (compression)
git clone --recursive https://github.com/aernw1/r-type-mirror.git
cd r-type-mirror# Bootstrap vcpkg (first time only)
./vcpkg/bootstrap-vcpkg.sh
# Configure and build
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build . --parallel# Bootstrap vcpkg (first time only)
.\vcpkg\bootstrap-vcpkg.bat
# Configure and build
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=..\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake --build . --config ReleaseAfter building, the following executables are available in build/bin/:
| Binary | Description |
|---|---|
r-type_server |
Game server (lobby + game) |
r-type_client |
Game client |
breakout |
Breakout demo game |
cd build
./bin/r-type_serverThe server will:
- Start the lobby server on port 7777 (TCP)
- Dynamically allocate UDP ports for game sessions
cd build
./bin/r-type_client- Launch the client
- Enter your player name
- Create a room or join an existing one
- Wait for other players (1-4 players)
- All players must click "Ready"
- Host starts the game
| Key | Action |
|---|---|
| Arrow Keys | Move ship |
| Space | Fire weapon |
| Escape | Pause / Menu |
r-type-mirror/
├── README.md # This file
├── CMakeLists.txt # Root CMake configuration
├── vcpkg.json # vcpkg dependencies
├── vcpkg/ # vcpkg package manager (submodule)
├── assets/ # Game assets (sprites, sounds, levels)
│ ├── sprites/
│ ├── sounds/
│ └── levels/
├── client/ # Game client application
│ ├── include/
│ └── src/
├── server/ # Game server application
│ └── src/
├── libs/ # Shared libraries
│ ├── engine/ # Game engine (ECS, Core)
│ │ ├── include/
│ │ │ ├── Core/ # Engine core (Logger, Module system)
│ │ │ └── ECS/ # Entity Component System
│ │ ├── src/
│ │ └── README.md # Engine documentation
│ ├── network/ # Network library
│ │ ├── include/
│ │ │ ├── Protocol.hpp # Binary protocol definitions
│ │ │ └── ...
│ │ └── src/
│ ├── sfml_renderer/ # SFML rendering module
│ └── sfml_audio/ # SFML audio module
├── breakout/ # Breakout demo game
│ ├── src/
│ └── README.md
├── docs/ # Documentation
│ ├── RFC_UDP_PROTOCOL.md # UDP protocol specification
│ └── RFC_TCP_PROTOCOL.md # TCP protocol specification
└── tests/ # Unit tests
┌─────────────────────────────────────────────────────────────┐
│ CLIENT │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────────┐ │
│ │ Input │ │ Renderer │ │ Audio │ │ Network │ │
│ │ System │ │ (SFML) │ │ (SFML) │ │ Client │ │
│ └────┬────┘ └────┬─────┘ └────┬─────┘ └──────┬──────┘ │
│ │ │ │ │ │
│ └────────────┴─────────────┴───────────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ ECS │ │
│ │ Registry │ │
│ └─────────────┘ │
└───────────────────────────┬─────────────────────────────────┘
│ UDP (Game)
│ TCP (Lobby)
┌───────────────────────────┼─────────────────────────────────┐
│ │ │
│ ┌──────┴──────┐ │
│ │ ECS │ │
│ │ Registry │ │
│ └──────┬──────┘ │
│ │ │
│ ┌─────────────┐ ┌───────┴───────┐ ┌──────────────────┐ │
│ │ Lobby │ │ Game │ │ Systems │ │
│ │ Server │ │ Server │ │ (Collision, │ │
│ │ (TCP) │ │ (UDP) │ │ Movement...) │ │
│ └─────────────┘ └───────────────┘ └──────────────────┘ │
│ SERVER │
└─────────────────────────────────────────────────────────────┘
- Room creation and management
- Player session management
- Ready state synchronization
- Game start coordination
- Real-time game state synchronization
- Player input transmission
- Delta encoding for bandwidth optimization
- LZ4 compression for large packets
See RFC_UDP_PROTOCOL.md and RFC_TCP_PROTOCOL.md for detailed protocol specifications.
EPITECH Project - 2025
This project is part of the EPITECH curriculum.