Jump to content Jump to content

F1 2018 UDP Specification


Hoo

Recommended Posts

  • Codemasters Staff
Lopensky said:

Ok, this was something we have discussed here in the last days. So.. How is it working now?
What IDs i will have to expect to come out from the UDP data?
Human players will continue getting casual IDs exactly as they are doing now (except they do not get "IA-drivers fixed ones")?

Human players will have a driver ID assigned to them when entering the lobby, but with 100 added to the result to avoid clashes with the two-digit AI driver IDs. 
Link to comment
Share on other sites

Hoo said:
We have to tread very carefully where there is a suggestion that user data can be passed to and stored by third parties without explicit consent. For our purposes, anything that can allow someone to correlate data with an individual user falls exactly into this category. There is a difference between passing around player information in a supposedly closed network environment and providing a data structure to facilitate to storing of this information. We are still considering a few of options which might still give you what you're after, so I'll let you know if there are any developments in this area.
Thanks for the info, yeah GDPR is great in principal but hard to deal with for a lot of companies due to some of the broad definitions they use.
Just a thought but why not just ask for explicit consent, if you want to play online you have to consent to your gamer tag being shared? Thanks for keeping us informed :)
@Hoo just thought I would mention that I was asked to look at building an interface to Forza Motorsport 7 and while looking into it and testing with the game I noticed that they require the user to explicitly consent to their TOS/Privacy Policy in game before they can access any online functionality, presumably to cover themselves for GDPR. 
Link to comment
Share on other sites

Hoo said:
Lopensky said:

Ok, this was something we have discussed here in the last days. So.. How is it working now?
What IDs i will have to expect to come out from the UDP data?
Human players will continue getting casual IDs exactly as they are doing now (except they do not get "IA-drivers fixed ones")?

Human players will have a driver ID assigned to them when entering the lobby, but with 100 added to the result to avoid clashes with the two-digit AI driver IDs. 
@Hoo
Ok, i can see your point.. but my problem remains... :/
There is no way to map easily the udp drivers data to some other driver related data coming out from my own database. Only solution is to map them manually everytime a session starts... right?

In case, can you please tell me for sure if at least the team_id is valued correctly for online races data with only human players? :/
Link to comment
Share on other sites

@Hoo et al ....

Trying to understand the new event packet ;-)
I'd have expected to get a SSTA ..... loads of data  ... SEND.....   ALL with the same for the session UUID.
On windows (Steam) patch 1.08  the SSTA has a different UUID than everything else ... surely this defeats the object of the Event packet book ending the data for a session.
Bug ? Or am i missing how this works ?

Edit: So just had a play and the SSTA either has a seeminly random value or has the value from the last session ... That is the SSTA has the same UUID as the last SEND .... has to be a bug....
Link to comment
Share on other sites

Hi all, I'm new to receiving UDP data packets and I wandered if anyone could link me any good tutorials or help to do with working with UDP.

So far I have managed to receive them but when I try to output them I just have this returned 
this is my c# code when I'm trying to cast and output it 

Byte[] receiveBytes = c.EndReceive(ar, ref receivedIpEndPoint); //c is udp client, ar is async operation

string receivedText = Encoding.UTF8.GetString(receiveBytes);

Console.Write("\n"+receivedText);

Link to comment
Share on other sites

Hi all, I'm new to receiving UDP data packets and I wandered if anyone could link me any good tutorials or help to do with working with UDP.

So far I have managed to receive them but when I try to output them I just have this returned 
this is my c# code when I'm trying to cast and output it 

Byte[] receiveBytes = c.EndReceive(ar, ref receivedIpEndPoint); //c is udp client, ar is async operation

string receivedText = Encoding.UTF8.GetString(receiveBytes);

Console.Write("\n"+receivedText);

The data is not a string, its a stream of binary data representing the c structs (defined in the first post of this thread). You need to use a BinaryReader then you can either create identical matching structs in c# and use Marshal.PtrToStructure to convert the data, or alternative you can the binary readers .ReadXX functions to read out each data type sequentially into properties of a class.

Google and Stack Overflow are filled with UDP code examples, however you have already read the data so its more the conversion from c struct to c# class/struct that you need to look at.
Link to comment
Share on other sites

mrdezibel said:

can someone please test if this still works, in legacy mode?

https://play.google.com/store/apps/details?id=b4a.f1display

i have users telling me its Buggy and "shifting" the data…

but i am not sure if they using it with the right gamesettings…

any idea how to avoid the app showing data from the "wrong" mode ?

is the first value of f1 2018 always the beginning of the header with m_packetFormat saying 2018?

could be a way to differentiate the modes..

no one ? :-(

Link to comment
Share on other sites

@Hoo Is it possible to know what tyre will be put on the players car for their next pitstop please?
I'd love that
Basically I'm on "page 1" of that ingame MFD most of the times, but when I'm about to enter the pits I'm always getting nervous if I've selected the right tyre. Sometimes Jeff disturbs me about a new strategy in the inlap and I may have selected differently. Would be very cool if I could see the next tyre type via UDP

Link to comment
Share on other sites

mrdezibel said:
mrdezibel said:

can someone please test if this still works, in legacy mode?

https://play.google.com/store/apps/details?id=b4a.f1display

i have users telling me its Buggy and "shifting" the data…

but i am not sure if they using it with the right gamesettings…

any idea how to avoid the app showing data from the "wrong" mode ?

is the first value of f1 2018 always the beginning of the header with m_packetFormat saying 2018?

could be a way to differentiate the modes..

no one ? :-(

Looking at data from the PC platform I've not seen anything "wrong" with the legacy mode data... Could it be platform related ?
Link to comment
Share on other sites

Lopensky said:
Hoo said:
Lopensky said:

Ok, this was something we have discussed here in the last days. So.. How is it working now?
What IDs i will have to expect to come out from the UDP data?
Human players will continue getting casual IDs exactly as they are doing now (except they do not get "IA-drivers fixed ones")?

Human players will have a driver ID assigned to them when entering the lobby, but with 100 added to the result to avoid clashes with the two-digit AI driver IDs. 
@Hoo
Ok, i can see your point.. but my problem remains... :/
There is no way to map easily the udp drivers data to some other driver related data coming out from my own database. Only solution is to map them manually everytime a session starts... right?

In case, can you please tell me for sure if at least the team_id is valued correctly for online races data with only human players? :/
After some tests it seems that team_id is assigned unpredictably too. Expecially if drivers join the lobby during the Q session.
@Hoo please explain me this, it's something i tested for hours with no good results. :/
Seems i won't have any data to recognize a driver except for its position (mapping it manually one by one at each sessione start). this is crazy man. :s

Something theoretically so easy and simple, came out so terribly wrong and unusable. :(

Link to comment
Share on other sites

AndyHamp said:
@Hoo et al ....

Trying to understand the new event packet ;-)
I'd have expected to get a SSTA ..... loads of data  ... SEND.....   ALL with the same for the session UUID.
On windows (Steam) patch 1.08  the SSTA has a different UUID than everything else ... surely this defeats the object of the Event packet book ending the data for a session.
Bug ? Or am i missing how this works ?

Edit: So just had a play and the SSTA either has a seeminly random value or has the value from the last session ... That is the SSTA has the same UUID as the last SEND .... has to be a bug....
@Hoo any comment on this one ?
Link to comment
Share on other sites

Anyone seeing issues with data frequency ?
The type 0,2 and 6 data is written as per the menu settings but i'm also seeing the Type 7 (Status) record written at the same frequency. They all have the same header UUID and timestamp is this correct ? Can I assume that this will continue or should i expect Type 7's to change to 2x per second as documented ?
Link to comment
Share on other sites

AndyHamp said:
Anyone seeing issues with data frequency ?
The type 0,2 and 6 data is written as per the menu settings but i'm also seeing the Type 7 (Status) record written at the same frequency. They all have the same header UUID and timestamp is this correct ? Can I assume that this will continue or should i expect Type 7's to change to 2x per second as documented ?
What you experience now is accurate. The packet USED to be sent two times a second but has since been spead up due to the drs indicator. 
Link to comment
Share on other sites

AndyHamp said:
Anyone seeing issues with data frequency ?
The type 0,2 and 6 data is written as per the menu settings but i'm also seeing the Type 7 (Status) record written at the same frequency. They all have the same header UUID and timestamp is this correct ? Can I assume that this will continue or should i expect Type 7's to change to 2x per second as documented ?
What you experience now is accurate. The packet USED to be sent two times a second but has since been spead up due to the drs indicator. 
Great ... no problem if they've changed it :-)  Would be good if @Hoo can update the top posts to reflect this....
Link to comment
Share on other sites

Hi, I read through all the pages. Regarding the delta to leader and or other cars, just to recap:
In order to get the (correct - not approx) deltatime to the leading car (or intervall times to other cars), we acctually need to keep track of all laptimes / sector times and compare them to each other? This is the way I done it and was already suggested here, but I just wonder if this information is not worth putting into the packets directly. In spectator mode the game itself shows these times with several updates between each sectors, so they are at hand...

btw: I built a windows app to show the most important session data on a second monitor.


Link to comment
Share on other sites

Lopensky said:
Can someone confirm this pls?

PARTICIPANTS PACKET ... on PS4 the name will be the LAN name if playing a LAN game, otherwise it will be the driver name.



I dont have a PS4 myself, but I was looking at some data from a PS4 user of my app the other day and it appears that in online MP sessions the names are always "Player". 
Link to comment
Share on other sites

  • Codemasters Staff
Hi All,

We've fixed the issue where the SessionUID was being reported incorrectly for the first frame should be fixed now. 
We also investigated the issue reported by @SimShaker where the longitudinal forces were dropping out in the 2018 format, but were unable to repeat the issue here. Please let us know if you encounter either of these issues again.

Thanks.
Link to comment
Share on other sites

  • Codemasters Staff
The team ID should always be correct (if not, then let us know and we'll take a look). The driver ID should be unique to each player within the session.
Link to comment
Share on other sites

Ok then.. i have maybe found a bug when drivers join an online session during the Q or directly for the race when the lobby has already started. Not sure of what happened but it was like the game shuffled the rows and assigned wrong ids.. (maybe the new driver caused a "slide" through the list of the participants changing the rows order. I wll check this out and let you know.

Thank you for the quick answer. :)
Link to comment
Share on other sites

Lopensky said:
Ok then.. i have maybe found a bug when drivers join an online session during the Q or directly for the race when the lobby has already started. Not sure of what happened but it was like the game shuffled the rows and assigned wrong ids.. (maybe the new driver caused a "slide" through the list of the participants changing the rows order. I wll check this out and let you know.

Thank you for the quick answer. :)
I have been having reports of weird behaviour with the timing data as well.  I think I can now shed some light on this, the player car index is getting changed to an incorrect value when spectating (ie when the game automatically spectates other players after you finish the race while there are still others racing). I have a telemetry recording demonstrating this, the behaviour is as follows

During the entire race I (cjorgens79) am index 3. As you can see I am about to cross the finish line.

Once i actually cross the line, the game takes over control for approx 8 seconds (ignore times on the left as i was pausing the telemetry playback) before it auto switches to spectating the first car behind me that hasn't yet finished. In this case that is JacWichura (Neddis who finished ahead of me loses final result positions due to penalties so drops from 5th to 7th). The moment it switches to spectate JacWichura you can see the PlayerIndex changes from 3 to 4, and the spectating index changes from 255 to 3. 

Here is the participants list, you can see I am still id 3 (cjorgens79), but the playerindex is pointing to id 4 jacwichura while it claims it is spectating index 3 (me), but its not. 


I actually have a full video recording of the session along with a full telemetry stream recording so i have been able to analyse it to see exactly what was going on in the game vs the telemetry. It just looks like during spectator mode the players id gets copied into the spectator id and the actual spectator id is copied into the player id field. The player id field should never change, only the spectator id field should change to reflect which player id it is spectating. 
Link to comment
Share on other sites

@Hoo - in addition to the above bug, there is a related behavioural issue which occurs when you join a session but aren't allowed to participate in it. In the recording above, when i first joined they were part way through one-shot qualifying so i was forced into being a spectator. As I am not an actual participant i dont have a valid participant record. This is the state of the participants structure while im watching the session

however the telemetry tells me ..
PlayerID: 6, isSpectating: true, specCarIdx: 5
.. that i am playerIndex 6 (who is CrazyCrazy99) and says it is spectating player index 5 (meteora), however at the time the game is actually showing player 6 CrazyCrazy99. 

So the spectator index is wrong (due to the same bug as the previous post), but my concern for this post relates to the playerIndex. Since we dont have an actual participant slot yet by the looks of it, the value still needs to be something that doesn't reference an existing participant, so its no good telling our apps that we are someone else. So ideally it would just point to one of the empty slots, OR if that is too difficult to work out then to an invalid value like 255 (however developers would need to be aware of this so they dont try and use 255 as an invalid index into the array).


Link to comment
Share on other sites

Has anyone been able to get the button mappings (ie m_buttonStatus) working with the console versions of the game? Does it output values for buttons on wheels, or only gamepads? On the PC it works fine with the wheel, but I seem to be having problems with users who have consoles (not sure if its my issue or a game issue).
Link to comment
Share on other sites

Hoo said:
Hi All,

We've fixed the issue where the SessionUID was being reported incorrectly for the first frame should be fixed now. 
We also investigated the issue reported by @SimShaker where the longitudinal forces were dropping out in the 2018 format, but were unable to repeat the issue here. Please let us know if you encounter either of these issues again.

Thanks.

@Hoo
Looks like the problem has gone. Thank you!
Link to comment
Share on other sites

Has anyone been able to get the button mappings (ie m_buttonStatus) working with the console versions of the game? Does it output values for buttons on wheels, or only gamepads? On the PC it works fine with the wheel, but I seem to be having problems with users who have consoles (not sure if its my issue or a game issue).
@Hoo I've just had confirmation from one my my testers using PS4 that the m_buttonStatus is not outputting anything for his wheel at all, the value is always 0. I have asked him to try with the gamepad and let me know if that works, so i will post an update on that later. When playing on the PC version of the game, m_buttonStatus works fine with my wheel so the issue seems to be console specific from what I can tell at this point.

Is there a reason why the buttons for wheel users on consoles aren't being included in m_buttonStatus? Could we please get this fixed, most of my users are wheel users and a lot of them have been complaining about not being able to get it to work as they want to map buttons on their controllers to functions in the app, eg so they can change information pages more easily while driving. Thanks
Link to comment
Share on other sites

Hoo said:
@cjorgens79 - is the issue present when using a pad? Do you know what wheel the tester is using?
@Hoo - im getting him to find out re gamepad, it may be specific to his wheel after all. I just got another person to test it separately who is also on PS4 and they said it worked for them so i am getting mixed reports. I'll find out more and get back to you. Cheers
Link to comment
Share on other sites

@Hoo - ok so I think the button status is actually fine on all platforms in most circumstances. I have managed to clarify all the feedback from a number of users as I had originally got myself mixed up slightly with which platforms different users were on. The only outstanding problem that I can see that exists is this one from a PC user.
He said "I connected an XBox One controller to my PC this morning and immediately it would let me map buttons to RSDash! I then tested mapping buttons on my wheel (Still with the Xbox one controller connected), and yes it let me map buttons to my wheel! Having the Xbox controller connected messed with my button mappings for my wheel though, so I disconnected that and restarted the game and it no longer lets me map buttons to my wheel in RSDash.
There seems to be something weird in the way Controller profiles are setup that causes the button mappings not to go through. In F1 2018, I normally just have one custom profile created and enabled. Everything else is disabled. I created my controller profile starting from the default "Keyboard" profile as suggested by Codemasters and other users on their forums and added my wheel mappings to that then saved to create a custom profile." 

So it seems there is a way that the button status wont output on PC, but it only happens if the controller profile is setup in a certain way. I'm not sure why he needed to set it up that way, I will discuss with him and see if he can set it up differently so that it works fine with the telemetry. On my PC I used the wheel profile as the base for my custom profile and that works fine with the telemetry, he obviously used the keyboard profile as his base and this doesn't work, which I can understand why that might be the case.
Link to comment
Share on other sites

Lopensky said:
Can someone confirm this pls?

PARTICIPANTS PACKET ... on PS4 the name will be the LAN name if playing a LAN game, otherwise it will be the driver name.



I have a PS4 and the names in online games all come through as ‘Player’ which is frankly useless. @Hoo is there any chance we can just get the original driver name sent through for online, ie Hamilton, Vettel etc in the same way as offline mode? 20 drivers called Player looks a bit daft... thanks!
Link to comment
Share on other sites

Bexas said:
 and why i don t see time gap in race to driver ahead and behind me? is it possible to count?
There has already been a post in this thread, that tells you, how you can calculate the gap to the other drivers. you can do it by saving the time remaining of your driver every 100 meters or so and then compare it with the values of the other cars at that point. I'll add the exact post to this comment when i find it
Edit: found it


Lopensky said:
You can calculate it storing the sessionTime of all cars at fixed "checkpoints" (like each sector, or micro-sector if you want more updates, and then compute the delta between the two timestamps. ;)

Link to comment
Share on other sites

not sure what fuel load is, probably the starting fuel in L. If you want to know how many laps are left then you will need to calculate it by keeping track of the fuel use per lap and then using your calculated consumption figures to extrapolate the remaining laps, however dont forget that fuel mix plays an impact on that too.
Link to comment
Share on other sites

@Hoo - has there been any progress on the driver names and GDPR issues? I was just thinking, then the game is first installed the player is told to type in a first name, last name and a short 3 letter version of it for their in game driver/avatar. Could this name (first name + surname) be used instead of the PSN id, xbox live id or steam id? This is a user configurable value, so really it would be up to them what they want to call themselves.

If real or avatar names are still not an option, will the driver id ever be mapped back to a driver name in game? At the moment as you know the driver ids are unique per session, in the 100+ range, however that doesn't really help when working out what to display. A leaderboard where everyone is just called "Player" is not very useful. It would be preferable to at least use an actual valid driver id based on the team car they are in, I assume under the hood the player is actually allocated to a specific drivers car, as you can only have 2 cars from each team in the race right?
Link to comment
Share on other sites

  • Codemasters Staff
Hi @cjorgens79, unfortunately our attempts to work around the legal constraints are not going well. We have another last avenue to try before we call time on it. Using the players' name runs into the same issues unfortunately.

We don't plan on mapping human drivers to the AI driver who was previously in that vehicle. All drivers should have unique driver IDs. You should be able to work out the team someone races for using the teamID value. There was a suggestion that this might not always work in online games, so please let us know if you find that to be the case. and we'll investigate further. 
Link to comment
Share on other sites

@Hoo


Hoo said:

LAP DATA 
PACKET...

Hi,

When doing some testing, I found following issues with LapData on Career Practice doing the Practice programs.

When going  on "out lap", on first time the sector stays 0 during the whole lap, but then the m_driverStatus changes suddenly during the lap from 3 - 'out lap' to 1 - 'flying lap'. To me it should change when you pass the start/finish line. The point of change is the same, where in the 'flying lap' you start your lap. Also on 'flying lap' from 'out lap' the lap number doesn't change, when you pass the start/finish line.

Then on doing more Practice programs, in the subsequent 'out laps', the sector is always 2 (from when you leave garage) all the way, until the new lap starts. And on these runs too, the lap number doesn't change, when you pass the start/finish line first time. And the 'out lap' to 'flying lap' switch happens mid lap in sector 3 also on these subsequent runs.

Cheers.
Link to comment
Share on other sites

Hoo said:
We don't plan on mapping human drivers to the AI driver who was previously in that vehicle. 

(also, previously, you said)
 If there is a requirement to know which of the two team slots they occupy in modern era races then that is a different piece of information that we don't currently send via the UDP packet.

Is possible to reconsider that idea and send team slots?  For championships, players use to repeat the same car, the same slot and developers could find an easier way to link with a participant list.

No room for that data? I'm pretty sure that it will have more appreciation for all of us than other information (2 tires damage data, for instance, is a great information, but less useful)  

Cheers




Link to comment
Share on other sites

Please Codemaster make it possible again for 2019 to have more than one UDP output stream ingame. It‘s horrible to get more than one device to work with F1 2018. 
The cmps doesn‘t solve it for me and create huge lags for my SLI Pro as well as for my Accuforce wheel. 
Link to comment
Share on other sites

  • The topic was pinned
  • The topic was unpinned

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...