This document provides an overview of the project to help new developers get acquainted with its structure and functionality. The focus is on practical information to understand the project broadly, rather than delving into the minutiae of the code. This documentation aims to provide a clear understanding of the project's architecture, main systems, and development guidelines.
This project is built around an Entity-Component-System (ECS) architecture, which separates concerns into entities (game objects), components (data associated with entities), and systems (logic that processes entities with specific components). This provides flexibility and scalability, particularly important for managing the complexity of multiplayer game logic.
- Overview Diagram:
graph TD
A[Client Subsystem] --> |Uses| RTYPE-ECS
A --> |Uses| NETWORK
A --> |Uses| UTILS
A --> |Uses| ImGui-SFML
B[Server Subsystem] --> |Uses| RTYPE-ECS
B --> |Uses| NETWORK
B --> |Uses| UTILS
RTYPE-ECS --> |Depends on| ECS
RTYPE-ECS --> |Depends on| NETWORK
RTYPE-ECS --> |Uses| SFML
NETWORK --> |Uses| Asio
UTILS --> |Provides| Logger
UTILS --> |Provides| ArgParser
UTILS --> |Provides| TrackedException
Assets[Shared Assets] --> |Shared by| A
Assets --> |Shared by| B
Include[Shared Include Directory] --> |Shared by| A
Include --> |Shared by| B
- Subsystem Diagrams:
Don't hesitate to check the doxygen documentation for more information.
To install the required dependencies on Ubuntu or any Debian-based system, run the following commands:
sudo apt update
sudo apt-get install -y \
flex \
bison \
javacc \
libflac-dev \
libx11-dev \
libxext-dev \
libgl1-mesa-dev \
libudev-dev \
libopenal-dev \
libvorbis-dev \
libxcursor-dev \
libxrandr-dev \
libfreetype6-dev- C++20 or higher compiler
- CMake for build configuration (3.1 or higher)
- Network connectivity for multiplayer mode
-
Clone the repo
git clone git@github.com:ManuelR-T/R-Type.git cd R-Type -
Generate build files using CMake:
mkdir build cd build cmake .. -
Build the project:
make
Alternatively, you can build with:
cmake --build .
And from now on you can follow the Readme tutorial on how to use the binaries
-
Modify a stage
There is 10 stages in R-Type that can be found here:
assets/stages/You can modify as you want to spawn other entity, at an other place etc...
-
How to Add a New Entity
Define the entity JSON: Add a new JSON file in the assets/ directory describing the entity's components, such as position, velocity, sprite, and more.
Register the entity: Use the EntityFactory to register and create this entity in your game. For example:
entityFactory.createEntityFromJson("assets/new_entity.json"); -
How to Modify Game Systems
To modify or create a new system, follow these steps:
-
Create a new system file in lib/factory/systems/.
-
Define the system logic by processing entities with specific components. For example, in control_move.cpp:
for (auto [entity, position, velocity] : registry.view<Position, Velocity>()) { position.x += velocity.vx * delta_time; position.y += velocity.vy * delta_time; }
-
Register the system so that it gets processed.
-
