Competitive Formula E Simulator

Overview

The Competitive Formula E Simulator is a browser-based, AI-driven racing ecosystem that redefines how electric race simulations are built, visualized, and analyzed. It allows an admin to create complex Formula E race environments, define intelligent agents (Formula E cars), and simulate real-world dynamics including energy usage, overtaking strategies, collisions, and pit stops.

Unlike static simulators or racing games, this system functions as a living mobility lab — where every track, driver, and weather parameter can evolve in real time. From adjusting wind resistance mid-race to watching an AI car change its energy strategy during a downpour, the platform delivers true adaptive simulation entirely inside the browser.


Core Objective

To build a realistic, modular, and dynamically interactive Formula E simulation platform where users can construct, modify, and study complete race environments — powered by physics-based modeling, AI driver behavior, and real-time visualization.

It bridges the gap between racing simulation and systems experimentation — serving as a digital twin for mobility research, AI behavior training, and sustainable vehicle analytics.


1) Live World Editor — The Defining Innovation

The Live World Editor is the simulator’s most distinctive feature and its core innovation. It’s a real-time, browser-native race environment designer that lets admins build, edit, and transform Formula E tracks on the fly — even during a live race.

Core Capabilities

  • Visual Track Builder: Design race circuits using a drag-and-drop spline editor with checkpoints, barriers, pit zones, and multi-lane layouts for realistic overtaking.
  • Real-Time Environmental Editing: Modify world parameters such as track friction, surface temperature, weather patterns, and wind drag mid-race. Watch cars instantly adapt their grip, speed, and energy consumption.
  • Dynamic Simulation Control: Pause, tweak, and resume simulations seamlessly — or branch a live race into a new variant (e.g., turning a sunny race into a wet endurance event).
  • Scenario Templates: Save complete environments as reusable templates — from Night Circuits to Extreme Weather Challenges.

Why It Matters

Most simulators are static. Once the race starts, the world is fixed. The Live World Editor breaks this boundary, turning Formula E simulation into a real-time creative and analytical process. It transforms the platform from a fixed scenario player into an interactive research and experimentation tool — where every variable can be controlled and visualized like a sandbox of intelligent agents.

For hackathons and innovation showcases, this feature demonstrates true interactivity, adaptability, and real-time engineering depth — a rare technical blend of reactive simulation physics, AI agent modeling, and in-browser world-building.


2) Moving Agents (Formula E Cars)

Each Formula E car functions as an autonomous simulation agent, complete with a behavioral, physical, and sensory model. These agents react to world parameters and learn to optimize their race strategy dynamically.

Agent Parameters:

  • Performance: Max speed, acceleration, braking efficiency, aerodynamic drag, tire grip.
  • Energy System: Battery capacity, regenerative braking efficiency, energy recovery rate.
  • Driver Behavior: Configurable as aggressive, balanced, or energy-conservative.
  • Sensor Suite: GPS positioning, proximity detection, battery monitoring, and track-awareness sensors.

Example Configuration:

driver_1 = {
  name: "VoltStorm Racing",
  max_speed: 280,
  accel: 7.5,
  battery: 54,
  tire_grip: 0.87,
  behavior: "aggressive"
}

The agents adapt continuously — taking strategic pit stops, slowing down under wet track conditions, conserving power near the end of the race, or aggressively overtaking based on energy margins.

This design not only enables competitive races but also allows the study of energy-aware driving policies, decision modeling, and AI coordination under constrained physical systems.


3) Event and Leaderboard System

Dynamic Event Handling

Every race tick is evaluated for simulation events that influence gameplay and analytics:

  • Lap Completion: Updates race progress and leaderboard.
  • Collision Detection: Calculates impact, energy loss, and penalty scoring.
  • Pit Stops: Handles recharging, tire swaps, and damage repair.
  • Weather Events: Dynamically alters grip, traction, and braking distance.
  • Safety Car Mode: Synchronizes controlled speeds across all cars.

Leaderboard Logic

  1. Laps Completed (descending)
  2. Total Time (including penalties)
  3. Best Lap (tie-breaker)

Implementation Example:

leaderboard = drivers.sort_by { |d| [-d.laps, d.total_time + d.penalty] }

These systems maintain fairness and excitement, creating an evolving competitive landscape visible through live telemetry dashboards.


4) Simulation Engine

The simulation engine acts as the heart of the system — blending real-time physics computation, AI decision-making, and state synchronization for all agents.

Core Simulation Loop

  1. Collect agent inputs and environmental data.
  2. Apply physical forces (acceleration, drag, tire friction, centripetal force).
  3. Detect collisions and resolve impacts.
  4. Trigger race events and update the leaderboard.
  5. Broadcast telemetry to the visualization layer.

Mathematically, for each turn:

$$ a_c = \frac{v^2}{r} $$

where ( a_c ) represents centripetal acceleration, determining cornering limits and grip loss thresholds.


Energy & Battery Model

Energy consumption and regeneration form a critical dimension of Formula E racing:

  • Energy usage per tick: ( E_{use} = P_{draw} \times \Delta t )
  • Regeneration: ( E_{regen} = F_{brake} \times C_{regen} \times \Delta t )
  • SOC (State of Charge) is always clamped between 0% and 100%.

The energy system integrates with behavioral logic to simulate realistic strategic energy management, mimicking real-world constraints of Formula E engineering.


5) UI & Visualization Layer

The user interface combines performance analytics and immersive 3D visualization to provide full situational awareness.

  • Track Map View: Real-time car positions, trails, and racing lines.
  • HUD Panel: Live metrics including speed, lap time, tire wear, and battery state.
  • Event Feed: Displays collisions, penalties, pit entries, and weather changes.
  • Leaderboard Widget: Continuously updating ranking and gap visualization.
  • Replay Mode: Playback with step-through controls, telemetry graphs, and performance overlays.

Together, these layers create a data-rich racing dashboard, ideal for both spectators and developers analyzing agent performance.


6) Technology Stack

Layer Technology Description
Frontend React.js, Three.js, Tailwind CSS Real-time 3D visualization, dynamic UI, and component-based control panels.
Backend Node.js, Express, Socket.IO Server-side simulation control, state updates, event broadcasting.
Physics Engine Custom logic (Cannon.js base) Real-time force and collision simulation with deterministic tick updates.
Database MongoDB Stores race scenarios, telemetry data, and replay sessions.

This architecture enables scalable multiplayer support, low-latency synchronization, and persistent simulation analytics.


Outcome & Impact

The Competitive Formula E Simulator stands as a hybrid of real-time AI racing, live world editing, and systems simulation. It demonstrates how electric mobility research, AI-driven control, and browser-native physics visualization can merge into one cohesive platform.

Key Impacts:

  • Live experimentation: Modify conditions mid-race and watch emergent AI behaviors.
  • Energy optimization research: Study how electric cars adapt to changing terrain and weather.
  • Simulation as a service: Deploy custom mobility environments instantly from any browser.
  • Scalability: Modular design allows integration of ML models, reinforcement learning, or telemetry analytics.

By turning the act of simulation into an interactive design process, the project transforms Formula E racing into a sandbox for adaptive systems, mobility AI, and human-in-the-loop simulation.

In short: this isn’t just a racing simulator — it’s an interactive Formula E universe, where every lap is a dataset and every race is an experiment in intelligence, energy, and engineering.

Built With

Share this project:

Updates