Jump to content
Bug Reporting - PLEASE FOLLOW RULES AND COMPLETE REPORTS Read more... ×
PC Forum Championship Season 4 F1 2020 | Sign Up Here Read more... ×
F1 2021 | Arrives July 16 | First Look Here Read more... ×

F1 2020 UDP Specification

Recommended Posts

1 hour ago, BernoAU said:

The in game wheel displays how many laps of fuel not kg.

That'll be the confusion then! So we don't actually get the number shown on the in game dash, in the feed do we? We get:

float       m_fuelRemainingLaps;        // Fuel remaining in terms of laps (value on MFD)

which shows the delta number of laps/fuel +/-, but the number to it's left is not sent as far as I can tell, so needs to be calculated to replicate it exactly.

Thank you!

Share this post


Link to post
Share on other sites

Random question for everyone: has anyone seen cases where data from Xbox/PS4 simply does not arrive at the client listening for it? I've seen this happening where even with a simple UDP listener in C# the data is simply not received, no difference between Broadcast Mode/direct IP. I'll put together a sample project for a proper bug report but was curious to see if others have been seeing the same? Seems to be the case in both 2019 and 2020.

Share this post


Link to post
Share on other sites
1 hour ago, cgfdoo said:

Random question for everyone: has anyone seen cases where data from Xbox/PS4 simply does not arrive at the client listening for it? I've seen this happening where even with a simple UDP listener in C# the data is simply not received, no difference between Broadcast Mode/direct IP. I'll put together a sample project for a proper bug report but was curious to see if others have been seeing the same? Seems to be the case in both 2019 and 2020.

I've never seen this personally, at least not on PS4.

Share this post


Link to post
Share on other sites
4 hours ago, cgfdoo said:

Random question for everyone: has anyone seen cases where data from Xbox/PS4 simply does not arrive at the client listening for it? I've seen this happening where even with a simple UDP listener in C# the data is simply not received, no difference between Broadcast Mode/direct IP. I'll put together a sample project for a proper bug report but was curious to see if others have been seeing the same? Seems to be the case in both 2019 and 2020.

Yes, quite a few routers will block ports or Broadcasting by default for security reasons.

Up to the user to manually port forward or enable settings in the router. 

  • Thanks 1

Share this post


Link to post
Share on other sites
12 hours ago, BernoAU said:

Yes, quite a few routers will block ports or Broadcasting by default for security reasons.

Up to the user to manually port forward or enable settings in the router.

Queue Charles Leclerc team radio from Baku....I'm so stupid.... - I had a little look around after you replied, fired up Wireshark, all packets are there. Fired up a nodejs sample of someone else, worked. 

Turned out the Windows Defender Firewall, for whatever reason, decided that my app needs multiple entries with conflicting configurations (?) which most likely caused the issue. After enabling private and public for all the entries for my app it worked ¯\_(ツ)_/¯

Thanks for pushing me into the right direction @BernoAU, even though I checked the firewall as one of the first things it didn't occur to me that the multiple entries would cause any issues.

For anyone else coming across this, here is what I did to make this work:

  1. Go to "Windows Defender Firewall"
  2. Click on "Allow an app or feature through Windows Defender Firewall"
  3. Click on "Change Settings"
  4. Locate all entries for the app you're having problems with
  5. Select Private and Public (only "Private" may work as well, didn't try) for all entries for the app
  6. Profit

Share this post


Link to post
Share on other sites

hi i have done the code to capture the data from udp port, but the result is it, can you help me?

here is my code to capture and the result.

c# language

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;

public class UDPListener
{
    private const int listenPort = 20777;

    private static void StartListener()
    {
        UdpClient listener = new UdpClient(listenPort);
        IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, listenPort);
        float m_brake=0;
        try
        {
            while (true)
            {
                Console.WriteLine("Waiting for broadcast");
                byte[] bytes = listener.Receive(ref groupEP);

                Console.WriteLine($"Received broadcast from {groupEP} :");
                Console.WriteLine($" {Encoding.Unicode.GetString(bytes, 0, bytes.Length)}");
            }
        }
        catch (SocketException e)
        {
            Console.WriteLine(e);
        }
        finally
        {
            listener.Close();
        }
    }

    public static void Main()
    {
        StartListener();
    }
}

 

result 

image.thumb.png.9526a32c2e2a4743a5f5ba3e780da7ba.png

Share this post


Link to post
Share on other sites

DarkSuLL, you have to read the packet byte for byte, here my Java-Code for the first values:

 

public int readOneByteIntoInt(byte[] bytes, int index) {
        if (bytes != null) {
            int value = 0;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }

    public long readTwoBytesIntoLong(byte[] bytes, int index) {
        if (bytes != null) {
            long value = 0;
            value += (bytes[index+1] & 0x000000FF) << 8;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }
        

    // Get UDP-Data for F1 2018
    private void getF1v2018Data() {
        myDatastore.setPacketHeaderMpacketFormat ( readTwoBytesIntoLong(buffer, 0) );
        myDatastore.setPacketHeaderMpacketVersion ( readOneByteIntoInt(buffer, 2) );
        myDatastore.setPacketHeaderMpacketId ( readOneByteIntoInt(buffer, 3) );
....
    } 
 

 

Kind regards,

Mark

Share this post


Link to post
Share on other sites
12 hours ago, markundsteffi said:

DarkSuLL, you have to read the packet byte for byte, here my Java-Code for the first values:

 

public int readOneByteIntoInt(byte[] bytes, int index) {
        if (bytes != null) {
            int value = 0;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }

    public long readTwoBytesIntoLong(byte[] bytes, int index) {
        if (bytes != null) {
            long value = 0;
            value += (bytes[index+1] & 0x000000FF) << 8;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }
        

    // Get UDP-Data for F1 2018
    private void getF1v2018Data() {
        myDatastore.setPacketHeaderMpacketFormat ( readTwoBytesIntoLong(buffer, 0) );
        myDatastore.setPacketHeaderMpacketVersion ( readOneByteIntoInt(buffer, 2) );
        myDatastore.setPacketHeaderMpacketId ( readOneByteIntoInt(buffer, 3) );
....
    } 
 

 

Kind regards,

Mark

thanks i will study your code and try it.

Share this post


Link to post
Share on other sites
23 hours ago, markundsteffi said:

DarkSuLL, you have to read the packet byte for byte, here my Java-Code for the first values:

 

public int readOneByteIntoInt(byte[] bytes, int index) {
        if (bytes != null) {
            int value = 0;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }

    public long readTwoBytesIntoLong(byte[] bytes, int index) {
        if (bytes != null) {
            long value = 0;
            value += (bytes[index+1] & 0x000000FF) << 8;
            value += (bytes[index] & 0x000000FF);
            return value;
        }
        return INVALID_DATA;
    }
        

    // Get UDP-Data for F1 2018
    private void getF1v2018Data() {
        myDatastore.setPacketHeaderMpacketFormat ( readTwoBytesIntoLong(buffer, 0) );
        myDatastore.setPacketHeaderMpacketVersion ( readOneByteIntoInt(buffer, 2) );
        myDatastore.setPacketHeaderMpacketId ( readOneByteIntoInt(buffer, 3) );
....
    } 
 

 

Kind regards,

Mark

I recently finished college. 
I managed to read bytes 1 by 1, but what does each index mean? 

thanks for help.

image.thumb.png.ee320b1222ee7bbea06dffe77dc63f31.png

Edited by DarkSuLL

Share this post


Link to post
Share on other sites
39 minutes ago, DarkSuLL said:

I recently finished college. 
I managed to read bytes 1 by 1, but what does each index mean? 

thanks for help.

image.thumb.png.ee320b1222ee7bbea06dffe77dc63f31.png

That's what the specification is for in the 1st post by Codies.  It's up to you to figure out the size of a data item and read it properly.

Share this post


Link to post
Share on other sites

Hi, DarkSuLL

as bn880 wrote you have to read the first page of this thread to interpret this data.

As example:

On the first page you can read, that each packet has a packet header. In the description for the packet header, you see, that the first value is:

uint16 m_packetFormat;

uint16 are 2 bytes. And the data are in Little Endian.

Your first bytes are:

228 -> E4 hex

07 -> 07 hex

Because of First Endian the value for the Packet-Format is:

07E4 hex -> 2020 dec

Kind regards,

Mark

Edited by markundsteffi

Share this post


Link to post
Share on other sites
21 hours ago, markundsteffi said:

Hi, DarkSuLL

as bn880 wrote you have to read the first page of this thread to interpret this data.

As example:

On the first page you can read, that each packet has a packet header. In the description for the packet header, you see, that the first value is:

uint16 m_packetFormat;

uint16 are 2 bytes. And the data are in Little Endian.

Your first bytes are:

228 -> E4 hex

07 -> 07 hex

Because of First Endian the value for the Packet-Format is:

07E4 hex -> 2020 dec

Kind regards,

Mark

ok thanks a lot, now i am starting understanding and will do tests with this datas.

image.thumb.png.38fc4b29239944969d89e53b28e58bdf.png

Share this post


Link to post
Share on other sites

anybody know a hexadecimal to decimal little endian order converter that i could use UINT64 type?

i have used it one, but no UNIT64 option.

 

 

image.png

Share this post


Link to post
Share on other sites
Posted (edited)

Hi friends

what are the relationships between grip and data ?

i would like to do a anti cheat app.

or have you another idea to do a anti cheat?

 

Edited by DarkSuLL

Share this post


Link to post
Share on other sites
Posted (edited)
22 hours ago, DarkSuLL said:

Hi friends

what are the relationships between grip and data ?

i would like to do a anti cheat app.

or have you another idea to do a anti cheat?

 

I did few years ago a "league admin" version of my tool, where I collected statistics of key parameters of the cars and then displayed them in a way, which let league admins to check, if people were using cheats. This included odd g-forces, odd tire wear values, odd ERS usage etc. But this work got bit of a cold shower, when in F1 2019 and F1 2020 the telemetry data got mostly hidden, unless a person makes it available. You can still do some of that stuff (and my tool is still doing that), but it is bit harder, when you e.g. don't get the fuel usage and tire wear data from the other cars.

Cheers.

Edited by LonelyRacer

Share this post


Link to post
Share on other sites
17 hours ago, LonelyRacer said:

I did few years ago a "league admin" version of my tool, where I collected statistics of key parameters of the cars and then displayed them in a way, which let league admins to check, if people were using cheats. This included odd g-forces, odd tire wear values, odd ERS usage etc. But this work got bit of a cold shower, when in F1 2019 and F1 2020 the telemetry data got mostly hidden, unless a person makes it available. You can still do some of that stuff (and my tool is still doing that), but it is bit harder, when you e.g. don't get the fuel usage and tire wear data from the other cars.

Cheers.

good morning i also have a league www.plf1.com.br is a totally free league,
 it is mandatory to make public the telemetry data to play in our league
 and run applications that are requested by the administrators. 
I know that players use a cheat engine to access the data 
in the memory and inject data to increase the car's grip, 
can you make your code available to me ?,
 so I gain time in creating mine, another doubt will we be able to 
do something to detect this change directly in memory by installing
 some application on the client for detection?

 

 

thanks

 

 

 
 
 
  

image.png

Share this post


Link to post
Share on other sites

Hey guys,

i am writing an application to save race data to display them on a website.

Does anyone receives other m_tractioncontrol values then 0 and 2 in car status packets? Here there is only full and none TC and i think it's a bug.

Thanks in advance.

Share this post


Link to post
Share on other sites
Posted (edited)

Hello,
for the 2021 release would it possible to have m_tyresAgeLaps public?

Since 2020 it's shown in the spectator menu, so it would make sense to have this property public also to telemetry data

thanks!

Edited by emln22

Share this post


Link to post
Share on other sites

Hi all - does anybody know which teams/cars the team IDs 74 and 77 refer to? Sorry if this has been asked before, I couldn't find anything via search. Thanks in advance!

Share this post


Link to post
Share on other sites

Sorry - I probably need to update the original doc.

74

Dams ‘20

75

Uni-Virtuosi ‘20

76

MP Motorsport ‘20

77

Prema ‘20

78

Trident ‘20

79

BWT ‘20

80

Hitech ‘20

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @Hoo, just wondering if there has been any movement on the whole player names GDPR thing?

Thanks

Share this post


Link to post
Share on other sites
33 minutes ago, cjorgens79 said:

Hi @Hoo, just wondering if there has been any movement on the whole player names GDPR thing?

Thanks

It's still disabled in game, but is actively being discussed at the moment. 

  • Thanks 1
  • Agree 1

Share this post


Link to post
Share on other sites
On 3/25/2021 at 8:36 PM, Hoo said:

Sorry - I probably need to update the original doc.

74

Dams ‘20

75

Uni-Virtuosi ‘20

76

MP Motorsport ‘20

77

Prema ‘20

78

Trident ‘20

79

BWT ‘20

80

Hitech ‘20

Thank you so much! It would be super useful if you could either update the original post, or share the full team ID table here. As an example, I'm a bit confused by what the other F2 '20 IDs are. Thank you in advance, I really appreciate the support 🙌 

Share this post


Link to post
Share on other sites
On 3/20/2021 at 1:36 PM, Neospin_ said:

Hey guys,

i am writing an application to save race data to display them on a website.

Does anyone receives other m_tractioncontrol values then 0 and 2 in car status packets? Here there is only full and none TC and i think it's a bug.

Thanks in advance.

Hey there,

does nobody use this field?

Share this post


Link to post
Share on other sites
3 hours ago, Neospin_ said:

Hey there,

does nobody use this field?

I am using it and haven't seen any problems so far. Maybe a bug in your code? It is hard to say without any of your code to look at. Can of course also be a bug in the game on whichever platform you're playing on.

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

×