TrackMania Competition Patch

Published on

What is Competition Patch?

TrackMania Competition Patch is a special patch for TrackMania Nations and United Forever that prevents cheating such as using replaying pre-made runs and slowing down the game time. If you use the Steam version of the game, it is strongly recommended to use the standalone version before installing the patch – you can download it directly here.

The patch was initially developed by donadigo, and the latest Competition Patch 2.0 release has been developed by Tomashu, the developer of ModLoader.


Got any issues? Discuss issues or bugs in the #issues Discord channel.

Warning

ModLoader may be detected as malicious by your browser/antivirus. It is recommended to disable antivirus while installing ModLoader, This is because the program injects its own DLL into the game, which is seen as malicious by antivirus software. See Installation for more instructions.

Why is there a need for this patch?

The patch is meant to implement better protection against cheating & have additional validation of records uploaded on important TMX categories such as Official Campaigns and Classic tracks.

How does it work?

The patch is installed through ModLoader, which is a mod manager for TrackMania. To use the patch you need:

  • the newest game version installed (>=2.11.26), best to use the standalone version from here.
  • a stable internet connection to have your replays validated by the Competition Patch server.

Any run driven with Competition Patch and stable internet connection will be validated by the server and is eligible for submission to TMX, even if you are not playing in official mode. If you lost connection during your run, Competition Patch will wait a few seconds at the end of the race to try to connect and validate again. Competition Patch does not send continuous data to the server, it only sends a small amount of data at the start and end of the race to validate your run.

If you don’t have internet connection, the game timer will turn red and your replay will not be validated:

How do I tell I’m running the game with the patch?

When you run the game first time with the patch, you will see this dialog:

Another way to check is to look at the game’s window title. If the game is fullscreen, switch to windowed mode and a Competition Patch title should be visible in the title of the window.

Downloads

Head to the top of the page to download the TrackMania ModLoader for the newest version.

Competition Patch 2.0 is not available as a standalone version. Please use ModLoader to install the patch.

How do I install?

If you are using Steam version, follow the guide to apply the Steam Fix from here, and then continue installing the Competition Patch.

After installing ModLoader, make sure to select Competition Patch from the list of mods by clicking on the tilted checkbox, and then click on the “Play” button on the right to launch the game with the patch.

How do I install on Linux?

For installing on Linux, follow the install guide by Craven available here.

How do I uninstall?

If you want to uninstall the patch, simply uncheck the mod in the ModLoader.

How does Competition Patch 2.0 work?

Competition Patch 2.0 is a complete rewrite of the original Competition Patch 1.0 to use a server based architecture to protect against TASes and slow motion play. Instead of using security through obscurity, the authority server sends a unique seed to the client at the start of the race, which is used to modify all player’s inputs according to the seed client side. Once the race is finished, the game client requests a signature from the server by sending the hash of final player’s inputs. The server timestamps all traffic from the client and produces a signature block signed with the server’s private key. The client then saves this block in the replay file for later validation.

The signature block is used to verify that the player produced the inputs in real time, by checking that the input modifications match the seed sent by the server. This effectively makes the game verifiably non-deterministic to the player without introducing any noticeable changes to driving or the gameplay physics. The player cannot replay a pre-recorded run without knowing the seed ahead of time. If the player tries to “fix” their inputs according to the seed they got, it will take much longer than the time it takes to drive the run, so the wall clock time logged by the server will not match the time of the replay.

The server does not store any information about replays or players - it only serves as a trusted authority so that clients cannot replace the seed with a pre-recorded one, and to timestamp the inputs to prevent slow motion play. The input and signature validation is performed on TMX when the replay is uploaded.

Q: How are the inputs modified?
A: All keyboard inputs are converted to analog, to make sure that the changes are effective. The algorithm is a bit complex, but it is designed to be unnoticeable.

Q: What data is sent to the server?
A: Server only receives a hash of the inputs.

Q: Does the server store any data about my runs?
A: No, the server doesn’t store any data. Everything is encrypted and saved inside the replay - the replay is verified only when it is uploaded to TMX.

Q: How stable my internet connection should be?
A: The server only needs a stable connection at the start and end of the race. If the connection is lost during the race, this does not immediately invalidate your run. Only if you permanently loose connection at the end of the race, your run will not be validated. The game will wait a few seconds at the end of the race to try to reconnect and validate your run.

Q: Are physics modified in any way?
A: No, physics are not modified. Only inputs are modified and the replays validate correctly ingame.

Q: Does it break Press Forward/Right/Left maps?
A: No, at the beginning of the race (2s) and after a respawn (1s) there is a grace period when the inputs are not modified.

Q: Is it opensource?
A: Currently no, but some parts of it (like the server) could be released in the future.

If you are interested in learning more about the details, see Tomashu’s post.