Codemasters F1 data feed updated

With F1 2012 Codemasters updated their data feed to include a whole set of useful extra parameters, including sector information, lap change data, KERS, DRS, and a whole bunch more.
November 21 2013

This is an update the my original post of a couple of years ago detailing the packets exposed by Codemasters racing games.  Please read the original if you want detailed information on connecting. That post contains C# sample code for hooking into the UDP stream exposed by Codemasters.  

Before receiving the data we need to reconfigure F1 to point to our end point.  This is done by modifying the “hardware_settings_config.xml” file found in your My Documents folder subpath ./My Games/FormulaOne2013/hardwaresettings/. Open the file and change the line (replace FormulaOne2013 with your Codemasters game)

Old Telem Setting

to be

f12013-telemetrysettings

You can set ip and port to the correct values for wherever your UDP end point will be listening for a connection. Please ensure you've set the file to readonly in its properties or Codemasters F1 will overwite it with the original values.

The packet Codemasters F1 puts out through this contains the following fields in order.  All fields are float datatype (in C#)

Field Description
Lap

The number of laps since the session began.

Restarting a Session in the game will set this back to 0.

Time

Time in seconds since this telemetry session began

Restarting a Session in the game will set this back to 0.

LapTime Time in seconds since the lap began. F1 2012 has a capture/send rate of 60 telemetry packets per second.  This is 0 for an 'out lap'
LapDistance The distance in meters since the lap began.  This can be negative for 'out' laps.  If you cross the start finish line and then reverse back over it the LapDistance will shoot back up buytbut the Lap will stay the same
Distance

The laps and percent of laps covered since the session began.

The value is negative when you first enter a practice session.  After you cross the start finish line for the first time it becomes positive (0).  A value of 1.5 would indicate you're halfway through your second lap.  1.995 would indicate you're almost finished your second lap.

X The X position of the car in the world
Y The Y position of the car in the world
Z The Z position of the car in the world
Speed The car speed at this point in time.  To get km/hr, multiply this value by 3.6 (I’m not sure why codemasters uses this scale).
XV  
YV  
ZV  
XR  
YR  
ZR  
XD  
YD  
ZD  
SuspensionPositionRearLeft The position of the rear left suspension
SuspensionPositionRearRight The position of the rear right suspension
SuspensionPositionFrontLeft The position of the front left suspension
SuspensionPositionFrontRight The position of the front right suspension
SuspensionVelocityRearLeft The speed of travel of the rear left suspension
SuspensionVelocityRearRight The speed of travel of the rear right suspension
SuspensionVelocityFrontLeft The speed of travel of the front left suspension
SuspensionVelocityFrontRight The speed of travel of the front right suspension
WheelSpeedRearLeft The speed the rear left wheel is travelling.  I assume this value with Speed subtracted gives wheelspin.  Although it’s a good 6 km/hr faster than the front, if that’s the case!
WheelSpeedRearRight The speed the rear right wheel is travelling.
WheelSpeedFrontLeft The speed the front left wheel is travelling
WheelSpeedFrontRight The speed the front right wheel is travelling
Throttle The percent of throttle applied.  1 = full throttle and 0 = no throttle
Steer The amount of left/right (-/+) input into steering. 0 = straight ahead.
Brake The percent of brake applied. 1 = full brake and 0 = no brake
Clutch This value will always be 0
Gear The current gear
GForceLatitudinal The amount of gforces being generated due to turning
GForceLongitudinal The amount of gforces being generated due to acceleration or braking
Lap The current Lap.  0 = first lap across the start/finish line.
EngineRevs The RPM of the engine. This value needs to be multiplied by 10 to get the real RPM, so it would seen.
NewField1  
RacePosition Position in the race. Only greater than 0 when in a race (of course)
KersRemaining  
KersRecharge  
DrsStatus  
Difficulty  
Assists  
FuelRemaining  
SessionType  
NewField10  
Sector The current sector. 0 = 1st sector, 1 = 2nd sector,  2 = 3rd sector.  
TimeSector1 Time spent in sector 1 on current lap (0 until in sector 2)
TimeSector2 Time spent in sector 2 on currnet lap (0 until in sector 3)
BrakeTemperatureRearLeft  
BrakeTemperatureRearRight  
BrakeTemperatureFrontLeft  
BrakeTemperatureFrontRight  
NewField18  
NewField19  
NewField20  
NewField21  
CompletedLapsInRace  
TotalLapsInRace  
TrackLength  
PreviousLapTime  in seconds.

If you want more info, be sure to check out the F1Speed project in Github, particularly the F1Speed.Core project and the TelemetryManager, TelemetryLap, and TelemetryPacket classes.

Post a comment

comments powered by Disqus