F1 24 GAME
UDP 20777
human-AI system design
Racing is becoming a conversation with AI. BOX BOX makes sure your engineer is always one step ahead.
An AI-powered race engineer for home sim racing. BOX BOX reads live telemetry, identifies critical moments, and delivers real-time voice strategies like a professional pit engineer—helping drivers react faster, understand their performance, and make smarter decisions on track.
Click to enter prototype
Home racing simulator problem
Formula One (F1) strategy is the calculated plan a team uses to maximize their race pace and track position. In professional racing, communication between the driver and the race engineer is not merely a matter of reporting data. This aspect is NOT reflected in the at-home simulator.
F1 strategy engineers analyze data, develop race strategies, and optimize decisions regarding tires, pit stops, and car performance; providing drivers with recommendations for a winning strategy is a judgment call that combines intellectual ability and experience.
| Module | Key input | Judgement logic |
|---|---|---|
| Fuel | fuel_kg, fuel_mix, lap-history fuel deltas, remaining_laps, SC/VSC, MFD remaining laps | Blend observed + prior burn rate → finish margin after reserve → split save / neutral / push at 0.5 / 1.5 laps; no call if data missing or confidence is low |
| Tire | compound, age_laps, wear%, four-corner temps, track_temp | dt = lambda*(alpha*a+beta*a^2) + (1-lambda)*kappa*w + thermal; life = min(wear, age, performance budgets); overheat bands from T_hot / T_crit |
| Pace | lap_history plus fuel / tire / weather / damage / ERS derived fields | Drop pit/SC/yellow/traffic/out-laps → fuel-correct base pace → add tire/fuel/thermal/weather/damage/ERS → regress trend and project H laps |
| ERS | battery_percent, harvest/deploy J, deploy_mode, gap_ahead/behind, SC/VSC | SoC vs attack/defend floors + blend of observed net SoC change vs mode prior → permission flags + recommended mode |
| Weather | rain_percent, weather_code, air/track temp, remaining_laps | Rain intensity → wetness class → grip surface → drying/wetting rate → ETA until grip crosses g_inter / g_wet |
| Opponent | gap, last_lap, both cars’ tire derived fields, pit_stops, in_pit | Continuous score from gap + pace + tires + catch window + undercut → HIGH/MEDIUM/LOW → DEFEND/COVER/UNDERCUT/HOLD |
I asked AI to organize the calculation parameters and strategies of each module into Python files.
scenarios.py tests the opponent strategy model. It loads YAML race cases, builds player and rival states, then scores threat. Checks compare threat level, pace, attack chance, catch window, undercut risk, and confidence with expected values, then print PASS or FAIL.
advice - Complete analysis, 4 modules:
1. Overall status (Pos / Gap / Tyre / Age / Wear / Trend table)
2. Lap time comparison (Lap Time / Speed Comparison table)
3. Tyre degradation forecast (Wear% / Cliff / Remaining laps / Rate)
4. Tactical advice (L{n} | Command | Rationale)
voice - One-sentence tactical call (<20 characters, player car only)
Example: "BOX IN 2 LAPS, front tyre 78%"
UDP 20777
data ID data Category
Check whether the time since the last analysis is > ANALYSIS_INTERVAL
default 15sprompt:
One-line tactical instructions EX<20 characters, refer only to the player’s car
Example: “BOX IN 2 LAPS, front tyres 78%”
Model: deepseek-v4-flash, timeout=15s
Call the DeepSeek API to retrieve {advice and voice}
Tyre temperatures are climbing. Ease off for two corners.
Front left is overheating. Avoid aggressive turn-in.
Rear tyres are losing grip. Smooth on corner exits.
Call the ElevenLabs TTS API to generate an MP3 file
Get the MP3 URL
Prepare the content to be sent via WebSocket
WebSocket pushes content to the front end
Connect to /ws/pitradio via WebSocket to receive the payload: {advice, voice, audio_url, cars[], track, player_id}
The simulator continuously collects real-time vehicle and race data.
Key telemetry is packaged and transmitted to the system via UDP protocol.
real-time data transfer
The LLM analyzes telemetry and identifies situations that require strategic guidance.
Racing conditions are translated into short and actionable strategy messages.
Strategy text is converted into natural race-engineer voice feedback.
Natural, clear, and timely voice output keeps the driver focused on racing.
The driver receives guidance while racing and adjusts driving decisions in real time.
Learn each driver’s braking points, throttle habits, tyre management, and recurring mistakes to provide personalized guidance.
Combine telemetry with voice, eye tracking, and physiological signals to understand driver attention, workload, and stress.
Predict tyre degradation, overtaking opportunities, pit-stop timing, and potential errors before they happen.
Adjust the timing, frequency, and detail of AI feedback according to race conditions and driver workload, reducing unnecessary information.