projects / tmnf-generalist

tmnf-generalist

2026 · repo · youtube

A driving policy for Trackmania Nations Forever that drives tracks it has never seen.

The policy drives the same way as a player does. It sees only the game’s frames and the speed shown on the HUD, with no privileged information such as map data, slip angles or other engine state.

Watch the demo video on YouTube.

Model

The model is trained using behavioral cloning on human replays from Trackmania Exchange.

Training data:

  • 9,321 replays (1 per map)
  • 110.5 hours in total

Model architecture:

┌──────────────────┐   ┌──────────────────┐                                 ┌────────────────────────┐
│ frames           │──►│ DINOv2 ViT-S/14  │──┐   ┌──────────────────────┐   │ action   12 key combos │
│ 320×240 @ 20 Hz  │   │ (pretrained)     │  └──►│ causal transformer   │   ├────────────────────────┤
└──────────────────┘   └──────────────────┘      │ 8 layers × 512       │──►│ chunk    next 8 steps  │
┌──────────────────┐                         ┌──►│ 16 frames (0.8 s)    │   ├────────────────────────┤
│ HUD speed (km/h) │─────────────────────────┘   └──────────────────────┘   │ path     next 3 s      │
└──────────────────┘                                                        └────────────────────────┘

Total: 48.7M parameters

Benchmarks

Watching the model drive a handful of maps isn’t enough to tell two models apart, so every checkpoint is scored on a fixed benchmark built from human runs.

The model takes over a human run at 10-second intervals and has one attempt at each segment. It’s scored on two things: whether it finishes the segment (pass rate), and how fast it does so compared with the human (pace).

The human runs are leaderboard replays, usually driven by players who knew the map well, so they score 100% and 1.00 by definition. I have also driven these segments without knowing the maps myself as a reference.

Pass rate and pace on the benchmark for each milestone checkpoint.
Pass rate and pace on the benchmark for each milestone checkpoint

Acknowledgements