How guilhemvnt/rtype-multi works
Project Type & Purpose
• This is a real-time, networked C++ game (R-Type) using a client-server architecture.
• The client handles rendering, input, audio, and local game logic (ECS).
• The server manages lobbies, game state synchronization, and score persistence.
File Structure
• Top-Level CMakeLists.txt and platform build/install scripts under scripts/.
• src/Client / include/Client: client networking & main entry.
• src/Server / include/Server: server logic, lobby management, score files.
• include/Engine & src/Engine: core ECS engine (Entities, Components, Systems).
• include/Graph & src/Graph: rendering/UI layer, audio, scene & object management.
• include/JsonParser: JSON config loader for entities, levels, assets.
• include/CtrlC: OS signal handling utility.
• Config files (*.json) for levels, entities, assets, game settings.
• scripts/ for cross-platform build & install.
Extract Key Insights from README
• Cross-platform support (macOS, Linux, Windows) via CMake & platform scripts.
• Doxygen documentation available.
• MIT-licensed, student project.
Main Components & Their Interactions
a. Client Application
• Game Loop (Engine)
– EntityManager & EntityFactory
– Systems: InputSystem, AISystem, MvtSystem, CollisionSystem, PowerupSystem
– JSONParser for loading EntityConfig.json, LevelConfig.json
• Rendering/UI (Graph)
– ObjectManager/Factory & Scene interfaces
– AudioManager/AudioFactory
– Button/InputButton for menus
– JSONParser for AssetsConfig.json, GameConfig.json
• Networking (ClientConnection)
– Handles TCP/UDP communication with server
• OS Signal Handling (CtrlC)
b. Server Application
• Main & Lobby modules
– Accepts connections, forms lobbies (Lobby.hpp)
• Game State Synchronization
– Maintains authoritive game state (could reuse Engine modules)
• Score Persistence
– Reads/Writes infScore.txt, levelScore.txt
c. Shared Utility
• JsonParser library
• Error handling (include/Error)
Architectural Patterns & Design Principles
• Entity-Component-System (ECS) for game logic separation.
• Layered architecture:
Presentation (Graph) → Application/Game Logic (Engine & Systems) → Data (JSON config, score files).
• Client-Server pattern for multiplayer.
• Factory & Manager patterns for object and resource creation.