Jump to content
  • 2

F1 2018 UDP Specification

Question

OVERVIEW

The F1 series of games support the outputting of key game data via a UDP data stream. This data can be interpreted by external apps or connected peripherals for a range of different uses, including providing additional telemetry information, customised HUD displays, motion platform hardware support or providing force feedback data for custom steering wheels. The following information is a summary of the data that is outputted so that developers of supporting hardware or software are able to configure these to work with the F1 game correctly. If the information you require is not contained here, or if you have any issues with the UDP data itself, then please let us know and a member of the dev team will respond to your query as soon as possible.

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Hi,

anybody willing to explain to me how to convert the data received via UDP in C#? I am new to this, but want to make my own telemetry software. I have the same problem as @baconbrawler - Getting symbols and random letters in output.

I would really appreciate if anyone could help me.

Share this post


Link to post
Share on other sites
  • 0

Hi Codemaster and others is i possible to include Fueldelta (remaning fuel laps) i see it in the game on screen, but realy want this on my simhub external dash.

I have tryede many solutions to calculate this but i i very diffiicult

 

image.png.7cb098410d20e2ce3584115d5dbcebfd.png

 

/ Thanks 

Tim

Edited by timmhc

Share this post


Link to post
Share on other sites
  • 0

I'm trying to use the data from the carsmotion packet to plot where the car is during a lap. From the commercial dashboard products I've seen, the track behavior seems smooth and well-defined, but from my packets, the motion of the car implies that the tracks are intersecting at certain points. The attached picture demonstrates what I'm observing. This is on the 60-hz setting.

Is it assumed that I should be smoothing/sampling the data somehow, or applying some sort of 'snapping' function to take the data from the packet and force it onto the track boundaries? Similarly, are there track boundaries (x,y,z values) we can use as a base image to understand how the track boundaries are defined in the game?

Screenshot from 2019-03-05 08-43-51.png

Share this post


Link to post
Share on other sites
  • 0

Hi @Hoo

There is an issue with the F1 2018 telemetry data with the race position fields getting scrambled right at the very end of a multi player session. As apps like mine quite heavily rely on the data from the telemetry, it is causing a number of issues for users who are seeing messed up positions in my online portal which they use to review sessions post race. I had one of my users record the raw telemetry data for me and can clearly see the positions of players getting jumbled as soon as the final player crossed the finish line. As its right at the end of the session, it only seems to be sending out a fairly small number of packets in this state before the telemetry stops altogether, but its enough for the app to be affected by it. I have also seen this happen at the end of qualifying sessions too, so i think its just something that is occuring right at the final moments before the session ends completely.

I can provide the raw UDP stream recording if you like, or if you need me to provide further info in order to track this down, please let me know what you need.

Thanks,

Craig

Share this post


Link to post
Share on other sites
  • 0

Hey guys, just a quick question, and it might be a pretty stupid one, but I just went over the Package explainations again and saw something, that made me scratch my head

uint8       m_drsAllowed;               // 0 = not allowed, 1 = allowed, -1 = unknown

as far as i understand unsigned integers, they should not be able to be "-1" or is there a special case in c/c++, where that can happen? personally i code in c#, so i use the "byte" type for the uint8, and they warn me, that byte can't be "-1"

Share this post


Link to post
Share on other sites
  • 0
18 hours ago, Bannish said:

Hey guys, just a quick question, and it might be a pretty stupid one, but I just went over the Package explainations again and saw something, that made me scratch my head


uint8       m_drsAllowed;               // 0 = not allowed, 1 = allowed, -1 = unknown

as far as i understand unsigned integers, they should not be able to be "-1" or is there a special case in c/c++, where that can happen? personally i code in c#, so i use the "byte" type for the uint8, and they warn me, that byte can't be "-1"

Its probably just a bad comment, the value would likely always just be 0 or 1. However if i am wrong then and they do set it to -1 in the underlying structure at some point, then if you read that field as UInt8 (byte in c#) you will get the value of 255 instead of -1. You can however just read it as Int8 (sbyte in c#) and it will work correctly. 

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

HI All

 

how did you managed the laptime on the q3?

 

 i've create a simple classification same as tv show with the laptime and delta in realtime for the qualify.

in the q3 (also in the othre Q but in Q3 has more evidence), the game stops to send the data before the lastest lap, because when the time of the session is finished, some cars are yet on their flying lap.

so, after the session, my timedata are old and different than the game time data.

is there a way to fix this or not?

 

2nd request:  currentlaptime starts at the start session time, so if you are in the box the currentlaptime is running.
obviously , when you cross the start line after the outlap the count is resetted. but how i can check with precision when i cross the start line?

 

i've tried with currentlaptime = 0 but doesn't works

tried with trackdistance  == 0 but doesn't works

only if i use the signal > 0 works.

is there a way to check it with precision?

 

thanks in advance

 

 

 

 

 

Edited by Oasis81

Share this post


Link to post
Share on other sites
  • 0
21 hours ago, Oasis81 said:

HI All

how did you managed the laptime on the q3?

 i've create a simple classification same as tv show with the laptime and delta in realtime for the qualify.

in the q3 (also in the othre Q but in Q3 has more evidence), the game stops to send the data before the lastest lap, because when the time of the session is finished, some cars are yet on their flying lap.

so, after the session, my timedata are old and different than the game time data.

is there a way to fix this or not?

2nd request:  currentlaptime starts at the start session time, so if you are in the box the currentlaptime is running.
obviously , when you cross the start line after the outlap the count is resetted. but how i can check with precision when i cross the start line?

 

i've tried with currentlaptime = 0 but doesn't works

tried with trackdistance  == 0 but doesn't works

only if i use the signal > 0 works.

is there a way to check it with precision?

In single player, the telemetry stops the moment you cross the finish line, so its not possible to get accurate readings for any opponents behind you in the session. This is a known limitation of the game unfortunately. In multiplayer sessions the telemetry continues until the overall session ends, so you can do it for that.

As for detecting the start in your second question, the only real way I can think of would be to detect when the currentlaptime goes backwards to a zero/near zero value. Need to check its near zero to avoid issues with flashbacks, although its not foolproof as a flashback could technically result in that too under the right circumstances.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

 

ok, i understood the first point.. it's a bit annoying  but ok
for precision: the telemetry stops after the timer is gone to 0. because the problem still also if i stay all the Q in the garage. so for the game the 00:00 time equals the finish line for the player.

 

for the second point.. your suggestion is interesting
i can check in the code with if 0 < currentlaptime < 10..   with a some arrangements, it could works... my problem is only the visbility of the text of the laptime.

i'll check better this evening.

 

thanks

 

edit: thanks cjorgens79, works perfectly.  

image before start line, current laptime and after sector with delta.

thanks a lot

 

 

Immagine.png

Immagine3.png

Immagine2.png

Edited by Oasis81

Share this post


Link to post
Share on other sites
  • 0

@Hoosince this will probably not make it into F1 2018 it would be great if the Event packet can be extended in F1 2019 to include a "Lap Restarted" event. I am working on a platform where players can send their Time Trial lap times + full telemetry to a website and I currently have to write code to detect lap restarts. It works most of the time but can be a bit flaky in certain edge cases. Such an event would make that a lot easier.

Share this post


Link to post
Share on other sites
  • 0

You mention in the participants packet that on pc it will give the users steam id but unfortunately I seem to only be receiving the users steam name, not their ID, is there any way to get the users steam id?

Share this post


Link to post
Share on other sites
  • 0

I am having an issue where motion telemetry stops outputting when the vehicle is in motion, but at idle the data comes through correctly.

I am using a PC with UDP enabled, and everything else comes over completely fine, except for motion data. It has the motion data when the car is not moving (you can feel the small vibration of the seat and the G plotter wiggles), but the second the car moves, the g force lat/long/vert of each vehicle goes to 0 and all the rest of the data comes through fine. Then if you stop the car, the motion data comes through again. And all the while the car is in motion, the gear shifts are registering, speed, engine RPM, etc etc. Really only the X Y and Z local accelerations are not showing in the per car motion data packets.

One of the PCs I am using it works fine on, the other (which is newer and has much less on it) is the one having the issue. They are both gaming computer home built with no bloatware. 

I have tried 2 different programs and they are both showing the same result of no motion data once moving.

I have already uninstalled the game, tried just deleting the configs and launching the game again and then using in game settings to enable telemetry, ive tried patching, manually, and googled about everything I could think on this topic and now I am all out of ideas!

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hello,

looking in various posts about formula and UDP i see

that in modifications of the hardware_settings_config.xml ,

various fields which aren't presend at original file like

sendRate added.  Can i have a full list of the possible

additional fiels? Thangs in advance.

Edited by KerberosJoy

Share this post


Link to post
Share on other sites
  • 0
On 3/8/2019 at 8:22 AM, DaveyGravy said:

I haven’t actually used this data in my app yet for mapping, but I have played around with it previously. From memory you need to use x and z to get a birdseye view of the track if that’s what you're after. I just dumped the data for these into Excel and drew a graph and it looked like the track in question.

This is great help, thanks! @DaveyGravy @randyzwitch do you guys happen to know whether the x, z coordinates for F1 circuits available somewhere to use when plotting the data on top of it. It can probably be figured out from the telemetry data but I am assuming this should be something already available. 

Share this post


Link to post
Share on other sites
  • 0
On 8/30/2018 at 2:18 AM, HassanKLD said:

Hello!

Firstly thanks for posting this @Hoo. I'm currently creating something for myself, but found the forum a little tedious to keep coming back to for the info, so I created a quick reference doc for myself. Others might find it useful. Link here. It's not fully complete I still need to port of the full appendices. @Hoo If you or anyone at Codemasters would like to take ownership of this I'm more than happy to. It's just a github repo, and the docs are written in Markdown and auto generated.

Ok so on the actual UDP spec side, I picked up a few things and just wanted to clarify/point few things out.

  1. the buffer size for Motion packet is 1341 Bytes, after accounting for everything in the structs I get a total of 1221 Bytes. Is this correct? If so whats in the remaining 120 Bytes? anything useful or can it be simply ignored.
  2. The m_eventStringCode in the PacketEventData Struct are mentioned to be UInt8[4], but in the table below it shows code as 'SSTA' and 'SEND'. is the UInt8 an error as they should be Chars
  3. I agree with @trenamax to move the m_drsAllowed to the carTelemetryPacket
  4. I would really like to have the track limits in the data stream, maybe m_trackLimitLeft and m_tackLimitRight maybe on the MotionData Packet. Edit: thinking more about this, I think it would be useful to get the world x,y, z of the left and right limit

thanks! Hass

Quote

I would really like to have the track limits in the data stream, maybe m_trackLimitLeft and m_tackLimitRight maybe on the MotionData Packet. Edit: thinking more about this, I think it would be useful to get the world x,y, z of the left and right limit

This would really be useful! I am current unsure where to get the x, y, z coordinates for the track limits.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hey All. The 2018 spec looks pretty nice. Lots of useful data.

 

This may be a stupid question, but what units are all of the spatial information (car location, speed, etc.) in?  Is the unit system the same as the F1 2017 UDP specification?

 

Apologies if this question has already been asked and answered.

Edited by ElectricTurtle

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

 

 

12 minutes ago, ElectricTurtle said:

Hey All. The 2018 spec looks pretty nice. Lots of useful data.

 

This may be a stupid question, but what units are all of the spatial information (car location, speed, etc.) in?  Is the unit system the same as the F1 2017 UDP specification?

 

Apologies if this question has already been asked and answered.

As you can see below, car speed is in Kph, which comes as part of CarTelemetryData 

On 8/23/2018 at 7:01 PM, Hoo said:

uint16 m_speed; // Speed of car in kilometres per hour

I am also still trying to figure out the car location on the rack as well but this is helpful to give some hints: 

 

Edited by tourismgeek

Share this post


Link to post
Share on other sites
  • 0
Just now, ElectricTurtle said:

Rather than laying out a custom byte structure for the UDP spec and creating a programming headache for how to bring that data into a particular application's memory, have you considered using Google's Protobuf library? https://developers.google.com/protocol-buffers/

 

💯Huge +1 for this one!

Share this post


Link to post
Share on other sites
  • 0

Hi @Hoo and everyone,

I am working with F1 2018 on PS4.

I am trying to get the telemetry and lap time data of the Ghost car in Time Trial mode.
However, m_currentLapTime and all the CarTelemetryData are 0.0

Also the m_numCars is 1, but in the Participants I can see the names of the other Ghost cars (my best lap and my opponent).

Data received during a race are fine.

I think my problem is related to this 
https://forums.codemasters.com/topic/30601-f1-2018-udp-specification/?do=findComment&comment=386981

Thank you in advance

Share this post


Link to post
Share on other sites
  • 0
On 2/28/2019 at 12:53 PM, timmhc said:

Hi Codemaster and others is i possible to include Fueldelta (remaning fuel laps) i see it in the game on screen, but realy want this on my simhub external dash.

I have tryede many solutions to calculate this but i i very diffiicult

 

image.png.7cb098410d20e2ce3584115d5dbcebfd.png

 

/ Thanks 

Tim

Good one! How does CM calculate both numbers regarding fuel/laps?

i have tried to figure this out also, but all my calculations never come to what is on screen self. 

How do I get the same values as whats on my screen for how many laps fuel is in the car and the delta fuel?

 

@Hoo

Share this post


Link to post
Share on other sites
  • 0

@Hoo, I was on the presentation of F1 2019 in Hamburg and I can see in the menus that there's 2019 UDP specification. The menu was inactive, so I can't check but I figure the game includes 2018 and Legacy also.

Can you tell us something about? When can you tell us all about 2019 specification? I ask for being included in the beta mainly for this...not lucky 😞

Share this post


Link to post
Share on other sites
  • 0
3 minutes ago, navarreitor said:

@Hoo, I was on the presentation of F1 2019 in Hamburg and I can see in the menus that there's 2019 UDP specification. The menu was inactive, so I can't check but I figure the game includes 2018 and Legacy also.

Can you tell us something about? When can you tell us all about 2019 specification? I ask for being included in the beta mainly for this...not lucky 😞

I'd guess they will show the specifications to the beta people first, but hopefully you can get the information before the launch at least 🙂

Share this post


Link to post
Share on other sites
  • 0

Any updates for the 2019 specification?

Share this post


Link to post
Share on other sites
  • 0

I hope that the real Fuel telemetry data (Fuel left at the end of the race) will be included in the F1 2019 game. This is sadly not the case in 2018 game 

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hi All

Looking at the byte count on the structs (as per the first post) it would seem the packet size is greater than the sum of its parts? The session packet for example is 147 bytes but the content is approx 44?

-a

Edited by alp1983

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×