How zealanl/gigalearncpp-leak works
1. High-level shape
This repo is a C++ reinforcement-learning stack for Rocket League bots. The architecture is split into three major boundaries: the learning framework (GigaLearnCPP), the simulation/environment layer (RLGymCPP + RocketSim), and the game integration layer (RLBotCPP plus the root src/ example/client code).
2. Public vs internal learning framework
GigaLearnCPP/src/public is the API surface other code is meant to use: Learner, LearnerConfig, PPO configs, skill tracking config, and utilities like metric/report/render helpers. GigaLearnCPP/src/private contains the implementation details: PPO training (PPOLearner, GAE, ExperienceBuffer), policy version management, model definitions, and optimizer/statistics utilities. That boundary is important for the diagram because the public layer is thin and the private layer owns the training runtime.
3. Environment / RL interface layer
RLGymCPP is the environment abstraction that sits between learning code and physics. It defines game-state types (GameState, Player, Action), observation builders, reward functions, state setters, and terminal conditions. The readme’s state changes reflect this API design: rewards and observations operate on Player/GameState, with access to previous state/action data and event state baked into the model.
4. Simulation core
RocketSim is the physics-backed simulation engine used for environment creation and state-setting. It owns arena setup, car/ball/boost pad entities, collision masks, mutator configuration, event tracking, and ball prediction. The state-setting flow is explicit in the readme: the learner/environment is given an arena instance and can initialize or mutate the sim state directly.
5. Physics dependency boundary
RocketSim/libsrc/bullet3-3.24 vendors Bullet Physics directly into the repo. So the simulation stack is not a black box; it is a C++ physics engine embedded under RocketSim. In an architecture diagram, Bullet should appear as the low-level physics dependency under RocketSim, not as a separate service.
6. PPO training pipeline
The learning pipeline is PPO-centric: experience collection feeds ExperienceBuffer, advantages are computed with GAE, and PPOLearner performs policy/critic updates. The readme also notes configurable layer sizes, activation functions, optimizer choice, layer norm, return/obs standardization, and built-in action masking. This means the model/training subsystem is tightly coupled to environment semantics and policy versioning.
7. Policy versioning and skill tracking
PolicyVersionManager and the skill tracker configs indicate a second training-control loop beyond basic PPO: policies are versioned, and ELO-style skill tracking can use those versions for evaluation or matchmaking-style logic. This is a distinct subsystem because it introduces metadata flow around model checkpoints, not just gradients and weights.
8. Inference and telemetry utilities
The public utilities in GigaLearnCPP/src/public/GigaLearnCPP/Util handle runtime integration: InferUnit for inference, MetricSender/RenderSender for outgoing telemetry, Report for aggregating stats, KeyPressDetector for local control, and timer/helpers. The readme’s “single-process inference model” and built-in visualization/metrics imply the learner emits both action decisions and diagnostic streams.
9. Game integration via RLBot
RLBotCPP is the Rocket League bot interface layer. It includes bot/process/server/socket abstractions, match settings, renderers, and platform-specific implementations for Linux and Windows. This is the boundary that connects a running bot executable to the RLBot ecosystem and the Rocket League game process. The rlbot/ folder contains the runtime configs and Python-side launch wrapper (CppPythonAgent.py).
10. Top-level application glue
The root src/ directory contains ExampleMain.cpp and RLBotClient.*, which likely wire the framework into a concrete executable. This is the place where the learned policy, RLBot connection, and runtime config are assembled into a runnable agent.
11. Python-side support scripts
python_scripts/metric_receiver.py and python_scripts/render_receiver.py are sidecar consumers for the telemetry streams produced by the C++ side. They are not central to training, but they are part of the observability path: C++ emits metrics/render data, Python receives and displays or processes it.
12. Supporting tooling and format boundaries
The repo is CMake-driven and includes vendored third-party dependencies such as nlohmann/json, pybind11, flatbuffers inside RLBotCPP, and a small thread-pool library. tools/checkpoint_converter.py suggests checkpoint format conversion is part of the model lifecycle. These are infrastructure dependencies rather than separate services, but they affect how data moves between training, serialization, and runtime loading.
Main entry points: PPO PPO Runtime · RLGymCPP RLGymCPP · GigaLearnCPP Learner API · rlbot RLBotCPP
Components 25
Learning
Public API, PPO runtime, and policy control.
- Learner API · Thin public surface for training and inference setup.
GigaLearnCPP/src/public/GigaLearnCPP - Learner · Main learning orchestrator used by client code.
GigaLearnCPP/src/public/GigaLearnCPP/Learner.h - Learn Config · Learner and PPO configuration types.
GigaLearnCPP/src/public/GigaLearnCPP/LearnerConfig.h - PPO Config · PPO and transfer-learning settings.
GigaLearnCPP/src/public/GigaLearnCPP/PPO/PPOLearnerConfig.h - Skill Config · Skill-tracking and evaluation settings.
GigaLearnCPP/src/public/GigaLearnCPP/SkillTrackerConfig.h - Infer + Telemetry · Inference, reporting, metrics, render, and local control helpers.
GigaLearnCPP/src/public/GigaLearnCPP/Util - PPO Runtime · Policy optimization loop and rollout processing.
GigaLearnCPP/src/private/GigaLearnCPP/PPO - Experience · Stores collected trajectories for training.
GigaLearnCPP/src/private/GigaLearnCPP/PPO/ExperienceBuffer.h - GAE · Advantage and return computation.
GigaLearnCPP/src/private/GigaLearnCPP/PPO/GAE.h - PPOLearner · Performs PPO policy and critic updates.
GigaLearnCPP/src/private/GigaLearnCPP/PPO/PPOLearner.h - Policy Versions · Tracks policy versions and checkpoint lineage.
GigaLearnCPP/src/private/GigaLearnCPP/PolicyVersionManager.h - Models · Policy and model definitions plus optimizer utilities.
GigaLearnCPP/src/private/GigaLearnCPP/Util/Models.h
Env + Sim
RLGym environment boundary and RocketSim physics stack.
- RLGymCPP · Environment abstraction between learning and simulation.
GigaLearnCPP/RLGymCPP/src/RLGymCPP - Game State · Core game-state and player representations.
GigaLearnCPP/RLGymCPP/src/RLGymCPP/Gamestates/GameState.h - Obs + Reward · Observation builders and reward functions.
GigaLearnCPP/RLGymCPP/src/RLGymCPP/ObsBuilders - State + Termination · State setters and terminal conditions.
GigaLearnCPP/RLGymCPP/src/RLGymCPP/StateSetters - RocketSim · Physics-backed Rocket League simulation core.
GigaLearnCPP/RLGymCPP/RocketSim/src/RocketSim.h - Sim Entities · Arena, car, ball, boost, events, and prediction.
GigaLearnCPP/RLGymCPP/RocketSim/src/Sim - Bullet Physics · Embedded Bullet dynamics and collision engine.
GigaLearnCPP/RLGymCPP/RocketSim/libsrc/bullet3-3.24
RLBot
Bot process, sockets, rendering, and game integration.
- RLBotCPP · C++ interface to the RLBot ecosystem and game process.
RLBotCPP/inc/rlbot - Bot IO · Bot process, server, controller, and socket plumbing.
RLBotCPP/src - Render + Match · Rendering and match settings for runtime control.
RLBotCPP/inc/rlbot/renderer.h
Runtime
Root executable, telemetry sidecars, and tooling.
- App Glue · Root executable and client wiring.
src/ExampleMain.cpp - Python Sidecars · Receives metrics and render streams from C++.
GigaLearnCPP/python_scripts - Checkpoint Tool · Checkpoint conversion and format handling.
tools/checkpoint_converter.py
Connections 25
- Learner API → Learner: exports · Public API surface exposes the learner entrypoint.
- Learner API → Learn Config: uses · Learner is configured through public config types.
- Learner API → PPO Config: uses · PPO-specific training settings flow through the public API.
- Learner API → Skill Config: uses · Skill-tracking metadata is configured alongside learning.
- Learner → PPO Runtime: drives · Learner orchestrates the private PPO training runtime.
- PPO Runtime → Experience: collects · Training consumes buffered rollout experience.
- PPO Runtime → GAE: computes · Advantages and returns are derived before optimization.
- PPO Runtime → PPOLearner: optimizes · PPOLearner applies policy and value updates.
- PPO Runtime → Policy Versions: versions · Training checkpoints and policy lineage are tracked.
- PPO Runtime → Models: updates · Model definitions and optimizer utilities back the trainer.
- PPO Runtime → RLGymCPP: interacts · Rollouts and actions pass through the environment boundary.
- RLGymCPP → Game State: defines · Environment state is represented by game-state and player types.
- RLGymCPP → Obs + Reward: builds · Observations and rewards are derived from state.
- RLGymCPP → State + Termination: resets · State setters and terminal conditions shape episodes.
- RLGymCPP → RocketSim: drives · Environment creation and state mutation use the simulator.
- RocketSim → Sim Entities: contains · Arena, vehicle, ball, boost, and event subsystems.
- RocketSim → Bullet Physics: depends on · Simulation uses embedded Bullet physics internals.
- App Glue → RLBotCPP: connects · Executable wiring bridges to the RLBot runtime.
- RLBotCPP → Bot IO: implements · Bot process and socket layers move data to the game.
- RLBotCPP → Render + Match: provides · Rendering and match configuration are exposed here.
- App Glue → Learner API: uses · Root client code can invoke the learning framework.
- App Glue → RLBotCPP: uses · The executable also hosts the game integration boundary.
- Infer + Telemetry → Python Sidecars: emits · Metrics and render streams are consumed by Python helpers.
- PPO Runtime → Infer + Telemetry: reports · Training runtime publishes metrics and inference helpers.
- Checkpoint Tool → Policy Versions: converts · Checkpoint conversion supports versioned model lifecycle.