Forum Discussion

Re: F1 23 UDP Specification


@RxThorn wrote:

I am developing a real-time map but I am having difficulty finding map images or figuring out what the center is. Is there any way to download all the maps of the tracks or to have the references for the coordinates?


I personally belief the in game track map is the coordinate map Codies and EA use. @Hoobiechoobie you might be able to verify. However, the problem I now see is you cannot know the bottom right coordinate, or whichever one is the far corner opposite 0,0.

This is just a theory, I cannot test so if someone can check or confirm it that would be nice, and easy too.

25 Replies

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    Here is sample Silverstone map from the UDP specification and a screenshot from me on F1 2020, I know they might be different now. However, if you take both boxes and line them up, the tracks are pretty much on top of each other.

  • P4st3l1ak's avatar
    P4st3l1ak
    Seasoned Ace
    2 years ago

    @TeamRacingTiger
    At first, I thought they use GPS map for tracks but some of them are not oriented as on real maps.
    (e.g. Becketts and Maggotts are on south in game map while Google Maps shows them on east side of circuit)

    I found ERP files with map pictures but I couldn't extract coordinates from them. They seem to be TGA format but I haven't been able to process them yet.

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago
    @P4st3l1ak I would like to think that the coordinates grid is the same for all circuits, like 0,0 in the same spot and the farthest point is the same point. So if Codies or EA confirm this then all you need is the maps, for me on Xbox I would just be taking the tracks maps (change the OSD at every circuit and the track map will have a box) and removing the background. I hope that would work because I don't have any other ideas.

    The coordinates could also be stretched/squished so that the farthest point is just the largest value the data can take or something easy, hopefully.
  • RxThorn's avatar
    RxThorn
    2 years ago

    The problem is also with the scale because the UDP coordinates are in meters

  • navarreitor's avatar
    navarreitor
    Rising Traveler
    2 years ago
    About new tire information.
     
    Have I understood correctly and is this information provided?
     
    1. Type of tire of each set
    2. Visual of each set
    3. wear each set
    4. availability of each set
    5. recommended tires in each session
    6. remaining laps of each set
    7. maximum number of laps in each set
    8. whether or not the set is installed

    I am right?
  • IkoRein's avatar
    IkoRein
    New Vanguard
    2 years ago

    You are correct.

    Though the tire wear is just integer, so not much granularity there, i.e. 0 - 100%.

    Also there is field, which is supposed to show time loss/gain against current tire. That worked on beta, but was broken on the earlier releases, but  I haven't checked, if the latest patch has fixed it

    The tires are sorted in the same order, as they appear on the game. So P1 tires first, then P2 tires ... and wet tires are the end.

    Cheers.

  • navarreitor's avatar
    navarreitor
    Rising Traveler
    2 years ago

    Thank you, Iko

    I wish you could have answered earlier, it would have saved me a good while to figure out the correct answer with the order of the tires, 😃
     
    It's entirely my fault, I'm too impatient.
     
    BTW I love your Telemetry app

    Cheers
  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    @RxThorn wrote:

    The problem is also with the scale because the UDP coordinates are in meters


    Wait, as the coordinates are metres, can you not just go to each straight and move in a straight line, use the lap distance from lap data packet and use the in game track map to compare original and final position. Example: you move in a straight line, take a screenshot of the track maps, before and after, then find the amount of pixels between the before and after image of your location, then use that to work out the scaling.

    Let's say you move 200 metres, the difference between your dot in the 2 images are 200 pixels, and the box from the OSD is 1000 pixels then you know 1 metre is 1 pixel and the entire box is 1000 metres x 1000 metres. This is a simple example but the process should work the same.

  • IkoRein's avatar
    IkoRein
    New Vanguard
    2 years ago

    I have been watching this thread with interest.

    This is exactly, what I was partly doing on the early releases of my Tool. I was scouring the game's datafiles for the different data, like sector lengths, pit entry points etc and the image files for trackmaps. I never found out or managed to crack the resources, where the trackmap lines come. I.e. this is the map which isshown on the screen, if you enable the live trackmap. If you manage to find out that data, then doing the trackmaps from the game real data would be doable quite easily. I haven't really looked at the game's resource files to find out the traces lately and most likely this data is in the game.dat file, so out of reach.

    Due to the these challenges, I decided to do the trackmaps for each track by driving along the track borders. The good thing is that with these files, I can also know accurately sector borders, exact track lengths, show e.g. different flags for the minisectors, if needed, show DRS regions and I can "easily" do these for all games I support (AC, ACC, AMS2, PC2, KartKraft, rF2, R3E, DiRT Rally 2, Grid 2, F1 2012 - F1 23) and then the data is uniform for my uses. The data for my trackmaps used to be open, but I moved to a locked format when people were using my trackmaps without attributing them to me. As it takes some 30 minutes per track to do proper trackmap (outside/inside, racingline, centerline, pitlane and track area boundaries), I was not very happy on this "effort stealing".

    So if you have 4 guys, you could easily create the trackmaps for the tracks and for your own tools use. Doing simple track borders would take 10 minutes per track (outlap, one lap on the outside border, one extra lap, one lap on the inside border), so with all work, maybe about 4 hours total. Might be much easier than try to map each track's distance with pixels and stuff̣. And most likely the trackmap images in the files are not exactly accurate. And the tracks are not "aligned". for none of the tracks the centerpoint of the map is not origo (0,0), but it always somewhere else, which adds extra challenge.

    Cheers.

  • mantazzoLTU's avatar
    mantazzoLTU
    Rising Scout
    2 years ago

    Regarding track layout stuff.

    Minimap images are always accessible through game files, if necessary.

    As for coordinates for layouts, you can do that - every *track*_common file has text data for track points - a.k.a. the ideal line plus pit line (plus description(s) separately for limits). I have tried to generate a track layout using coordinate data for both ideal line and pit line, and it seemed to look okay, but of course, it's not perfectly accurate.

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago
    @IkoRein The problem with this for me is I am on xbox, so I could not use game files. I would use the edge of the circuit but I don't have that much time, I am making my app for fun, and I personally think my method is quicker for me.

    Also thank you for reminding me of the minisectors, I forgot about the extra detail that comes with that, but I could probably just create yellow flags and see if they line up. 0,0 not centre could be to do with the library. like pygames 0,0 is top left corner, so that was not a problem for me.
  • Raymond-Smits's avatar
    Raymond-Smits
    Rising Vanguard
    2 years ago

    @Hoobiechoobie 

    Question. I noticed something strange. When I start a Custom Multiplayer game with friends, without AI, and we start with practice session, I get a OPPONENTCOUNT of 20 players in session, None of them drive a lap, none of them are visable, but I do get tyre information and all sort of data from AI players that aren't there? 

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    It probably creates data, so that there is some to send and it doesn't crash.

  • mantazzoLTU's avatar
    mantazzoLTU
    Rising Scout
    2 years ago

    Since in Multiplayer, in Practice or Qualifying, you can take over a car (while joining a session midway for example), the game always prepares data for 20 drivers in those sessions. Only in race conditions it reports the correct number. I think that's the explanation.

  • z0mt3c's avatar
    z0mt3c
    Seasoned Rookie
    2 years ago

    @mantazzoLTU didn't know about the file... i just used the data from racenet - but contentwise sounds pretty similar... idealline with distances for white lines, tracklines, run-offs. it is actually pretty accurate ;-)

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    Can anyone help me clear up my knowledge.

    My code to decode the packet header (2022) is as follows

    data = sock.recv(1464)
    Packet = binascii.hexlify(data).decode()
    for x in range(0,len(Packet)//2):
      array.append(Packet[x*2:x*2+2])
    packetFormat = TC.uint16(array[1]+array[0])
    gameMajorVersion = TC.uint8(array[2])
    gameMinorVersion = TC.uint8(array[3])
    packetVersion = TC.uint8(array[4])
    packetId = TC.uint8(array[5])
    sessionUID = TC.uint64(array[13]+array[12]+array[11]+array[10]+array[9]+array[8]+array[7]+array[6])
    sessionTime = TC.float32(array[17]+array[16]+array[15]+array[14])
    frameIdentifier = TC.uint32(array[21]+array[20]+array[19]+array[18])
    playerCarIndex = TC.uint8(array[22])
    secondaryPlayerCarIndex = TC.uint8(array[23])
    print(packetFormat)
    print(gameMajorVersion)
    print(gameMinorVersion)
    print(packetVersion)
    print(packetId)
    print(sessionUID)
    print(sessionTime)
    print(frameIdentifier)
    print(playerCarIndex)
    print(secondaryPlayerCarIndex)

    However the way the UDP specification is laid out makes me think that there is a better, more compact and easier way to lay it out.

    If no one minds can you show me how I could be doing the packet header, using the lay out straight from the specification. I wont be changing my 2022 version as it works fine, but it will help me make my 2023 version be cleaner.

    Edit:

    I have looked myself but I cannot seem to find anything that works.

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    Sorry for that last reply.

    I had already found something, but it was not exactly what I wanted, very entitled of me.

    (Analogy coming up) Essentially what I wanted was to plug a USB (The specification) into the computer (my coding programme), I could do it but it would not work. Instead I had to get an adapter (A different method using excel first) then plug my USB into that and then the computer would be able to read it correctly and it would work.

  • For everyone wondering where track limits are, does EA Racenet give you the answers you are looking for? Go through each track with developer mode open in the browser and look at the data downloaded.

    Looks like the track data is in the the 'spline' endpoint, eg Spain track data (file attached) is at https://web-api.racenet.com/api/F123Stats/performanceAnalysis/spline?trackId=04 (I don't seem to be able to use that as a direct link, but probably because I need to set bearer tokens etc in the request header).

    It has a list of 'gates' which are connected via 'links'. Each gate is defined as a 'position' and 'normal' which looks like it is actually the racing line. They also have items such as 'left_track_limit', 'right_track_limit', 'left_white_line', 'right_white_line' etc, which I'm guessing would need to be calculated relative to the gate position using the normal.

    This may not be a perfect representation of the map if it means left, right and racing line are all in a line (defined by a single 'gate') but it looks pretty close

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    Developer mode? You mean press F12 and inspect the web page then find the file? I cannot see developer mode anywhere for me.

  • TeamRacingTiger's avatar
    TeamRacingTiger
    New Rookie
    2 years ago

    @Siderberry wrote:

    For everyone wondering where track limits are, does EA Racenet give you the answers you are looking for? Go through each track with developer mode open in the browser and look at the data downloaded.

    Looks like the track data is in the the 'spline' endpoint, eg Spain track data (file attached) is at https://web-api.racenet.com/api/F123Stats/performanceAnalysis/spline?trackId=04 (I don't seem to be able to use that as a direct link, but probably because I need to set bearer tokens etc in the request header).

    It has a list of 'gates' which are connected via 'links'. Each gate is defined as a 'position' and 'normal' which looks like it is actually the racing line. They also have items such as 'left_track_limit', 'right_track_limit', 'left_white_line', 'right_white_line' etc, which I'm guessing would need to be calculated relative to the gate position using the normal.

    This may not be a perfect representation of the map if it means left, right and racing line are all in a line (defined by a single 'gate') but it looks pretty close


    Do you mind showing a screenshot of where you found the file. I just want to have a look. (I haven't been able to find out what/where data download is).

  • Raymond-Smits's avatar
    Raymond-Smits
    Rising Vanguard
    2 years ago

    @Hoobiechoobie Do you have a update about the bug in Multiplayer, where we get all the AI in the data, even without AI enabled? 

    Another question. Is it possible to get a m_vehicleFiaFlagsYellowSector or something? That just gives a value in what sector (or sectors) there is a yellow flag? Now we only see it in the ZONEFLAG, but you don;t get out of the data what zones belong to sector 1, sector 2 or sector 3

About F1® 23

Join the community forums and talk with us about your experiences in F1® 23.4,609 PostsLatest Activity: 2 days ago