Changes

Jump to navigation Jump to search
1,005 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 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 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==
Line 297: 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.
  

Navigation menu