Thanks to visit codestin.com
Credit goes to github.com

Skip to content

๐Ÿš€ R-Type: A C++ project recreating the classic shootโ€™em up with multiplayer support and a custom game engine

License

Notifications You must be signed in to change notification settings

natan-fievet/rtype

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ R-Type Game Engine Project

Version License C++20 Platform Build

A modern, enterprise-grade game engine and complete multiplayer gaming framework built with C++20

Features โ€ข Gallery โ€ข Installation โ€ข Documentation โ€ข Games


๐Ÿ“‹ Table of Contents


๐Ÿ“– Description

The R-Type Project is a comprehensive game development ecosystem centered around the TKD Engine (TekyoDrift Engine), a production-ready, modular game engine designed specifically for networked multiplayer applications. This project demonstrates enterprise-grade software architecture principles through its implementation of complete game prototypes and development tools.

Built entirely in modern C++20, the project encompasses:

  • ๐ŸŽฏ TKD Engine: A dual-mode (client/server) game engine with robust networking capabilities
  • ๐ŸŽฎ Complete Games: Two fully functional game implementations showcasing engine capabilities
  • ๐Ÿ”ง Development Tools: Specialized utilities for asset management, resource packing, and debugging
  • ๐ŸŒ Network Architecture: High-performance client-server multiplayer system with real-time synchronization
  • ๐Ÿ—๏ธ Modular Design: Reusable components following SOLID principles and modern C++ best practices

The engine leverages cutting-edge technologies including Entity-Component-System (ECS) architecture, Asio-based networking, SFML graphics, and experimental OpenVR integration for virtual reality experiences. Designed with cross-platform compatibility, performance optimization, and developer productivity in mind, the TKD Engine provides a solid foundation for building complex, networked multiplayer games.


โœจ Features

๐ŸŽฎ Core Engine Systems

  • Modern C++20 Architecture: Leveraging latest language features for type safety, performance, and maintainability
  • Dual-Build System: Single codebase producing both client (with graphics) and server (headless) executables
  • Entity-Component-System (ECS): Flexible, composition-based game object management with runtime behavior modification
  • Thread-Safe Components: Built-in concurrency primitives and synchronization for parallel execution
  • Memory Management: RAII principles, smart pointers, and deterministic resource management
  • Cross-Platform Support: Consistent behavior across Linux, Windows, and macOS

๐ŸŒ Advanced Networking

  • High-Performance UDP Protocol: Custom binary protocol optimized for minimal bandwidth and latency
  • Asio-Powered I/O: Asynchronous, non-blocking network operations for maximum throughput
  • Reliable Transmission Layer: ACK/NACK system with automatic retransmission and duplicate detection
  • Client-Server Architecture: Dedicated server support with multiple concurrent client connections
  • Real-Time Synchronization: Delta compression and snapshot interpolation for smooth gameplay
  • Network Statistics: Built-in monitoring for latency, packet loss, and bandwidth utilization
  • Type-Safe Packet System: Automatic serialization/deserialization with virtual dispatch

๐ŸŽจ Graphics & Rendering

  • SFML-Based Pipeline: Modern OpenGL backend with shader support
  • Component-Based Rendering: Modular rendering system with material and texture management
  • Camera System: Multi-viewport support with 2D/3D transformations
  • Sprite & Animation Management: FlipBook system for 2D sprite animations
  • Shader System: Custom shader support for advanced visual effects
  • ImGui Integration: Immediate-mode GUI for debug tools and in-game interfaces

๐Ÿ”Š Audio System

  • 3D Positional Audio: Spatial sound processing with listener management
  • Multi-Format Support: WAV, OGG, FLAC audio playback
  • Audio Streaming: Efficient streaming for large audio files
  • Effect Processing: Real-time audio effects and filters
  • Sound Source Management: Multiple simultaneous audio sources with priority system

๐Ÿงฎ Mathematics & Physics

  • Comprehensive Math Library: Vectors (2D/3D/4D), matrices, quaternions, transforms
  • Geometric Primitives: Rectangles, circles, spheres, planes, boxes, capsules, rays
  • Collision Detection: AABB, OBB, sphere, and ray-based collision systems
  • Interpolation Functions: Linear, spherical, cubic, and custom interpolation utilities
  • Color Management: 8-bit and floating-point color spaces with conversion utilities

๐Ÿ”ง Development Tools Suite

  • TKDPack: Asset packaging utility for bundling resources into optimized .pak archives with compression
  • TKDEmbed: Binary-to-C++ header converter for compile-time asset embedding
  • TKDGraph: Visual debugging and profiling tools with ImGui-based interface
  • Testing Framework: Comprehensive unit tests using Catch2
  • Logging System: Multi-level logging (Debug, Info, Warning, Error, Critical) with file output

๐ŸŽฏ Runtime Features

  • Actor-Component Model: Flexible game object composition with inheritance and polymorphism
  • World Management: Scene organization, level loading, and object lifecycle management
  • Time Management: Delta time calculation, fixed timestep support, and time scaling
  • Input System: Unified keyboard, mouse, and gamepad input handling with action mapping
  • Event System: Type-safe event broadcasting and subscription
  • Configuration Management: INI-based configuration with runtime modification
  • Save/Load System: Binary and JSON serialization for game state persistence

๐Ÿฅฝ Virtual Reality Support (Experimental)

  • OpenVR Integration: Steam VR support for HTC Vive, Valve Index, and compatible headsets
  • VR Camera System: Head-mounted display tracking and stereoscopic rendering
  • Motion Controllers: Hand tracking and controller input
  • Room-Scale Experiences: Chaperone system integration for safe VR gameplay

๐Ÿ“ฆ Asset Management

  • Resource Handles: Smart pointer-based asset management with automatic lifetime tracking
  • Pak File System: Custom archive format for efficient asset distribution
  • Hot Reloading: Runtime asset reloading for rapid iteration during development
  • Texture Atlas Support: Sprite sheet management with automatic sub-texture extraction
  • Async Loading: Background asset loading to prevent frame drops

๐ŸŽจ Gallery

OpenVR Integration Tests

OpenVR Test 1 OpenVR Test 2
VR Camera Tracking & Rendering Motion Controller Integration

๐ŸŽฅ Note: Video demonstrations showcasing experimental VR features with the TKD Engine


๐Ÿ’ป Requirements

Minimum System Requirements

Component Specification
Operating System Windows 10/11, Ubuntu 20.04+, macOS 11+
Processor Dual-core 2.0 GHz
Memory 4 GB RAM
Graphics OpenGL 3.3 compatible GPU
Storage 500 MB available space
Network Broadband internet connection (for multiplayer)

Recommended System Requirements

Component Specification
Operating System Windows 11, Ubuntu 22.04+, macOS 12+
Processor Quad-core 3.0 GHz or higher
Memory 8 GB RAM or more
Graphics Dedicated GPU with OpenGL 4.5 support
Storage 1 GB available space (SSD recommended)
Network Low-latency broadband connection

Development Requirements

  • CMake 3.21 or higher
  • Python 3.7+ with pip
  • C++ Compiler with C++20 support:
    • Linux: GCC 10+ or Clang 12+
    • Windows: Visual Studio 2019+ or MinGW-w64
    • macOS: Xcode 12+ or Clang 12+
  • Git for version control
  • Conan 2.x package manager

๐Ÿ“ฆ Dependencies

The R-Type project utilizes the following third-party libraries, automatically managed through Conan:

Core Dependencies

Library Version Purpose
SFML 2.6.2 Graphics, windowing, audio, and input handling
Asio 1.36.0 Asynchronous networking and I/O operations
ImGui 1.91.8 Immediate-mode graphical user interface
ImGui-SFML 2.6.1 SFML rendering backend for ImGui
nlohmann_json 3.12.0 Modern JSON serialization and parsing
Catch2 3.10.0 Modern C++ testing framework

Graphics & Rendering

Library Version Purpose
OpenGL system Hardware-accelerated graphics rendering
GLEW 2.2.0 OpenGL extension loading library
Mesa GLU 9.0.3 OpenGL utility library (Linux/macOS)

Virtual Reality

Library Version Purpose
OpenVR 1.16.8 Virtual reality headset integration

Utilities

Library Version Purpose
zlib 1.3.1 Data compression for asset archives

All dependencies are automatically downloaded, configured, and linked during the build process via Conan package manager. No manual installation required.


๐Ÿ“š Documentation

Comprehensive documentation is available in the Documentation/ directory:

๐Ÿ“– General Documentation

๐Ÿš€ Engine Documentation

Located in Documentation/Engine/:

๐Ÿ“ฆ Module References

Detailed API documentation for each engine module in Documentation/Engine/Modules/:

  • Core - Foundation systems, containers, mathematics, concurrency
  • Runtime - Actor-component system, world management, game loop
  • Network - Client-server architecture, packet system, protocols
  • Renderer - Graphics pipeline, materials, shaders, cameras
  • Audio - Sound management, 3D audio, streaming
  • Config - Configuration system and engine settings
  • Static - Engine initialization and bootstrapping
  • Debug - Logging, profiling, and debugging utilities

๐ŸŽ“ Scripting References

Complete API references in Documentation/Engine/Scripting References/:

  • Actors - Base actor classes, cameras, pawns, HUD
  • Animations - 2D animations, flipbooks, state machines
  • Assets - Resource management, pak files, loading system
  • Audio - Audio buffers, sources, effects, listeners
  • Controllers - Player and AI controller systems
  • Math - Vectors, matrices, quaternions, transforms, geometry
  • Network - Networking classes, packets, binary serialization
  • Renderer - Rendering components, materials, shaders
  • Widgets - UI system and widget classes

๐Ÿ”ง Tools Documentation

Located in Documentation/Tools/:

  • TKDPack - Asset packaging tool documentation
  • TKDEmbed - Binary embedding utility guide
  • TKDGraph - Visual debugging tool manual

๐Ÿ‘ฅ Contributors

This project is the result of collaborative effort from our talented development team:

๐Ÿ‘‘ Project Leadership

Mallory SCOTTON
Project Leader ยท Lead Engine Developer

๐Ÿ› ๏ธ Core Development Team

Nathan FIEVET Hugo CATHELAIN
Team Coordinator ยท Engine & Network Developer Game Engine Developer

๐ŸŽฎ Game Development Team

Ossan MSOILI Raphael OSTIER
Game Developer Game Developer

๐Ÿ’ก Contributions Welcome!
See our Contributing Guide and Code of Conduct


๐Ÿ› ๏ธ Installation Guide

Quick Start (Automated Build)

The easiest way to build R-Type is using our automated build scripts that handle all dependencies and configuration:

Linux, FreeBSD, OpenBSD, NetBSD, macOS

chmod +x Scripts/Build.sh
./Scripts/Build.sh

Windows

.\Scripts\Build.bat

These scripts automatically:

  • โœ… Install system dependencies (pipx, cmake, build tools)
  • โœ… Install and configure Conan package manager
  • โœ… Set up the build environment
  • โœ… Configure CMake with optimal settings
  • โœ… Build the project with all games and tools

Manual Installation

If you prefer manual control over the build process:

Step 1: Install Prerequisites

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install build-essential cmake python3-pip pipx git

Linux (CentOS/RHEL/Fedora):

sudo yum groupinstall "Development Tools"
sudo yum install cmake python3-pip git
python3 -m pip install --user pipx

macOS:

# Install Homebrew if not present
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install dependencies
brew install cmake pipx git

Windows:

Step 2: Install Conan Package Manager

Linux/macOS:

pipx install conan
pipx ensurepath

Windows:

python -m pip install conan

Step 3: Configure Conan Profile

conan profile detect --force

Step 4: Clone Repository

git clone https://github.com/mallory-scotton/rtype.git
cd rtype

Step 5: Install Dependencies

conan install . \
  --output-folder=Build \
  --build=missing \
  --settings=build_type=Release \
  --settings=compiler.cppstd=20 \
  -c tools.system.package_manager:mode=install

Step 6: Configure CMake

cmake -B Build -S . -DCMAKE_BUILD_TYPE=Release

Step 7: Build the Project

cmake --build Build --config Release

Step 8: Run the Executables

After successful compilation, executables are located in Build/bin/:

# Run R-Type game server
./Build/bin/RTypeGameServer

# Run R-Type game client
./Build/bin/RTypeGameClient

# Run TKDPack tool
./Build/bin/TKDPack --help

Build Output Structure

Build/
โ”œโ”€โ”€ bin/                      # Executable files
โ”‚   โ”œโ”€โ”€ RTypeGameClient       # R-Type client executable
โ”‚   โ”œโ”€โ”€ RTypeGameServer       # R-Type server executable
โ”‚   โ”œโ”€โ”€ BeatSaberGameClient   # BeatSaber client executable
โ”‚   โ”œโ”€โ”€ BeatSaberGameServer   # BeatSaber server executable
โ”‚   โ”œโ”€โ”€ TKDEngineClient       # Engine client library test
โ”‚   โ”œโ”€โ”€ TKDEngineServer       # Engine server library test
โ”‚   โ”œโ”€โ”€ TKDEngineTests        # Engine unit tests
โ”‚   โ”œโ”€โ”€ TKDPack               # Asset packing tool
โ”‚   โ””โ”€โ”€ TKDEmbed              # Binary embedding tool
โ”œโ”€โ”€ lib/                      # Shared libraries (.dll, .so, .dylib)
โ””โ”€โ”€ Assets/                   # Game assets (copied from Games/)

Troubleshooting

โŒ Conan profile detection fails

Solution:

conan profile detect --force

If this persists, manually create a profile:

conan profile path default
# Edit the file and ensure C++20 is set
โŒ Missing C++20 support

Solution:

  • Ensure your compiler supports C++20:
    • GCC 10+
    • Clang 12+
    • MSVC 2019 (19.29)+
  • Update your compiler if necessary
  • Verify CMake detects the correct compiler: cmake --version and check compiler output
โŒ Permission errors with Conan

Solution:

  • Do NOT use sudo with Conan commands (except for system package installation)
  • Conan should always run as your regular user
  • Ensure your user has write permissions to the Conan cache directory (~/.conan2/)
โŒ Build dependencies missing

Solution:

  • Run the automated build script which handles all dependencies
  • On Linux, install development packages: sudo apt install build-essential cmake
  • On macOS, ensure Xcode Command Line Tools are installed: xcode-select --install
  • On Windows, verify Visual Studio C++ tools are installed
โŒ SFML or other library linking errors

Solution:

  • Clean the build directory: rm -rf Build/
  • Re-run Conan install with --build=missing flag
  • Ensure all dependencies are built for the same architecture (x64)

Need Additional Help?

  • Check the Documentation
  • Review build logs for specific error messages
  • Open an issue on GitHub

Development Tools Setup

Code Formatting with clang-format

This project uses clang-format-19 for consistent code style.

Installation:

# Ubuntu/Debian
sudo apt install clang-format-19

# macOS
brew install clang-format

# Windows (via Chocolatey)
choco install llvm

Usage:

# Format single file
clang-format-19 -i path/to/file.cpp

# Format all C++ files
find . -name "*.cpp" -o -name "*.hpp" | xargs clang-format-19 -i

VS Code Integration:

Add to .vscode/settings.json:

{
  "C_Cpp.clang_format_path": "clang-format-19",
  "C_Cpp.clang_format_style": "file",
  "editor.formatOnSave": true,
  "[cpp]": {
    "editor.defaultFormatter": "ms-vscode.cpptools"
  }
}

๐ŸŽฎ Games

The R-Type project includes two complete game implementations showcasing the TKD Engine's capabilities:

R-Type

Version: 1.0.0
Genre: Side-Scrolling Shooter
Mode: Networked Multiplayer
Status: โœ… Stable Release

Overview

A complete recreation of the classic R-Type arcade shooter featuring networked multiplayer gameplay. Demonstrates the engine's capabilities in 2D game development, real-time networking, and client-server architecture.

Features

  • โœจ Classic Gameplay: Faithful recreation of R-Type mechanics
  • ๐ŸŒ Multiplayer Support: Up to 4 simultaneous players via client-server architecture
  • ๐ŸŽฎ Real-Time Synchronization: Smooth gameplay with delta compression and interpolation
  • ๐ŸŽจ Sprite Animation System: FlipBook-based 2D animations
  • ๐Ÿ’ฅ Particle Effects: Explosions, weapon effects, and environmental particles
  • ๐ŸŽต Audio Integration: Music and sound effects with 3D positional audio
  • ๐Ÿ† Scoring System: Player statistics and leaderboards
  • ๐Ÿ“ฆ Pak File Assets: Optimized asset loading using TKDPack format

Technical Highlights

  • Entity-Component-System for game object management
  • Custom network protocol with reliable UDP transmission
  • State synchronization with snapshot interpolation
  • Client-side prediction for responsive controls
  • Server-authoritative gameplay preventing cheating

Running R-Type

# Start dedicated server
cd Build/bin
./RTypeGameServer --port 4242

# Start client and connect
./RTypeGameClient --server localhost --port 4242

Configuration:

  • Server settings: Build/bin/Data/server.ini
  • Client settings: Build/bin/Data/client.ini

BeatSaber

Version: 0.0.1
Genre: VR Rhythm Game
Mode: Single Player (Experimental)
Status: ๐Ÿšง In Development

Overview

An experimental VR rhythm game prototype showcasing the TKD Engine's OpenVR integration capabilities. Features head-mounted display tracking, motion controller support, and 3D audio for immersive gameplay.

Features (Experimental)

  • ๐Ÿฅฝ VR Support: OpenVR integration for SteamVR-compatible headsets
  • ๐ŸŽฏ Motion Controllers: Hand tracking and gesture recognition
  • ๐ŸŽต Rhythm Gameplay: Music-synchronized obstacle generation
  • ๐ŸŽจ 3D Rendering: Stereoscopic rendering for VR displays
  • ๐Ÿ”Š Spatial Audio: 3D positional audio for immersive sound
  • ๐Ÿ  Room-Scale: Chaperone system integration

Technical Highlights

  • OpenVR SDK integration for HMD and controller tracking
  • Custom VR camera system with stereoscopic projection
  • Motion controller input mapping
  • Performance optimization for 90Hz VR rendering
  • Experimental physics-based sword mechanics

Running BeatSaber

Requirements:

  • SteamVR-compatible VR headset (HTC Vive, Valve Index, Oculus Rift, etc.)
  • SteamVR runtime installed
  • Motion controllers
# Ensure SteamVR is running, then start the game
cd Build/bin
./BeatSaberGameClient

โš ๏ธ Note: This is an experimental prototype demonstrating VR capabilities. Full gameplay features are still in development.


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE.md file for complete details.

MIT License

Copyright (c) 2025 TekyoDrift

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Third-Party Licenses

This project uses several open-source libraries, each with their own licenses:

  • SFML - zlib/libpng License
  • Asio - Boost Software License 1.0
  • ImGui - MIT License
  • Catch2 - Boost Software License 1.0
  • OpenVR - BSD 3-Clause License
  • nlohmann_json - MIT License

โค๏ธ Coded with Love

Made with โค๏ธ by the TekyoDrift Team

Building the future of game development, one commit at a time.


๐ŸŒŸ Star this project if you find it useful!

GitHub stars GitHub forks GitHub watchers


โฌ† Back to Top

About

๐Ÿš€ R-Type: A C++ project recreating the classic shootโ€™em up with multiplayer support and a custom game engine

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 87.7%
  • TypeScript 7.0%
  • CSS 3.9%
  • CMake 0.7%
  • Batchfile 0.4%
  • Shell 0.3%