Inspiration As avid fans of Formula 1 and technology, we've always been fascinated by the razor-thin margins that separate victory from defeat. A single pit stop, a tire strategy change, or a moment of on-track brilliance can alter the course of a championship. We were inspired by the massive amounts of telemetry data generated during a race and saw an opportunity. What if we could harness this data not just to analyze the past, but to predict the future?
We imagined a tool that could serve as a "crystal ball" for race strategists, logistics managers, or even city traffic planners. This led to the birth of Race Oracle, a platform designed to simulate complex mobility scenarios and provide predictive, data-driven insights. Our goal is to empower decision-makers to move beyond intuition and make quantitatively superior choices.
What it does Race Oracle is an AI-powered simulation platform that ingests real-world mobility data to predict the performance of multiple moving agents. Our functional prototype, built with Python, Pygame, and the fastf1 library, already visualizes historical F1 lap data. It showcases each car's position on a 2D track map, color-coding the path by speed, and displays key telemetry like speed, lap time, and progress in a retro-style dashboard.
The vision is to expand this into a full-featured, web-based simulator. The backend will process vast datasets and run machine learning models to answer "what-if" questions. The frontend will provide an interactive 3D visualization, allowing users to explore different strategic outcomes and view live, simulated leaderboards. Ultimately, Race Oracle will be applicable to any competitive mobility system, from MotoGP and drone racing to supply chain logistics and urban traffic flow.
How we built it We started by building a proof-of-concept to validate our core idea. The current simulator is built entirely in Python. We use:
fastf1: To fetch and cache official Formula 1 timing and telemetry data.
pandas and numpy: For data manipulation, cleaning, and mathematical calculations required to normalize track coordinates and process telemetry streams.
pygame: As our graphics and interaction engine. It handles rendering the track, the moving agents (cars), the UI panels, and responding to user input for pausing, changing laps, and adjusting simulation speed.
We designed the UI with a retro, CRT-monitor aesthetic to make the data visualization engaging and clear. The core logic involves normalizing the car's (X, Y) coordinates to fit the screen, mapping speed to a color gradient for the car's trail, and synchronizing the animation with lap-time data.
Challenges we ran into One of the first major hurdles was handling the sheer volume and complexity of F1 telemetry. A single lap contains thousands of data points for position, speed, and time. Synchronizing this data to create a smooth, coherent animation that accurately reflects the real-world event was challenging. We had to develop efficient data processing pipelines using pandas to interpolate and align different data streams.
Another challenge was creating a versatile normalization function. Race tracks have vastly different layouts and scales. We wrote a function that dynamically calculates the appropriate scale and offset to ensure any track can be centered and properly displayed within the map area.
Finally, managing the application state (e.g., paused, current_lap, animation_speed) while ensuring the rendering loop runs at a smooth 60 FPS required careful structuring of the main game loop in pygame.
What we learned This project has been a fantastic learning experience in data visualization and simulation. We learned how to effectively process and interpret complex, real-world time-series data. Building the Pygame prototype taught us a great deal about 2D graphics programming, state management in interactive applications, and the importance of a clean UI for conveying dense information.
Most importantly, we learned that even a simple simulation can reveal fascinating insights. Watching the speed-colored trails paint a picture of where a driver brakes, accelerates, and hits the apex has deepened our appreciation for the skill involved in motorsports.
What's next for Race Oracle The future for Race Oracle is to transition from a local prototype to a scalable, web-based application. Our roadmap includes:
Developing a robust backend API (likely with FastAPI) to handle data processing and serve simulation results.
Building a 3D frontend with a modern framework like Next.js and a rendering library like Three.js for a more immersive and interactive experience.
Integrating machine learning models (using scikit-learn or TensorFlow) to enable the core predictive "what-if" analysis.
Expanding data sources to include other mobility domains like MotoGP, logistics fleets, and public traffic data.
Built With Primary Language: Python
Libraries: pygame, numpy, pandas, fastf1
Future Tech (Planned): Next.js, Three.js, FastAPI, scikit-learn, Docker
Log in or sign up for Devpost to join the conversation.