A networked, multiplayer remake of the classic horizontal shoot'em up R-Type, built in C++20 on top of a custom game engine.
Up to four players connect to a central authoritative server and fight waves of Bydos together. The project is split into reusable layers (an ECS based game engine, a UDP networking library and a Vulkan sprite renderer) and the R-Type client and server that are built on top of them.
- About the project
- Supported platforms
- Requirements
- Quick start
- Building
- Usage
- Project layout
- Documentation and useful links
- Contributing
- Authors
- License
This repository contains two programs:
| Binary | Role |
|---|---|
r-type_server |
Authoritative, multithreaded game server. Runs the game simulation and replicates it to clients over UDP. |
r-type_client |
Graphical client. Renders the game, plays sounds and sends the player's inputs to the server. |
Main characteristics:
- Client and server architecture. The server owns the game state and the clients comply with its decisions.
- Binary protocol over UDP. All in-game communication (entities, movements, events) goes through a documented binary protocol.
- Custom game engine. Rendering, networking and game logic are decoupled subsystems built around an Entity Component System, a scene manager and an event bus.
- Data driven entities. Entities are described in JSON blueprints under
assets/descriptionEntity/, so new content does not require C++ changes. - Time based simulation. Movement, animation and scrolling are driven by the elapsed frame time, never by CPU speed.
The project is developed as part of the Epitech Advanced C++ curriculum.
| Platform |
|---|
| Linux (x64, arm64) |
| Windows (x64, arm64) |
| MacOS (x64, arm64) |
| Tool | Minimum version |
|---|---|
| C++20 compiler (GCC, Clang or MSVC) | C++20 support |
| CMake | 3.20 |
| vcpkg | any recent release |
GNU Make (optional, for the Makefile) |
any |
| Git, curl, zip, unzip, tar, pkg-config | any |
Only low level platform libraries are taken from the system. On Debian or Ubuntu they can be installed with:
sudo apt install build-essential cmake git curl zip unzip tar pkg-config \
libx11-dev libx11-xcb-dev libxcb1-dev libxrandr-dev libwayland-dev \
libvulkan1 mesa-vulkan-driversA GPU and driver with Vulkan support are required to run the client.
All other dependencies are downloaded automatically during the configure step. Nothing is vendored in the repository.
| Dependency | Purpose | Provided by |
|---|---|---|
| Asio | Asynchronous UDP networking | vcpkg |
| nlohmann/json | Entity blueprint loading | vcpkg |
| GLM | Math | vcpkg |
| miniaudio | Audio playback | vcpkg |
| stb | Image loading | vcpkg |
| Vulkan headers and loader | Rendering backend | vcpkg |
| rtk ECS | Entity Component System | CMake FetchContent |
| rtk graphical | Window, rendering, input, audio | CMake FetchContent |
The vcpkg manifest is vcpkg.json.
# 1. Install vcpkg once (skip if VCPKG_ROOT is already set)
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=~/vcpkg
# 2. Clone and build
git clone https://github.com/Savapitech/R-Type.git
cd R-Type
make
# 3. Run a server and a client, from the repository root
./bin/r-type_server &
./bin/r-type_clientThe VCPKG_ROOT environment variable must point to your vcpkg installation.
The first build takes longer because vcpkg compiles the dependencies; they are
cached for the following builds.
| Command | Effect |
|---|---|
make |
Configure and build in Release mode |
make debug |
Configure and build in Debug mode |
make clean |
Remove the CMake build directory |
make fclean |
Also remove the fetched libraries and the binaries |
make re |
Full rebuild |
make format |
Format the sources with clang-format |
make docs |
Build the documentation website in build/docs/html |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config ReleaseOn Windows, run the same commands from a Developer PowerShell for Visual
Studio, with VCPKG_ROOT set.
Both executables are written to the bin/ directory at the root of the
repository.
The binaries load their assets with paths relative to the working directory, so they must be started from the repository root.
./bin/r-type_server [port]| Argument | Description | Default |
|---|---|---|
port |
UDP port the server listens on | 4242 |
./bin/r-type_clientThe client currently connects to 127.0.0.1 on UDP port 4242. Start several
clients to play together, up to four players per game. Each player gets a
distinct ship color.
| Action | Keyboard | Gamepad |
|---|---|---|
| Move | Arrow keys | D-pad or left stick |
| Shoot | Space | Right trigger (R2) |
| Confirm (menu) | Enter | Cross / A |
.
├── assets/ Sprites, sounds and JSON entity blueprints
├── lib/
│ ├── GameEngine/ Engine core: ECS components, systems, scenes, event bus
│ └── Network/ UDP transport, packet framing, connections, server
├── src/
│ ├── Client/ r-type_client: scenes, input, rendering adapters
│ ├── Server/ r-type_server: game simulation and replication
│ └── Common/ Code shared by both sides: protocol payloads, gameplay systems
├── docs/ Documentation website: Doxygen configuration and guides
├── tests/ Unit and functionnals tests
├── CMakeLists.txt Build definition
├── Makefile Build shortcuts
└── vcpkg.json Dependency manifest
- Developer documentation:
architecture, engine and network guides, tutorials, technical study and
API reference. Build it locally with
make docs(requires Doxygen and Graphviz), the result is written tobuild/docs/html. - Network protocol specification: every packet and message exchanged between clients and the server.
- Issue tracker: bug reports and feature requests.
- Pull requests: ongoing work.
- rtk-lib/ECS and rtk-lib/graphical: the ECS and rendering libraries used by the engine.
- vcpkg documentation: help with the package manager.
Contributions follow a pull request workflow:
- Create a feature branch from
main. - Format the code with
make formatbefore committing. - Write commit messages that follow
Conventional Commits, for example
feat(server): broadcast monster spawns. The CI rejects commits that do not match the format checked by.github/scripts/check-commit-msg.sh. - Open a pull request against
mainand request a review from another team member.
Please open an issue before starting work on a large change.
| Name | Contact |
|---|---|
| Arthur Gauthier | Arthur-gtr |
| Titouan Hochet | Titouanhct |
| Enzo Iffis | eiffis |
| Savinien Petitjean | savalet |
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full text.
R-Type is a trademark of its respective owners. This project is a non-commercial educational remake and is not affiliated with or endorsed by them.