joshjaysalazar / IntelliCaster

An AI race commentator for iRacing
GNU General Public License v3.0
3 stars 0 forks source link

74 allow commentary to be aware of multiple events #82

Closed joshjaysalazar closed 7 months ago

joshjaysalazar commented 7 months ago

Description

Rather than pulling events one at a time off the stack, the commentary generator is now aware of all detected events within the max history length (as set by the user). This means it's able to associate events which are related. Events were restructured to include percentage of lap completed and how long ago the event happened. A secondary GPT call was added to determine who the camera should focus on, which appears to be reliable in testing. Additional prompt restructuring was done to improve text generation, including the addition of some information to make commentary more accurate (for example, the commentators now know how many laps have passed or how much time has passed, depending on how the race is structured, so it knows to commentate relative to beginning/end of race).

In the process of making this change, bug #79 was fixed by adding a sanity check. The race start is also detected in a more reliable way now, by looking as SessionState.

Fixes #74, #79

Type of change

Testing

Tested on multiple replays of different race types to ensure commentary was reasonable in most situations. This included races with both standing and rolling starts, as well as both lap and timed races.