Skip to main content

TrackmaniaRL

TrackmaniaRL logo

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.2.x 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 platform and PyTorch setup for CPU and GPU installation details.

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

Create a separate project for your maps, models, configurations and training data:

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.

Neural inference in motion

Full drive alongside road, car and context branches, residual blocks, action values and changing steering and pedal controls

This full drive shows a selected evaluation lap from the contributor's strongest checkpoint for this map. The contributor reports approximately 12 wall-clock hours of training before the recording; capturing and rendering the film did not update its weights. The panel is an architecture showcase: it follows map-relative road geometry, a 60-value car/physics vector and 29 engineered driving-context values through the model to action scores and selected controls. The changing activation colours show real tensor values, but they are not feature attribution and individual cells are not intended to explain a decision by themselves. This selected lap uses the map-specific neighbors action filter. It is neither an unassisted-policy benchmark nor evidence of generalization. See the model and recording explanation for provenance, the five-attempt film series and GIF reproduction.

Documentation

Start at the documentation index.

Task Guide
Learn the Python API Python quickstart · SDK reference
Extend the library Public API · Examples
Configure training Configuration · Algorithms
Use images or demonstrations Vision and PPO · Imitation learning
Understand the runtime Architecture · Distributed training
Diagnose a run Observability · Troubleshooting

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.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TrackmaniaRL 1.2.10
File Size Uploaded
trackmaniarl-1.2.10.tar.gz 28.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for TrackmaniaRL 1.2.10
File Interpreter ABI Platform
trackmaniarl-1.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 MB

Release files / trackmaniarl-1.2.10.tar.gz

Download URL trackmaniarl-1.2.10.tar.gz
Size 28.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1afc2ad0867306b999f30e1dd20e3738bb8c9ec65a38f800d9ca8e495dc70a51
BLAKE2b-256 checksum
How to use checksums
681e2ea3334d5369a396c394eeb2d85b55863e1c98562a6f28b75a31e424fd3d
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":"24.04","id":"noble","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 Sep 26, 2026.

Transparency log

Release files / trackmaniarl-1.2.10-py3-none-any.whl

Download URL trackmaniarl-1.2.10-py3-none-any.whl
Size 526.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09ebe5dde5846fc4a41ab0d79733b8573fd498388cb9855347cfdd7ece691016
BLAKE2b-256 checksum
How to use checksums
0ce6b0c688c1b43d265cf0db56c07d08c0e51dcb30fff51952647603290fc9f3
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":"24.04","id":"noble","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 Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.12

2 release files

1.2.11

2 release files

This release

1.2.10 This release

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page