Jump to content Jump to content

F1 2020 UDP Specification


Recommended Posts

16 hours ago, Tempo1o1 said:

I know the post is old but i wanna say that the solution proposed by codeslave is working ! Thank you a lot. I also tried to replicate the same thing with te carStatusData but with no result. I added this piece of code


 else if (idPacket==7){

  PacketCarStatusData *tmp_pckt2 = (PacketCarStatusData *) packetBuffer;
          
          Serial.printf("%u %u %u %u %u %u %u %u %u %u traction %u antilock %u fuelmix %u \n",tmp_pckt2->m_header.m_packetFormat,
                                                  tmp_pckt2->m_header.m_gameMajorVersion,
                                                  tmp_pckt2->m_header.m_gameMinorVersion,
                                                  tmp_pckt2->m_header.m_packetVersion,
                                                  tmp_pckt2->m_header.m_packetId,
                                                  tmp_pckt2->m_header.m_sessionUID[0],
                                                  tmp_pckt2->m_header.m_sessionTime[0],
                                                  tmp_pckt2->m_header.m_frameIdentifier[0],
                                                  tmp_pckt2->m_header.m_playerCarIndex, 
                                                  tmp_pckt2->m_header.m_secondaryPlayerCarIndex,
                                                  tmp_pckt2->m_carStatusData[tmp_pckt2->m_header.m_playerCarIndex].m_tractionControl,
                                                  tmp_pckt2->m_carStatusData[tmp_pckt2->m_header.m_playerCarIndex].m_antiLockBrakes,
                                                  tmp_pckt2->m_carStatusData[tmp_pckt2->m_header.m_playerCarIndex].m_fuelMix
                                                  //*(float *)&tmp_pckt2->m_carStatusData[tmp_pckt2->m_header.m_playerCarIndex].m_throttle[0]
                                                  );


                                                  Serial.println(tmp_pckt2->m_carStatusData[tmp_pckt2->m_header.m_playerCarIndex].m_fuelMix);

       
  }  

Can someone please tell me why its not working? it gives me all zerso for the values of traction, antilock and fuelmix

Can you put all the code? How did you declare PacketCarStatusData? Why did you omit *(float *)& ... ?The variables has to be such an array .. I think you have missed something.

Edited by codeslave
Link to post
Share on other sites
1 hour ago, codeslave said:

Can you put all the code? How did you declare PacketCarStatusData? Why did you omit *(float *)& ... ?The variables has to be such an array .. I think you have missed something.

The above post and it's starter thread have been merged for discussion here.

Link to post
Share on other sites
On 4/25/2021 at 11:45 PM, e1smann said:

@luis8h In the event packet you can select "Fastest lap" events, store the time and compare it to other lap times afterwards.

Thank you for your answer, but I mean sonething else (sorry for explaining it a bit bad😅). 
I want to calculate the delta live, so you see while driving a lap, how fast you are compared to another. E. g. You drive trough a turn and know instantly if you did it better or not as good as in the other lap.

Another thing that would be interesting for me is, how to calculate the delta to the driver in front in a race.

Sorry for these basic questions, but I am completely new to this stuff😁

Link to post
Share on other sites
14 hours ago, luis8h said:

Thank you for your answer, but I mean sonething else (sorry for explaining it a bit bad😅). 
I want to calculate the delta live, so you see while driving a lap, how fast you are compared to another. E. g. You drive trough a turn and know instantly if you did it better or not as good as in the other lap.

Another thing that would be interesting for me is, how to calculate the delta to the driver in front in a race.

Sorry for these basic questions, but I am completely new to this stuff😁

read first pages of this topic. and use search function next time. people ask this one by month almost

Link to post
Share on other sites

I already searched in Google and in the Forum but I found nothing about the delta...

The problem is, that at the first page I could not find a value like delta. I think to calculate this you need to use x and y position in connection to the time of the current lap and the lap which is used as reference. That makes it very complicated to calculate and I thought there would maybe be a formula for this.

Or is there another trick to make it more simple, maybe I just think to complicated...

Link to post
Share on other sites
7 minutes ago, ThibaudPHP said:

LOL

Lying is bad and boring.

https://forums.codemasters.com/search/?q=delta &type=forums_topic&item=50942

 

And go read this message who is PAGE 1 of this topic...

 

*** i am very sorry...

I swear I searched after it, but it showed completely difrent solutions...

maybe I did something weong in the filter but I don‘t know what.

But anyway thank you for the link. This schould help me out.

Link to post
Share on other sites
20 hours ago, Hoo said:

 

Thanks @Hoo. I have applied for the beta however I noticed there was nowhere to indicate that I was signing up with the primary purpose of testing the updated telemetry api, hopefully this gets taken into consideration when deciding who gets access to the beta. Cheers

Link to post
Share on other sites
1 minute ago, cjorgens79 said:

Thanks @Hoo. I have applied for the beta however I noticed there was nowhere to indicate that I was signing up with the primary purpose of testing the updated telemetry api, hopefully this gets taken into consideration when deciding who gets access to the beta. Cheers

I create a post on the topic to said that i want be part for the telemetry. i invite you to do the same. I hope it can increase our chance to be taken to explain on the topic why we apply ;)

Link to post
Share on other sites
  • Codemasters Staff

If any regular contributors to this UDP thread have applied to the beta then please send me a PM and I will pass on your details to the "Beta Application Review Committee" for consideration. 

  • Like 1
  • Agree 6
Link to post
Share on other sites
Posted (edited)

@Hoo

I know you must be quite far into the development, but here is the list I promised containing some items I would like to see fixed/changes (hopefully maybe even before the BETA hits the road), which would make life easier for the tool devs.

1) No enum value 0: All places, where there is an enum (e.g. like with Team IDs), can you alter them so, that 0 is never valid value (e.g. with TeamID, Mercedes' ID would be something else than 0 and same in driverIds for Carlos Sainz). Now e.g. if there is no data in some packets, the data sent out is 0, so it becomes hard to see, if the data is missing or if the data is for the ID with 0. Would make the life of the developers so much easier.

2) Tyre wear as floats. Now the tyre wear is an int, which has forced me and other developers to build systems to estimate tyre wear from those int values with lapdistance. But e.g. in the tyre wear practice session the tyre wear values shown by the game are floats, not ints, so it is hard to add proper tyre wear analysis as shown in the game into our tools.

3) DriverIDs are now conflicting. In some mode the player car ID is reported as 100, but in the 2020 F2 driver list there is now drivers with ID 100 and 101 and 100 and 101 are driver IDs e.g. in league racing.

4) TC is either 0 or 2. This is the issue which was raised earlier and has been in the game, since the TC values have been reported. I.e. in the game there are 3 different TC modes, but the UDP only reports it either 0 or 2. Would be great to see this set that the proper values are shown.

Bugs/issues in F1 2020 and older:

Laptime for Quali inlap. At least in F12020, when a player drives back to pit after quali lap, the game reports for the inlap as last laptime from the previous quali lap. So the time is not from the inlap. Again this little thing forces the devs to look at, if a lap in quali session ends in pits, after which the laptime must be "guessed"/calculated. If one relies on the laptime sent by the game, the data will be bad.

Lapdata for Ghost. In F1 2018 and F12019 in Time Trial the LapData contained the lapdistance data etc. for the Ghost. This was removed from F12020, which made it pretty hard to get the proper data for the Ghost for comparison purposes. I would like to see the Ghost's LapData, at least laptime, times + lapdistane, but preferably all the data to be added back.

Cheers

Edited by LonelyRacer
Just fixed a typo
  • Agree 3
Link to post
Share on other sites
  • Codemasters Staff
On 5/2/2021 at 11:20 AM, LonelyRacer said:

@Hoo

I know you must be quite far into the development, but here is the list I promised containing some items I would like to see fixed/changes (hopefully maybe even before the BETA hits the road), which would make life easier for the tool devs...

Thanks for these. Here's a quick response on the issues that you posted:

1) No enum value 0. As this is based on the data coming directly from the game, this isn't an easy thing for us to change without reorganising the game data itself (which we can't do at this stage). As such, we will leave this as it is, unless we can find another way to flag valid / invalid values containing 0.

2) Tyre wear as floats. We will change this to floats.

3) DriverIDs are now conflicting. We understand the issue, but aren't yet sure how we can fix it as it again ties in with other data coming from the game. We will need to consider this issue further.

4) TC is either 0 or 2. We've logged a bug to investigate this. I'm assuming that medium TC (value = 1) is the one not coming through correctly.

Laptime for Quali inlap. Again, the data just reflects what the game itself does (discards inlaps from the results), so not sure we can fix this with the telemetry system. We've logged this issue for further investigation.

Lapdata for Ghost. We will revert this back to the 2019 implementation as suggested.

 

  • Thanks 1
  • Agree 1
Link to post
Share on other sites
25 minutes ago, Hoo said:

Thanks for these. Here's a quick response on the issues that you posted:

1) No enum value 0. As this is based on the data coming directly from the game, this isn't an easy thing for us to change without reorganising the game data itself (which we can't do at this stage). As such, we will leave this as it is, unless we can find another way to flag valid / invalid values containing 0.

2) Tyre wear as floats. We will change this to floats.

3) DriverIDs are now conflicting. We understand the issue, but aren't yet sure how we can fix it as it again ties in with other data coming from the game. We will need to consider this issue further.

4) TC is either 0 or 2. We've logged a bug to investigate this. I'm assuming that medium TC (value = 1) is the one not coming through correctly.

Laptime for Quali inlap. Again, the data just reflects what the game itself does (discards inlaps from the results), so not sure we can fix this with the telemetry system. We've logged this issue for further investigation.

Lapdata for Ghost. We will revert this back to the 2019 implementation as suggested.

 

@Hoo

Great stuff. Thank you for the update and for relaying this to the devs.

For 1), maybe invalid data for the enums could be -1 (but I don't remember, if all those are signed ints). In some other games invalid values are sometimes max possible values, i.e. e.g. for int16 it is set to 32767 for invalid/bad value.

4) You are correct. No TC is 0 and TC med or high is sent out as 2.

Cheers

  • Agree 1
Link to post
Share on other sites
40 minutes ago, Hoo said:

Thanks for these. Here's a quick response on the issues that you posted:

1) No enum value 0. As this is based on the data coming directly from the game, this isn't an easy thing for us to change without reorganising the game data itself (which we can't do at this stage). As such, we will leave this as it is, unless we can find another way to flag valid / invalid values containing 0.

2) Tyre wear as floats. We will change this to floats.

3) DriverIDs are now conflicting. We understand the issue, but aren't yet sure how we can fix it as it again ties in with other data coming from the game. We will need to consider this issue further.

4) TC is either 0 or 2. We've logged a bug to investigate this. I'm assuming that medium TC (value = 1) is the one not coming through correctly.

Laptime for Quali inlap. Again, the data just reflects what the game itself does (discards inlaps from the results), so not sure we can fix this with the telemetry system. We've logged this issue for further investigation.

Lapdata for Ghost. We will revert this back to the 2019 implementation as suggested.

 

Hello @Hoo

I found something who is a bug for me. When a Player join a lobby in qualification after everyone and took a car, the car number send by the telemetry is not his but the official one. ex : if i join late and i took the hamilton car, my number send via telemetry will be 44

I have a lot of features i would like implement, but maybe it's not the moment. Tell me when i can share my list and let see what can be accepted.

Thanks

 

Link to post
Share on other sites
  • Codemasters Staff
1 hour ago, LonelyRacer said:

For 1), maybe invalid data for the enums could be -1 (but I don't remember, if all those are signed ints). In some other games invalid values are sometimes max possible values, i.e. e.g. for int16 it is set to 32767 for invalid/bad value.

 

That looks like a good idea. We'll see if we can implement something along those lines.

Link to post
Share on other sites
  • Codemasters Staff
1 hour ago, ThibaudPHP said:

Hello @Hoo

I found something who is a bug for me. When a Player join a lobby in qualification after everyone and took a car, the car number send by the telemetry is not his but the official one. ex : if i join late and i took the hamilton car, my number send via telemetry will be 44

I have a lot of features i would like implement, but maybe it's not the moment. Tell me when i can share my list and let see what can be accepted.

Thanks

 

Now is a good time! If anything is too complex to add for F1 2021 then it is still useful to know now for the future.
 

Link to post
Share on other sites
1 minute ago, Hoo said:

Now is a good time! If anything is too complex to add for F1 2021 then it is still useful to know now for the future.
 

My wish list for telemetry

1. like penalty, a warning field in packet 2 will be welcome. Actually warnings are send only via packet 3, if you miss the packet or it is lost on the internet you miss the warning.
2. I would like to know when a stop and go is did/paid by a racer. We know when he receive one (packet 3) but never when he paid one.
3. The full list of assist used. not only abs and traction. line, breaking assist, pit, etc.
4. On a lot of league where i work with, it's forbiden to put start during the race. To detect start i use a combo when i detect that the assists change. (the AI is lazy and don't drive with TC off :D) It will help me a lot to know who press start.
5. i know that is impossible to have delta, because the way there are calculate are not the same in TT and in race. But, if we can have like some checkpoint to have a better way to calcul delta without it cost us a lot on calcul. Right now, my solution is calcul gap with sector. I wish have like 10 checkpoint by track to be able to afine this kind of delta.
6. I don't need personnaly because i found a great solution to solve this problem but, for the community on this topic I must ask, the name of the racer. I know with rgpd it's complicated and it's asked so many times. i am sorry, but it was a mandatory to put on my wishlist for my collegues programmers
7. i wish that the formation lap stay with (on packet 1) value safetyCarStatus = 3  (data not put on the help). This is a very good way to detect the formation lap and i am, very afraid to loose this feature.

i am aware that this list is very personna, thanks for what you can implement.

I forgot to told an old bug the m_
resultStatus give us a data 7 who is not listed. The 7 is equal to 6. When we receive it, the car is retired of the race.

Thanks !!

Link to post
Share on other sites
On 4/2/2021 at 5:22 PM, 101jez101 said:

Hi - two things you can maybe help with?

1. where can I find the official track map data? 

2. how long and wide is the car using the worldPosition XZ scale? Presumably that point is the centre of the car seen from above? 

Late response to this - we just open sourced our SVG track maps here https://github.com/f1laps/f1-track-vectors. Maybe they're helpful for you or others.

3 hours ago, Hoo said:

Now is a good time! If anything is too complex to add for F1 2021 then it is still useful to know now for the future.
 

  1. Some mechanism to identify the end of a lap / start of a new lap. We have several workarounds in place to calculate total lap time or the telemetry set of a specific lap. 
  2. Exposing the AI difficulty level set for the (offline) session
  3. Exposing an identifier for the Grand Prix weekend across sessions (so that qualifying and race sessions can be tied together, for instance). And exposing an identifier for, or the name of, the career mode season (like "My Team, Nickname ABC, Season 1").
  4. Persisting the session ID of an offline session across game restarts (when using "mid session save & exit")
  5. A mechanism to clean telemetry data of flashbacks (for instance removing/skipping the telemetry data that is being overwritten because the user is driving the same distance again after a flashback)

Thank you in advance for considering these. I appreciate your engagement with the community on this. 👍

  • Like 1
  • Thanks 1
Link to post
Share on other sites
3 hours ago, Hoo said:

Now is a good time! If anything is too complex to add for F1 2021 then it is still useful to know now for the future.
 

For me the negative lap distance, same lap number on flying outlaps is not ideal. If, every time you cross the start finish line, even if in the pits or if you abort the lap, the lap number increments would be better. My current solution is a bit of a hack but I'm probably missing something. Please explain how I should identify the start of a new lap if I am. 

 

Also, with flashbacks, a 'this is a replacement frame' flag would be useful. I get that you can't do a 'this frame is going to be deleted' flag 😊

  • Agree 1
Link to post
Share on other sites

@Hoo

One little request for F1 2021 (and might be valid for 2020, if there is still a patch coming for it).

I just tested the new Thrustmaster SF1000 and it has 25 buttons , but the game only reports values for controller buttons. i.e. up to 14. Would it be possible, that the game would also enumerate to the UDP feed the other buttons, if the wheel has more than 14 buttons. The m_buttonStatus is int32, so it would be possible to send the data up-to 32 buttons.

I am sure this is an issue with other new steering wheels from Fanatec too, which have more than 14 buttons.

It would be great, if that could also be added to F1 2020, but hopefully it will be added at least to F1 2021.

Cheers

Link to post
Share on other sites
  • Codemasters Staff
On 5/4/2021 at 1:08 PM, ThibaudPHP said:

My wish list for telemetry...
 

Here's an initial response to your requests:

  1. Add a new, separate event for warnings in packet 3.
    • We’ve added this to our backlog
  2. Add a means of detecting when a stop-go penalty has been served
    • We’ve added this to our backlog
  3. Provide information about all assists used (currently just does a subset of them)
    • We’ve added this to our backlog
  4. Add a way of indicating when a real player is in a paused state
    • We’ve added this to our backlog
  5. Add checkpoints to help with delta calculation
    • You should be able to use the m_lapDistance from LapData packet in conjunction with the m_trackLength from the Session Packet to give the a fraction the car is round the track. This should give “checkpoints” round the track from which you can work out the delta.
  6. Include the name of the player in the UDP data.
    • We have a proposed solution that is with our legal team for review.
  7. Include formation lap status in safetyCarStatus field (using value 3).
    • We will keep this in and update the documentation to show what this value does.
  8. Bug where m_resultStatus gives an unlisted value of 7
    • This has been fixed.

We'll let you know if anything on the backlog gets implemented.

  • Thanks 1
Link to post
Share on other sites
32 minutes ago, Hoo said:

Here's an initial response to your requests:

  1. Add a new, separate event for warnings in packet 3.
    • We’ve added this to our backlog
  2. Add a means of detecting when a stop-go penalty has been served
    • We’ve added this to our backlog
  3. Provide information about all assists used (currently just does a subset of them)
    • We’ve added this to our backlog
  4. Add a way of indicating when a real player is in a paused state
    • We’ve added this to our backlog
  5. Add checkpoints to help with delta calculation
    • You should be able to use the m_lapDistance from LapData packet in conjunction with the m_trackLength from the Session Packet to give the a fraction the car is round the track. This should give “checkpoints” round the track from which you can work out the delta.
  6. Include the name of the player in the UDP data.
    • We have a proposed solution that is with our legal team for review.
  7. Include formation lap status in safetyCarStatus field (using value 3).
    • We will keep this in and update the documentation to show what this value does.
  8. Bug where m_resultStatus gives an unlisted value of 7
    • This has been fixed.

We'll let you know if anything on the backlog gets implemented.

1. Thanks a lot
2. on your point 1 you wrote in packet  3. you wanted to say packet 2, right ?
3. on your point 5, i think the m_lapDistance is giving  the lap distance even if i do donuts  (I need to check that). so for me, it's not a reliable value, but i will check

Thanks a lot for this !

Link to post
Share on other sites
  • Codemasters Staff
1 minute ago, ThibaudPHP said:

2. on your point 1 you wrote in packet  3. you wanted to say packet 2, right ?
 

I assumed you wanted something in the event packet, like we provide for penalty notification. Did you mean for this to be included in the LapData packet to indicate how many warnings a player received in a that lap?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...