Changes

Jump to navigation Jump to search
1,324 bytes added ,  16:43, 4 July 2022
m
→‎maniaplanet_telemetry.h: Fixed comment for SGameState::GameplayVariant
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];    // environment name 'stadium' 'canyon', ....
+
         char        GameplayVariant[64];    // player model 'StadiumCar', 'CanyonCar', ....
 
         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];
         char        __future__[32];
+
        Nat32      NbCheckpointsPerLap;
 +
        Nat32      NbLapsPerRace;
 +
        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 109: 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 118: Line 127:     
         char        __future__[32];
 
         char        __future__[32];
 +
    };
 +
 +
    struct SPlayerState {
 +
        Bool        IsLocalPlayer;          // Is the locally controlled player, or else it is 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 128: 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==
Line 295: Line 324:  
* 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.
 
* 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.
 
* 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 current lap of a multi-lap race can be determined by dividing NbCheckpoints by NbCheckpointsPerLap.
 
* The provided telemetry data records are not cleared after a race ends.
 
* The provided telemetry data records are not cleared after a race ends.
   Line 303: Line 332:  
* [http://tech.d-box.com/corporate-page/downloads/#pane-0-2 D-BOX Technologies Inc. motion-cueing systems]
 
* [http://tech.d-box.com/corporate-page/downloads/#pane-0-2 D-BOX Technologies Inc. motion-cueing systems]
 
* [https://www.simhubdash.com/ SimHub, Sim Racing Dashboard and Hardware]
 
* [https://www.simhubdash.com/ SimHub, Sim Racing Dashboard and Hardware]
 +
* [https://www.stryder-it.de/simdashboard/ SIM Dashboard Android App]
 
* [[Telemetry_Monitor|TrackMania Telemetry Monitor]]
 
* [[Telemetry_Monitor|TrackMania Telemetry Monitor]]
 
* [https://www.symprojects.com/ SymProjects SimDash, Sim Monitor]
 
* [https://www.symprojects.com/ SymProjects SimDash, Sim Monitor]

Navigation menu