F1 Tool

#Formula 1#Python#Solo

Aanish Bhirud

What is it

I made a python command line tool to gather UDP data from F1 2021 (F1 22 works if you use it's legacy mode). It processes data coming in at 60Hz, using minimal CPU, and Memory. It then calculates the averge Fuel, Tyre Wear and Temprature, and the ERS(Hybrid Battery) usage for the tracked laps. Then it outputs a .txt file with my reccomendations.

It takes about 0.07 seconds of CPU time to process about 650MB of data.

Sample File:


Average fuel consumption: 1.45kg/lap, Fuel Delta from MFD:  +0.01

Suggested fuel for the race is 73.5Kg including 1Kg extra for margin of error
Your average ers style was using 0.6Mj of ers a lap or using 15.0% of the battery per lap
You can sustain this usage from 100% battery for 6.67laps
You should try this for the ERS usage(Assuming max usage 1st lap and keeping about 30% in reserve for defending/attacking):
Where F = first, D = Deploy, C = charge
FDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCDDCD

You completed your laps on the C5 soft 
Your most worn tyre is the Rear Left
Average tyre wear:
Rear Left: 3.0% per lap
Rear Right: 3.0% per lap
Front Left: 2.0% per lap
Front Right: 2.0% per lap

Your tyre temperature information is:
Rear Left
Average: Surface Temp: 95.48C Carcass/Inner Temp: 96.34C
Minimum: Surface Temp: 85C Carcass/Inner Temp: 94C
Maximum: Surface Temp: 139C Carcass/Inner Temp: 100C

Rear Right
Average: Surface Temp: 92.32C Carcass/Inner Temp: 94.06C
Minimum: Surface Temp: 78C Carcass/Inner Temp: 92C
Maximum: Surface Temp: 135C Carcass/Inner Temp: 98C

Front Left
Average: Surface Temp: 93.1C Carcass/Inner Temp: 94.68C
Minimum: Surface Temp: 76C Carcass/Inner Temp: 92C
Maximum: Surface Temp: 138C Carcass/Inner Temp: 98C

Front Right
Average: Surface Temp: 91.3C Carcass/Inner Temp: 93.54C
Minimum: Surface Temp: 76C Carcass/Inner Temp: 91C
Maximum: Surface Temp: 121C Carcass/Inner Temp: 96C

That's all for now.

Where can I find it

This tool's public version is avaliable up on my Github

Why did you make it

You can't access the average tyre wear, fuel usage stats in multiplayer. I really enjoyed perfecting my race strategies in singleplayer using the Race Strategy option in practice. I knew that the game exports this data via UDP, and there is a library to parse this data. So I decided to fill in the void myself.

Improvements Made After Release

  • Improved logic for Average calculations
  • Added Voice Prompts so that it can be run in the background
  • Improved Performance
    • My test input went from 20.2 sec to 0.07 sec
  • Added a way to generate testing data as sharing it was not very easy.

Improvements Planned

  • More Logic improvements
  • Integrating NumPY and Pandas for potential performance gains