TrackmaniaRL is a Python library for building and training reinforcement-learning agents in Trackmania 2020. Compose your own models, feature pipelines, replay samplers and learners, then use the same configuration from Python or the CLI.
- Composable models: encoders, temporal cores, value heads and actor-critic models.
- Training workflows: online RL, demonstrations, behavior cloning and checkpoint resume.
- Game integration: telemetry, camera observations, map geometry and control.
- Repeatable evaluation: complete trial records, finish rates and timing metrics.
The Python package and game integration support Windows and desktop Linux. On Linux, Trackmania runs through Proton and is not officially supported by Ubisoft Nadeo, so the game setup is experimental. WSL is not a supported game host. TrackmaniaRL 1.4.0 requires Python 3.12 and uses RunSpec 2.0 and checkpoint schema 2.0.
Installation
Add the library to your Python 3.12 project:
pip install trackmaniarl
Optional integrations are available as extras, for example
pip install "trackmaniarl[vision,wandb,distributed]".
See PyTorch installation for a build
suited to your system, and performance guidance
for training and GPU tuning.
Train across computers
For off-policy algorithms such as IQN and SAC, multiple Trackmania actors on separate computers can send rollouts asynchronously to one learner that trains the model and publishes policy updates. Follow the multi-computer setup guide for installation, matching assets, authentication, encrypted tunneling and commands; PPO training remains local.
Use from Python
Given a run.yaml with an environment and learner configured:
from pathlib import Path
from trackmaniarl import RunSpec, Trainer, resolve_run
config = Path("run.yaml").resolve()
run = resolve_run(RunSpec.from_yaml(config), base_dir=config.parent)
try:
result = Trainer(run).train()
print(f"Collected {result.transitions} transitions; ran {result.updates} updates")
finally:
run.logger.close()
Trainer runs local training. The CLI also provides the distributed actor/learner
workflow. Start with the Python quickstart
for a complete example that needs no game, GPU, map assets or tracking account.
| Example | What it demonstrates |
|---|---|
| Game-free training | Custom environment and reward, replay, updates and checkpoints |
| Train a configuration | Python API, resource cleanup and checkpoint resume |
| Custom model | Your own encoder in a bundled value model |
| Own-map configuration | Connect the components to Trackmania |
Train in Trackmania
Install uv, then create a separate project for
your maps, models, configurations and training data. On Windows, uv sync may
install or repair the system-wide ViGEmBus driver; read the
game setup guide
before running it.
trackmaniarl init my-agent --template trackmania
cd my-agent
uv sync
Follow the game quickstart to install Openplanet, connect the game, build map geometry and run training and evaluation. The generated project includes configurations for IQN, SAC, REDQ, TQC, discrete SAC, PPO and camera-based variants.
For the separately qualified Linux native backend, see the native headless environment and QR reference profile. It requires caller-supplied native assets and source references and runs without the Windows game client. See the guide for its strict clock and map limits.
Neural inference in motion
This animation shows one evaluation lap from the contributor's strongest checkpoint
for this map. The contributor reports approximately 12 wall-clock hours of
training; capturing and rendering the film did not update its weights. The panel follows map-relative
road geometry, a 60-value car/physics vector and 29 engineered driving-context
values through the model to its action scores and controls. The colours show real
tensor values, not feature attribution; individual cells do not explain the
model's decisions. The lap uses a map-specific neighbors action
filter, so it is not an unassisted-policy benchmark or evidence of generalization.
See the model and recording explanation
for provenance and the five-attempt film series, or the GIF reproduction guide.
Documentation
Browse the documentation index by reader goal:
| Goal | Starting points |
|---|---|
| Learn by doing | Python quickstart · Game quickstart · Examples |
| Complete a task | Vision and PPO · Imitation learning · Troubleshooting |
| Look up details | Configuration · Algorithms · Public API · SDK guide · Observability |
| Understand how it works | Library architecture · Runtime architecture |
Development and research
uv sync --group dev
uv run ruff format --check .
uv run ruff check .
uv run mypy --strict trackmaniarl
uv run pytest
uv build
uv run python scripts/check_distribution.py
See contributing and the development guide for the full checks. The repository layout separates the published package, examples, tests and local experiment data.
TrackmaniaRL is released under the MIT license. It originated from TMRL. Attribution is in NOTICE. It is not affiliated with Ubisoft or Nadeo.
Metadata
Release files for TrackmaniaRL 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trackmaniarl-1.4.0.tar.gz | 29.1 MB | With provenance | Details for trackmaniarl-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trackmaniarl-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for trackmaniarl-1.4.0-py3-none-any.whl |
Total release size: 30.0 MB
Release files / trackmaniarl-1.4.0.tar.gz
| Download URL | trackmaniarl-1.4.0.tar.gz |
|---|---|
| Size | 29.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
577b8a73b3e59fba8bf6355f6ea348ac53a306336bf0cdc2a54d0f365e86b8a4
|
|
BLAKE2b-256 checksum How to use checksums |
5bae422f1564f82904270eab20ba551b071a76564e86b086a84bf8b27ac4f535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / trackmaniarl-1.4.0-py3-none-any.whl
| Download URL | trackmaniarl-1.4.0-py3-none-any.whl |
|---|---|
| Size | 894.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20d0ed8457e3d24369fa3ae63e5df91d09b48eba69b37ac7f7afecedac2e72bc
|
|
BLAKE2b-256 checksum How to use checksums |
79dacaf3e2125a1c593199d9a99cbec9829559a2ca66032e4a9a1090b2404009
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for TrackmaniaRL 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for trackmaniarl-1.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.