Telemetry interface

Maniaplanet 4 and Trackmania Turbo provide telemetry data via a shared memory interface.

Interface
The data is written continuously to a non-persisted memory mapped file in virtual memory. External applications have direct access to it. The name of the file mapping object is ManiaPlanet_Telemetry.

The interface is active immediately after the start of the game. If Maniaplanet and Trackmania Turbo are running at the same time (or multiple instances of the same game), it is not possible to determine from which instance the data originates.

It is not known when or how often the data is updated. An export of the telemetry data by UDP streaming is not available. The data can only be received on the PC on which the game is running.

The following information is provided:
 * Game state - Information about the current state of the game
 * Race state - Information about the current state of the race
 * Object state - State of the vehicle within the virtual world
 * Vehicle state - Current information about the vehicle itself
 * Device state - Information for virtual chairs

The complete data structure can be taken from the header file maniaplanet_telemetry.h:

Using the data
Nadeo has provided an example program (including source code) in the closed Maniaplanet 4 Beta forums. The tool displays all of the provided telemetry data items live in a window.

To process the data, we need to know when and how the individual data records are provided. The following C++ source code allows you to create a simple console application that will output some of the telemetry data live:

UpdateNumer is used to synchronize the data between the game and the receiver. The variable is incremented once before the values are changed and once thereafter.

For timing information, the object state and vehicle state structures each contain a Timestamp variable. The resolution of the included time is 10 milliseconds.

A few notes about the race data:
 * A new race starts when the race state changes from BeforeState to Running.
 * A race ends when the race state changes from Running to Finished or BeforeState. In order to distinguish between finish and restart, it's necessary to check whether the checkpoint count has increased.
 * It is not guaranteed that the checkpoint time has been updated at the same time as the checkpoint number is raised.
 * There is no a lap counter. In a multi-lap race, you can not detect if a lap has been completed.
 * The provided telemetry data records are not cleared after a race ends.

Hardware and software that use the telemetry interface

 * D-BOX Technologies Inc. motion-cueing systems
 * TrackMania Telemetry Monitor