General ctelemetry tc file format

I was poking around the assetto corsa files and the ctelemtry files seemed interesting but I couldn't find any documentation for them. I was able to figure out the file format and wrote a script to parse it. I thought I'd document it here in case anyone wants to write tools to parse the files, or maybe even display them in content manager.

The file begins with a short header that contains the player name, track name, car name, track variation/layout name, and the lap time (in milliseconds). Following that, are a number of datapoints, each including your gear, some position/time value, speed (km/h), throttle %, break %.

Every .tc file seems to be the same size and have the same number of datapoints (3999), regardless of track length or lap time. I'm not sure if this means that the sampling is normalized (longer tracks/laptime less samples, shorter tracks/laptime more samples), or if the sample frequency is static and stored in a circular buffer, so that old data is lost. Assetto Corsa displays a `Km` value that goes from 0 to track length, which leads me to think it might be normalized but I don't know for sure.

I'm not sure what the position/time value represents. The values seem to increase from 0 to 1, but I haven't tried driving backwards to see what happens. In game on the graph screen, Assetto Corsa displays a Km value that increases up to the track length as you move your mouse from left to right. The track length isn't stored in the tc file, so I think AC might lookup the track length and combine it with the position value to display the Km value on that screen.

File format:
Code:
+-------------------+-------------------+-----------------------+----------------------------+------------------------+
|  4 bytes          |  4 bytes          | sizeOfName bytes      |  4 bytes                   | sizeOfTrack bytes      |
|  unknown          |  sizeOfName       | Name string           |  sizeOfTrackName           | TrackName string       |
|                   |  (integer)        | (UTF-8 string)        |  (integer)                 | (UTF-8 string)         |
+-------------------+-------------------+-----------------------+----------------------------+------------------------+
+-------------------+-------------------+-----------------------+----------------------------+------------------------+-------------------+
|  4 bytes          | sizeOfCar bytes   |  4 bytes              | sizeOfTrackVariation bytes | 4 bytes                | 4 bytes           |
|  sizeOfCar        | CarName string    |  sizeOfTrackVariation | TrackVariation string      | LapTime (milliseconds) | numDataPoints     |
|  (integer)        | (UTF-8 string)    |  (integer)            | (UTF-8 string)             | (integer)              | (integer)         |
+-------------------+-------------------+-----------------------+----------------------------+------------------------+-------------------+
+-------------------+---------------------+------------------+-------------------+-----------------+
|    4 bytes        |    4 bytes          |    4 bytes       |    4 bytes        |    4 bytes      |
|    Gear           |    Position         |    Speed (km/h)  |    Throttle       |    Brake        |
|   (integer)       |    (float)          |    (float)       |    (float)        |    (float)      |
+-------------------+---------------------+------------------+-------------------+-----------------+
|   ...             |    ...              |    ...           |    ...            |    ...          |
|                     Repeat for each datapoint (total numDataPoints times)                        |
+-------------------+---------------------+------------------+-------------------+-----------------+
floats are in IEEE 754 format.

Proof of Concept:
can output the values in JSON or show a graph with matplotlib

Sample graph with matplotlib. Please forgive my metrics, I'm new :laugh:
1717277516889.png
 

Latest News

Do you prefer licensed hardware?

  • Yes for me it is vital

  • Yes, but only if it's a manufacturer I like

  • Yes, but only if the price is right

  • No, a generic wheel is fine

  • No, I would be ok with a replica


Results are only viewable after voting.
Back
Top