A custom game engine featuring a networked 4-player R-Type clone implementation.
Version: 1.0.0 Author: EPITECH Team
rtype is a 7-week academic project delivering a custom game engine with networked multiplayer capabilities, demonstrated through a 4-player R-Type clone. The engine follows Hexagonal Architecture (Ports & Adapters pattern) with custom implementations of core systems:
- Custom ECS (Entity Component System) with sparse set storage
- Custom UDP networking stack with client-side prediction
- Custom 3D math library (Vector2/3/4, Matrix4, Quaternion)
- SFML integration for graphics, audio, and input (adapter layer only)
- Hexagonal Architecture: Clean separation between domain logic and frameworks
- Custom Core Systems: ECS, networking, math library (no external game engines)
- Client-Side Prediction: Server-authoritative multiplayer with snapshot optimization
- Cross-Platform: Linux (Ubuntu 22.04+, Fedora 38+) primary, Windows (MSVC) stretch goal
- Modern C++17: Stable language standard with broad compiler support
- Build Performance: Full rebuild < 5 minutes, incremental build < 30 seconds
Linux (Ubuntu 22.04+ / Fedora 38+):
Ubuntu/Debian:
sudo apt update
sudo apt install -y \
cmake \
g++-10 \
git \
ninja-buildFedora:
sudo dnf install -y \
cmake \
gcc-c++ \
git \
ninja-build- CMake: 3.20+ (
cmake --version) - GCC: 10+ or Clang: 12+ (
g++ --versionorclang++ --version) - Git: 2.30+ (
git --version)
All dependencies are automatically downloaded via CPM (CMake Package Manager) - no manual installation required:
- SFML 2.6.1: Graphics, Audio, Window, Input (adapter layer only)
- Google Test: Unit testing framework (main branch)
- nlohmann/json v3.11.3: JSON parsing for config and level files
Custom implementations (NO external dependencies):
- ECS (Entity Component System) - Custom sparse set storage
- UDP Networking - Custom reliability layer with binary protocol
- 3D Math Library - Vector2/3/4, Matrix4, Quaternion
- Logging - Custom thread-safe logger with levels
git clone https://github.com/EpitechPGE3-2025/G-CPP-500-LYN-5-2-rtype-9.git
cd rtypeUsing Make (default):
cmake -B build -DCMAKE_BUILD_TYPE=ReleaseUsing Ninja (faster builds):
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=ReleaseDebug build (with assertions, no optimizations):
cmake -B build -DCMAKE_BUILD_TYPE=DebugOptional: Use CPM source cache (speeds up rebuilds, recommended for team development):
export CPM_SOURCE_CACHE=$HOME/.cache/cpm
cmake -B build -DCMAKE_BUILD_TYPE=ReleaseAdd to ~/.bashrc or ~/.zshrc for persistence:
echo 'export CPM_SOURCE_CACHE=$HOME/.cache/cpm' >> ~/.bashrcParallel build (recommended):
cmake --build build -j$(nproc)Single-threaded build:
cmake --build buildRun all tests:
cd build && ctest --output-on-failureOr directly:
./build/bin/rtype_testsServer:
./build/bin/r-type_serverClient:
./build/bin/r-type_client| Target | Type | Description | Dependencies | Output |
|---|---|---|---|---|
rtype_engine |
Static Library | Core engine library (domain, adapters, application) | nlohmann/json | build/lib/librtype_engine.a |
r-type_server |
Executable | Headless server (no SFML graphics) | rtype_engine, SFML System | build/bin/r-type_server |
r-type_client |
Executable | Client with SFML graphics/audio/window | rtype_engine, SFML (all modules) | build/bin/r-type_client |
rtype_tests |
Executable | Google Test suite (placeholder tests) | rtype_engine, Google Test | build/bin/rtype_tests |
rtype/
├── CMakeLists.txt # Root CMake configuration
├── cmake/ # CMake utility modules
│ ├── CPM.cmake # CPM v0.42.0 package manager
│ ├── CompilerWarnings.cmake # Compiler warning configuration
│ └── Sanitizers.cmake # ASan/UBSan configuration
│
├── include/rtype_engine/ # Public headers (Hexagonal Architecture)
│ ├── domain/ # Pure business logic (NO external dependencies)
│ │ ├── core/ # Custom ECS (Entity, Component, System, ECS registry)
│ │ ├── math/ # Custom 3D math library (Vector, Matrix, Quaternion)
│ │ ├── physics/ # Physics engine (collision, spatial grid)
│ │ └── game/ # R-Type game domain logic
│ ├── ports/ # Abstract interfaces (IRenderer, INetworkManager, etc.)
│ ├── adapters/ # Concrete implementations (SFMLRenderer, UDPSocket, etc.)
│ ├── application/ # Orchestration layer (Engine, ServerApp, ClientApp)
│ └── utils/ # Cross-cutting utilities (Logger, Random, Config)
│
├── src/ # Implementation files
│ ├── domain/ # Domain implementations (pure C++)
│ ├── adapters/ # Adapter implementations (SFML, networking)
│ ├── application/ # Application layer
│ ├── server/ # Server executable entry point
│ └── client/ # Client executable entry point
│
├── tests/ # Test files
│ ├── domain/ # Unit tests for domain logic
│ ├── adapters/ # Tests for adapter implementations
│ ├── integration/ # Integration tests
│ └── mocks/ # Mock adapters for domain testing
│
├── assets/ # Game assets
│ ├── sprites/ # Sprite images (PNG)
│ ├── audio/ # Audio files
│ │ ├── sfx/ # Sound effects (WAV)
│ │ └── music/ # Background music (OGG)
│ └── levels/ # Level definitions (JSON)
│
└── docs/ # Documentation
├── architecture.md # Architecture decisions
├── prd.md # Product requirements
└── sprint-artifacts/ # Sprint planning and stories
| Platform | Compiler | Status | Notes |
|---|---|---|---|
| Linux (Ubuntu 22.04+) | GCC 10+ | ✅ Supported | Primary development platform |
| Linux (Fedora 38+) | GCC 11+ | ✅ Supported | Tested platform |
| Linux (Ubuntu 22.04+) | Clang 12+ | ✅ Supported | CI validation |
| Windows (MSVC 2019+) | MSVC | 🔧 Stretch Goal | Part 2 (Week 5-7) |
Error: CMake 3.20 or higher is required
- Solution: Update CMake via package manager or download from cmake.org
Error: No CMAKE_CXX_COMPILER could be found
- Solution: Install GCC or Clang:
sudo apt install g++orsudo apt install clang
Error: Failed to download dependency from GitHub
- Solution: Check network connection. CPM downloads dependencies from GitHub at build time.
- Workaround: Use CPM_SOURCE_CACHE to cache dependencies locally (see Build Instructions)
Error: Compiler warnings treated as errors
- Solution: Fix the warning or temporarily disable
-Werrorin CMakeLists.txt (not recommended)
Optimization: Use Ninja generator for faster builds:
cmake -B build -G NinjaOptimization: Enable parallel builds:
cmake --build build -j$(nproc)Optimization: Use CPM source cache to avoid re-downloading dependencies:
export CPM_SOURCE_CACHE=$HOME/.cache/cpm- C++ Standard: C++17 (ISO/IEC 14882:2017)
- Naming Conventions:
- Files:
PascalCase.hpp/PascalCase.cpp - Classes:
PascalCase(e.g.,GameState,PhysicsEngine) - Functions:
camelCase(e.g.,getEntity(),drawSprite()) - Variables:
camelCase(e.g.,entityId,deltaTime) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_ENTITIES,TARGET_FPS) - Member variables:
camelCase_with trailing underscore - Namespaces:
snake_case(e.g.,rtype::domain::core)
- Files:
- Header Guards: Use
#pragma once - Compiler Warnings:
-Wall -Wextra -Werrorenabled (zero-tolerance for warnings)
This project follows a feature branch workflow with pull requests and code reviews. All development happens on feature branches, and changes are merged to the main branch through pull requests after peer review.
Branch Protection:
mainbranch is protected and always stable (deployment-ready)- No direct commits to
mainallowed - All changes must go through pull requests
- Minimum 1 approval required before merge
- CI must pass before merge
Workflow:
- Create feature branch:
git checkout -b feature/story-X-Y-brief-description - Make changes and commit with conventional format
- Push branch:
git push origin feature/story-X-Y-brief-description - Create pull request via GitHub
- Wait for review and CI validation
- Merge to
mainafter approval
For detailed Git workflow guidelines, see CONTRIBUTING.md.
Project Timeline: 7 weeks (Part 1: Weeks 1-4, Part 2: Weeks 5-7) Team Size: 5 developers Methodology: Agile with 2-week sprints
Roles:
- Architect/Tech Lead: Architecture decisions, technical design, code review
- Build Engineer: CMake, CI/CD, package management, build performance
- Core Systems Developer: ECS, math library, physics engine
- Network Engineer: UDP protocol, client-side prediction, multiplayer
- Graphics/Game Developer: Rendering, game logic, SFML integration, R-Type gameplay
We welcome contributions from all team members! To contribute:
- Read the guidelines: See CONTRIBUTING.md for detailed workflow
- Pick a story: Check sprint-status.yaml for available stories
- Create feature branch: Follow naming convention (feature/story-X-Y-description)
- Implement and test: Write code, add tests, ensure all tests pass
- Submit pull request: Create PR, request review, address feedback
- Merge: After approval and CI pass, merge to main
Code Review Requirements:
- Minimum 1 approval from another team member
- All CI checks must pass (build, tests, static analysis, formatting)
- Code must follow coding standards (.clang-format, .clang-tidy)
- Build Performance:
- Full rebuild: < 5 minutes on commodity hardware (4-core CPU, 8GB RAM)
- Incremental build: < 30 seconds (single file change)
- Runtime Performance:
- Target: 60 FPS with 1000+ entities (Part 1), 5000-10000 entities (Part 2)
- Network: < 100ms RTT on good connections, playable up to 200ms
This is an academic project developed as part of EPITECH curriculum.
- Architecture: See
docs/architecture.mdfor technical architecture decisions - PRD: See
docs/prd.mdfor product requirements
For questions or issues, contact the development team through the project repository.
Built with CMake | Powered by custom C++17 engine | EPITECH 2025