When I began this project, I wanted to build something that would let me imitate what Robertsmania does on his Twitch channel, which is mainly these two things: use voice control while driving to select what car and camera angle is being shown to viewers on his stream, and use voice control while driving to tell the system to find, for any car, things that happened in the race to affect that car's position, or just things that happened in the race that might be interesting to see, and show a replay of them on the video stream.
The first goal, voice control of what is being shown on the stream, can be done without keeping track of what's happening in the race. But to meet the second goal of identifying interesting events in the race, it is necessary for the system to look at and remember information about what has happened to each car during the race. iRacing provides live "telemetry" during a race that anyone can use to create software to ananlyze and display information about the race. For example, in my video stream, I use third-party software called Joel Real Timing to display each car's position in the race and the time intervals between cars in one corner of the screen.
iRacing provides hundreds of bits of information about what's happening in a race at a frequency of 60 times per second. Most of the bits of information are about the one car that is being driven in iRacing on the game player's computer -- things like tire temperatures, ride height, the speed of each wheel of the car, and values of any gauges that can be shown on the car's dashboard. For my purposes, none of the information about the car being driven on the computer where the game is running matters, because my software is usually running on a "spectator" computer that is only observing the race, with no player and no car being driven on that computer.
A very limited amount of information is available for every car in the race, not just the one being simulated on the player's computer. Here are some of the values iRacing provides for all of the cars in the simulation:
CarIdxLapDistPct: A floating point number between 0 and 1 that says how far along the track distance from the start line to the finish line each car is. For example, a value of 0.45 would mean that a car is at 45% of the track length past the start line.
... To be continued