Line 1: |
Line 1: |
− | Maniaplanet 4 and Trackmania Turbo provide '''telemetry''' data via a shared memory interface. | + | Maniaplanet 4, Trackmania Turbo and Trackmania 2020 provide '''telemetry''' data via a shared memory interface. |
| | | |
| ==Interface== | | ==Interface== |
Line 17: |
Line 17: |
| * Vehicle state - Current information about the vehicle itself | | * Vehicle state - Current information about the vehicle itself |
| * Device state - Information for virtual chairs | | * Device state - Information for virtual chairs |
| + | * Player state - Information about the current player (TM2020) |
| | | |
| The complete data structure can be taken from the header file maniaplanet_telemetry.h: | | The complete data structure can be taken from the header file maniaplanet_telemetry.h: |
Line 28: |
Line 29: |
| | | |
| enum { | | enum { |
− | ECurVersion = 2, | + | ECurVersion = 3, |
| }; | | }; |
| | | |
Line 60: |
Line 61: |
| struct SGameState { | | struct SGameState { |
| EGameState State; | | EGameState State; |
− | char GameplayVariant[64]; // player model 'StadiumCar', 'CanyonCar', .... | + | char GameplayVariant[64]; // environment name 'stadium' 'canyon', .... |
| char MapId[64]; | | char MapId[64]; |
| char MapName[256]; | | char MapName[256]; |
Line 71: |
Line 72: |
| Nat32 NbCheckpoints; | | Nat32 NbCheckpoints; |
| Nat32 CheckpointTimes[125]; | | Nat32 CheckpointTimes[125]; |
− | Nat32 NbCheckpointsPerLap; // new since Maniaplanet update 2019-10-10; not supported by Trackmania Turbo. | + | Nat32 NbCheckpointsPerLap; |
− | Nat32 NbLaps; // new since Maniaplanet update 2019-10-10; not supported by Trackmania Turbo. | + | Nat32 NbLapsPerRace; |
− | char __future__[24]; | + | Nat32 Timestamp; |
| + | Nat32 StartTimestamp; // timestamp when the State will change to 'Running', or has changed when after the racestart. |
| + | char __future__[16]; |
| }; | | }; |
| struct SObjectState { | | struct SObjectState { |
Line 111: |
Line 114: |
| Bool IsLightsOn; | | Bool IsLightsOn; |
| Bool IsFlying; // long time since touching ground. | | Bool IsFlying; // long time since touching ground. |
| + | Bool IsOnIce; |
| + | |
| + | Nat32 Handicap; // bit mask: [reserved..] [NoGrip] [NoSteering] [NoBrakes] [EngineForcedOn] [EngineForcedOff] |
| + | float BoostRatio; // 1 thrusters starting/full .... 0 -> finished |
| | | |
− | char __future__[32]; | + | char __future__[20]; |
| }; | | }; |
| struct SDeviceState { // VrChair state. | | struct SDeviceState { // VrChair state. |
Line 120: |
Line 127: |
| | | |
| char __future__[32]; | | char __future__[32]; |
| + | }; |
| + | |
| + | struct SPlayerState { |
| + | Bool IsLocalPlayer; // Is the locally controlled player, or else it is a a remote player we're spectating, or a replay. |
| + | char Trigram[4]; // 'TMN' |
| + | char DossardNumber[4]; // '01' |
| + | float Hue; |
| + | char UserName[256]; |
| + | char __future__[28]; |
| }; | | }; |
| | | |
Line 130: |
Line 146: |
| SVehicleState Vehicle; | | SVehicleState Vehicle; |
| SDeviceState Device; | | SDeviceState Device; |
| + | SPlayerState Player; |
| }; | | }; |
| | | |
| } | | } |
| | | |
− | #endif // _MANIAPLANET_TELEMETRY_H</syntaxhighlight> | + | |
| + | // ----------------------------------------------- |
| + | // Changelog: |
| + | // Version 3 is a superset of Version 2. |
| + | // New fields are: |
| + | // Race.Timestamp, Race.StartTimestamp |
| + | // Vehicle.IsOnIce, Vehicle.Handicap, Vehicle.BoostRatio |
| + | // Player.* |
| + | |
| + | #endif // _MANIAPLANET_TELEMETRY_H |
| + | |
| + | </syntaxhighlight> |
| | | |
| ==Using the data== | | ==Using the data== |