UDP Telemetry - CurrentLap channel broken when doing distance-scored races

Bug Info:

  • When playing in a Time-Based race, with scoring system of “Distance Traveled”, the CurrentLap; channel does not accurately show a laptime, instead presenting an unusually large number. (see text below this quote box)

Platform:

  • Xbox Series X, with Data Out being transmitted though SimHub app on Windows 10 PC to an additional screen.

Edition:

  • Irrelevant

Account:

  • Irrelevant

PC GPU:

  • Irrelevant

Peripheral:

  • Irrelevant

Settings:

  • Data Out: Enabled
  • Data Structure: Dash

Xbox Settings:

  • Irrelevant

Attempted fixes:

  • None, as this telemetry channel functions perfectly in normal “lap scored” races and is configured correctly.

Content Update:

  • Unknown, I never drove in “distance scored” races before Update 11

I took part in an A/B/C/S Multi-Class race today, at Le Mans Circuit de la Sarthe.

This event is scored based on “Distance Travelled”, measured in KM as I use Metric units.

As the event is distance
-scored (instead of being time-scored like a regular lap-based race) the CurrentLap; value is presenting highly unusual data.

In a normal, lap-based race, CurrentLap; shows the amount of time that has elapsed on your current lap, in the format of 00:00:00.0000000 ie: hh:mm:ss.0000000.

At the end of a lap of Le Mans Circuit de la Sarthe, CurrentLap; is presenting a value of 03:46:55.8040000.

This is highly unusual as a lap of that track in the car I was driving should give a readout of approximately 00:04:05.0000000 as I approach the finish line, ie: 4 minutes and 5 seconds (or thereabouts).

Based on the value of 03:46:55.8040000, CurrentLap; is saying that my current laptime is 3 hours, 46 minutes, 55.804 seconds.

This is clearly impossible in a race with an 18 minute time limit, so something is not right.

What I reckon is happening here is that the game is using CurrentLap; to display the distance travelled throughout the lap, and in an attempt to convert it to time is giving this highly unusual readout.

To reiterate, in “normal” lap-based, time-scored races the CurrentLap; is working perfectly. This is only an issue in distance-scored races.

For reference incase there is a suitable conversion formula that can be configured in SimHub, a lap of Le Mans Circuit de la Sarthe is approximately 13629 m or 44714 ft.

If this anomaly cannot be understood or fixed, I would recommend the following as a resolution:

  • Add a new Data Out channel: CurrentLapDistance, tracking the amount of distance travelled across a current lap. This can be in either ft or m.

  • Add a new Data Out channel: CurrentRaceDistance, tracking the amount of distance travelled across the entire race so far. This can be in either ft or m.

  • Update CurrentLap; to show the current time-based laptime (in hh:mm:ss.0000000) in distance-scored races.

Thank you for taking the time to read this, it’s rather technical but hopefully I made it understandable for whoever on the team is tasked to work on this.

In addition, I have a separate topic with suggested additional telemetry channels that would be incredibly useful to have added to a future update, you can find that here: Data Out - Additional UDP Channels

I can confirm that this issue also happens with the MS Store edition on PC, on a Windows 11 machine.
The set-up is Similar to PJTierney’s, however the DataOut is set in Forza Motorsport as Local loop(127.0.0.1) to SimHub and then out to a second screen.

-edit I also fired up SimDashboard and tested it with that. Same output string that SimHub did, so it looks like it’s taking a number from distance, and applying it to CurrentLapTime.

Any idea on if there’s some sort of formula that can be used to translate that large “time” value into metres?

I did notice that when I stopped the car on-track the counter stopped increasing, do it was definitely distance travelled, I just don’t know how a lap distance of Le Mans translated into 3+ hours on the dashboard.

every second is a metre (current lap)… 1h = 60*60 sec = 3600m

1 Like

That looks like the right conversion.

CurrentLap is in milliseconds in lapped races, but represents lap distance in timed races.

To get proper data, you need to do some calculations.

I use this and it works for both lap and timed races (psuedo SQL/DAX).

Track.Length = -MIN(Packet.Distance) // per track
IsValid = Track.Length <> - Packet.Distance // filter these out
LapInferred = FLOOR(Packet.Distance / Track.Length) // actual lap starting at 0
DistanceLap = Packet.Distance - (Track.Length * LapInferred) // distance travelled on lap

when DistanceLap < 0 it is pre-race

When mapping CurrentLap and DistanceLap for a timed race, I get exactly (well amost) the same graph.

So that can tell us how to differentiate between the 2 race modes with some tolerance for rounding errors.

The question still is how to get the actual current lap time in a timed race. I am going to play with some data and see what I can figure out.

1 Like

Interesting stuff, thanks for that.

On a separate topic, have you don’t any experimentation regarding sector times?

The game (according to UDP) doesn’t split a track up into 3 sectors like most other titles do, instead treating the entire circuit as one big sector.

I’m wondering if there’s a way to hack together a solution to that.

Not yet, the problem is you just cant split the distance into 3/4 sections (well you can, but it is silly).

So you need to track corners (kinda have a way for that, but only slow corners) and then decide where the corner splits are entry and exit. Then flatout parts in between make good candidates for sector times, so you will have to find the nearest ones based on the 3/4 naive sections.

You could also arbitrarily, go pick your own splits per track, but that sounds tedious given we have 64 layouts currently :smiley:

My hack for FM7 was to:
Record a single lap of a track with my capture card and also save the telemetry output.
Watch that recording and note the race time of the first frame whenever a new in-game split time was displayed.
Search the telemetry data for packets with these exact race times and save the distance travelled into a database.
I used this data to split the track into sectors and show sector and split times for each one.

But as @leppie2013 has said, it is a tedious process and I only did that for my favourite layouts in FM7.

This is proving to be quite hard if you dont have some concept of ‘sessions’ in your data (I dont have that yet…). Also LastLap is always 0 in a timed race…

Once you group it by sessions you should be able to use CurrentRateTime to get lap times and then work back from there. But not really friendly for realtime info.

Finally made some ‘session’ logic and have timed race detection working, but for the life of me I cant figure where the game gets its lap times from (I can only use BestLap time as a reliable source).

I have tried about 7 or more different ways to try get the same numbers as the game and I still have over 1.5% RMS error. This results in calculated lap times being off by as much as 15ms.

All my variations are pretty close and I have triple checked the data I used.

Also using BestLap times in a cumulative way, results in data not matching the telemetry.

Anyways, I will figure out a reliable way.

1 Like

I haven’t done any timed races yet, so I don’t know how Data-Out works there. But could it be that Data-Out doesn’t provide any higher precision than 15ms (1/60 of a second to be exact), because you are playing the game with a refresh rate of 60 Hz?

Havent thought of that, pretty sure it should have a consistent tick rate for output.

Buy anyways, I used interpolation to estimate the laptime.

Extreme example:

Last distance of previous lap = 100 m
Lap distance = 103 m
First distance of new lap = 104 m

Last time of previous lap = 100 s
First time of new lap = 104 s

So when I interpolate, the lap time would be 103 seconds.

1 Like