ppatierno / formula1-telemetry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Open in Visual Studio Code

Formula 1 - Telemetry decoding

Formula 1 202x game (by CodeMasters/EA Sports) for PC, PS4 and XBox, allows enabling telemetry data to be sent over UDP during a race. This Java library provides a decoder for all the produced packets. Starting from the raw bytes, it builds a specific model exposing all the telemetry data.

The packet format is the one from the 2020 edition, but the library can be used with the latest game editions as well. In order to do so, you have to select the packet format as 2020 when enabling the telemetry in the game. Anyway, the library allows selecting the latest seasons for teams, drivers and tracks even if using the old 2020 packet format. For more information see season selection

Packets specification

The telemetry packets specification is in the official CodeMasters forum here.

Season selection

In order to select the season to be used for teams, drivers and tracks, you need to set the F1_TELEMETRY_SEASON environment variable when starting the application using the library itself. By default, without the environment variable set, the 2020 season data is used.

Build

In order to build and install the library in the local Maven repository, just run the following command.

mvn install

Tools

The f1-telemetry-enum-extractor project provides a tool for converting a CSV file with teams, drivers or tracks information into corresponding Java enums. The CSV has to have a couple per line in the format <ID, team|driver|track>. The produced Java enums list is useful for developer purposes when adding new seasons to the library. The application gets two arguments:

  • the path of the input CSV file
  • the path of the output Java enum file
java -jar f1-telemetry-enum-extractor/target/f1-telemetry-enum-extractor-1.0-SNAPSHOT.jar <path-to-input-CSV> <path-to-output-java-enum>

About

License:Apache License 2.0


Languages

Language:Java 100.0%