ANND RACING LABHOME ↗
PYTHON LOADING $2,500 LVL 1 • 0 XP BUILD 0.23.1.1 • V8 PREVIEW FIX • CAR ECONOMY
VEHICLE TURBO STREET
ANND R4T
2.0L TURBO • RWD • 6 SPEED
POWER CAP450 HP
WEIGHT3,080 LB
REDLINE7,200 RPM
DRAGCdA 0.72
TRACK CONDITIONS
AIR72°F
TRACK88°F
GRIP0.94
WIND+2 MPH
HUMIDITY41%
PRESSURE29.92
RACE EVENT
PRACTICE
Free practice • opponent varies • no payout
RIVAL: selected when you stage • same physics / no hidden power multiplier
ENGINE HEALTH HEALTHY
ENGINE100%
IAT72°F
COOLANT185°F
OIL195°F
EGT900°F
KNOCK0.0
RACE ENGINEER / QUICK HELP
New here? You do not need to understand the whole tune at once. Change one thing, make a pass, then use the timeslip + Engineering tab to see what actually changed.
1Read the car. state contains what the car is doing right now — RPM, gear, wheel slip, boost, temperatures and knock.
2Make a decision. Use normal Python if statements. Example: if wheel slip gets high, reduce throttle.
3Return commands. Your controller sends back throttle, boost_target, afr_target, timing, cooling and shift commands.
I'm new to Python — show me the basic pattern

if means “only do this when the condition is true.” The line underneath must be indented:

if slip > 0.10:
    throttle = 0.65

Press Tab in the editor to insert four spaces. Shift+Tab removes indentation.

What should I change when the car spins?

Do not immediately add more tire or more power. First look at 60 ft and peak slip. Try less first-gear boost, lower launch RPM, or a smoother throttle rule. The goal is controlled slip, not zero slip.

What should I change when the turbo feels lazy?

Compare your post-shift RPM with the turbo's full-boost RPM in the Garage. If every shift drops the engine below the useful boost range, try a higher shift point, shorter next gear, or a smaller turbo.

Why do AFR, timing, knock and IAT matter?

More boost makes more cylinder pressure and power, and more timing makes torque until the engine approaches MBT. Past the safe window, excess timing/boost, lean AFR, hot IAT, weak fuel support and cylinder pressure drive knock and engine damage. The fastest tune is aggressive without crossing that limit.

Race procedure: one burnout + one staging bump per pass. Shallow/deep staging changes rollout; rolling completely through the beam fouls the staging attempt. RESET PASS gives you a fresh attempt.
CURRENT BUILD
ANND R4T
SELECT VEHICLE TURBO STREET
POWER320 HP
WEIGHT3,080 LB
DRIVERWD
AERO0.72 CdA
CAREER PROGRESS LEVEL 1
ENGINEER XP0 / 100
HARDWARE / SETUP PARTS CHANGE THE SIMULATION
TURBO
TIRE COMPOUND
INTERCOOLER
SUSPENSION
FUEL SYSTEM
ENGINE INTERNALS
CURRENT POWERTRAIN LIVE HARDWARE DATA
Loading hardware data...
PARTS STORE BUY ONCE • KEEP FOREVER IN THIS BROWSER
Local browser save • log in for cloud sync.
3D INITIALIZING
STAGING MODE
BURNOUT → BUMP INTO BEAM → SPORTSMAN TREE → LAUNCH
TEST & TUNE • FREE PRACTICE
ANND
SPEED
0 MPH
GEAR 1
RPM 0
BOOST 0.0 PSI
BURNOUT • RELEASE IN GREEN
Tire 82°F • hold button, release in target
STAGING • RELEASE IN BEAM
BUMP rolls the car into the staging beams
RPM0
BOOST0.0 PSI
SLIP0.0%
AFR12.2
TIRE TEMP82°F
POWER0 HP
IAT72°F
EGT900°F
KNOCK0.0
G-FORCE0.00 G
THROTTLE0%
ENGINE100%
SPEED • LEFT SCALE MPHBOOST • RIGHT SCALE PSISLIP • RIGHT-INNER SCALE %
X: elapsed time after launch (seconds)Y: each colored line uses its labeled scale
race_controller.pyREADY
Loading Python runtime...
ECU DATA REFERENCE: The game calls controller(state) many times during a pass. state is what the sensors tell your code. Your returned dictionary is what your ECU commands back to the car. Top-level constants such as GEAR_RATIOS configure the drivetrain before the pass starts.
1. TUNE / DRIVETRAIN INPUTS — values you set above controller()
NAMEUNIT / RANGEWHAT IT DOESWHAT TO WATCH
GEAR_RATIOSratio • 0.3–6.0 eachMechanical ratio for each forward gear. Larger number = more wheel torque but less road speed at the same RPM.Post-shift RPM, number of shifts, trap speed.
FINAL_DRIVEratio • 1.5–6.0Multiplies every transmission gear. Higher final drive makes all gears shorter.Launch traction, shift points, whether you run out of gear.
TIRE_PRESSUREPSI • 10–45Changes modeled tire grip around the tire type's preferred pressure.60-foot and wheel slip. Too high or too low costs grip.
LAUNCH_RPMRPM • 1200–7200Minimum engine RPM held during the first part of launch.Wheel slip, turbo response, 60-foot.
SHIFT_TIMEseconds • 0.03–0.50How long torque is interrupted during a gear change.ET and post-shift boost/RPM. Shorter is quicker but bounded by the game.
2. STATE INPUTS — live sensors available as state["..."]
KEYUNITWHAT IT MEANSCOMMON USE
timesecondsPhysical simulation time since the car launched.Time-based boost ramps or launch strategies.
distancemetersDistance traveled from the starting line.Track-position based control.
speedMPHCurrent road speed.Speed-based boost or safety logic.
rpmRPMCurrent engine speed.Shift logic, turbo operating range.
gearinteger • 1+Current transmission gear.Boost-by-gear and gear-specific shifts.
boostPSIActual manifold boost currently achieved, not merely what you requested.Spool monitoring and protection logic.
slipratio • 0 = noneModeled excess wheel force beyond available tire grip. 0.10 is shown as roughly 10% slip.Traction control / throttle reduction.
iat°FIntake-air temperature after charge heating/cooling.Heat protection, boost/timing reduction.
coolant°FEngine coolant temperature.Thermal protection.
oil_temp°FEngine oil temperature.Thermal protection and durability.
egt°FModeled exhaust-gas temperature.Watching fuel/timing/boost heat load.
knock0–8 model scaleModeled detonation risk/activity. Higher is worse and can damage the engine.Pull timing/boost or enrich AFR.
tire_temp°FCurrent driven-tire temperature. Burnout quality sets the starting point.Understanding launch grip.
track_temp°FCurrent track-surface temperature.Conditions-aware tuning.
air_temp°FAmbient air temperature.Heat / density-aware tuning.
humidity% RHAmbient relative humidity from the current race conditions.Conditions-aware gas tuning and logging.
baro_kpakPa absAmbient barometric pressure converted from the current track conditions.Altitude/weather compensation and manifold-pressure comparisons.
air_densitykg/m³ modelThe same modeled ambient air density used by the vehicle simulation.Weather-aware power and aero strategies.
engine_health0.0–1.0Remaining powertrain health. 1.0 = 100%.Backing the tune down before more damage occurs.
afr_actualAFR • GASModeled measured AFR after fuel-system response and high-duty lean-out.Fuel-system headroom and closed-loop protection.
lambda_actualλ • GASActual AFR normalized to gasoline stoichiometric AFR (14.7). 1.00 = stoich.Fueling logic that is easier to reason about across rich/lean mixtures.
fuel_pressurePSI • GASModeled fuel-rail pressure. It rises with boost but can droop when the fuel system is overworked.Detecting pump/injector supply problems before knock rises.
injector_duty0–1+ • GASModeled injector/fuel-system utilization. Above 1.0 means commanded fuel exceeds supported flow.Knowing when richer targets or more boost are no longer supportable.
map_kpakPa abs • GASAbsolute intake-manifold pressure including atmospheric pressure.Pressure-based load strategies.
engine_loadratio • GASMAP divided by ambient barometric pressure. Roughly 1.0 at atmospheric pressure and higher under boost.Load-indexed timing/fueling/boost logic.
cylinder_pressuremodel index • GASModeled peak cylinder-pressure index relative to the installed short-block limit.Protecting rods/pistons/block even before knock becomes severe.
mbt_timingdegrees • GASCurrent modeled minimum-best-timing estimate for torque.Advancing toward MBT without blindly adding timing.
turbo_speed% model • GASModeled compressor/turbo utilization based on boost and RPM.Seeing when a turbo is being pushed near its flow region.
oil_pressurePSI • GASModeled oil pressure based on RPM and oil temperature.Engine-protection logic.
pack_voltageV • E-XLive battery-pack terminal voltage after load sag.Watching voltage sag at high current.
pack_currentA • E-XTotal DC pack current being delivered.Launch/current-limit and thermal strategy.
front_currentA • E-XActual front-inverter DC current after the requested split and inverter ceiling.Detecting front-inverter saturation and balancing axle power.
rear_currentA • E-XActual rear-inverter DC current after the requested split and inverter ceiling.Detecting rear-inverter saturation and balancing axle power.
pack_power_kwkW DC • E-XElectrical power leaving the battery pack: pack voltage × pack current.Comparing battery input power with delivered motor power.
battery_soc% • E-XBattery state of charge.Power consistency and voltage management.
battery_temp°F • E-XBattery temperature.Pack thermal derating.
front_motor_temp°F • E-XFront motor temperature.Front power/thermal protection.
rear_motor_temp°F • E-XRear motor temperature.Rear power/thermal protection.
front_inverter_temp°F • E-XFront inverter temperature.Front current derating.
rear_inverter_temp°F • E-XRear inverter temperature.Rear current derating.
front_slipratio • E-XFront-axle traction slip.Moving torque toward the rear when the front tires unload.
rear_slipratio • E-XRear-axle traction slip.Moving torque toward the front when the rear axle saturates.
front_power_kwkW • E-XMechanical power from the front motor.Front/rear power-bias tuning.
rear_power_kwkW • E-XMechanical power from the rear motor.Front/rear power-bias tuning.
power_kwkW • E-XTotal mechanical motor power.Monitoring real delivered EV power.
Important: Inputs are sensor readings. Changing a local variable named rpm or boost does not directly change the car. You must return an output command.
3. CONTROLLER OUTPUTS — commands your function returns
OUTPUTALLOWED RANGEWHAT IT COMMANDSNOTES
throttle0.0–1.0Requested throttle fraction. 1.0 = 100%.Primary traction-control tool. During a shift the simulator temporarily reduces effective throttle.
boost_target0–40 PSIRequested boost pressure.Actual boost is still limited by turbo size, spool RPM and turbo boost cap.
afr_target9.0–16.0 AFRRequested air/fuel ratio.Very lean high-boost commands increase modeled knock/EGT risk.
timing-5–30 degreesRequested ignition timing value used by the power/knock model.Advance toward MBT adds power; going beyond the safe window raises knock and can reduce power/damage the engine.
cooling0.0–1.0Requested cooling effort.Helps manage IAT/coolant/oil but is still affected by installed intercooler hardware.
shift_upTrue / FalseRequests the next higher gear.Only shifts if not already shifting and another gear exists.
shift_downTrue / FalseRequests the next lower gear.Useful for experiments; usually False during a quarter-mile pass.
rev_limit3000–16500 RPMSoftware rev-limit request.Gas cars can use this for safety/shift experiments. Platform redline remains a hard ceiling.
power_request0.0–1.0 • E-XRequested EV drive power/torque fraction.Primary E-X launch and traction command; throttle remains a backwards-compatible alias.
front_torque_bias0.20–0.80 • E-XRequested fraction of motor power sent to the front axle.Balance front/rear slip as weight transfers rearward.
pack_current_limit200–1500 A • E-XMaximum requested battery current.More current gives more power but more voltage sag and heat.
front_current_limit100–650 A • E-XFront inverter current ceiling.Controls front motor contribution and inverter heat.
rear_current_limit100–750 A • E-XRear inverter current ceiling.Controls rear motor contribution and inverter heat.
field_weakening0.0–1.0 • E-XHigh-RPM field-weakening request.Supports top-end motor speed/power but creates extra motor/inverter heat.
regen_strength0.0–1.0 • E-XRegenerative-braking request.Primarily useful after the finish line / future shutdown simulation; bounded now for ECU completeness.
4. EXAMPLE — read sensors, make a decision, return commands
def controller(state):
    rpm = state["rpm"]       # INPUT: sensor
    gear = state["gear"]     # INPUT: sensor
    slip = state["slip"]     # INPUT: sensor

    throttle = 1.0           # OUTPUT command
    boost_target = 18.0      # OUTPUT command

    # Reduce power only while the tire is slipping badly.
    if slip > 0.10:
        throttle = 0.65

    # Less boost in first gear.
    if gear == 1:
        boost_target = 10.0

    return {
        "throttle": throttle,
        "boost_target": boost_target,
        "afr_target": 12.2,
        "timing": 14.0,
        "cooling": 0.4,
        "shift_up": rpm >= 6750,
        "shift_down": False
    }
Prototype safety: imports, loops, classes, attribute access and several advanced Python constructs are blocked. Player Python executes in browser Pyodide only, not on the FastAPI backend.
Sweep from 2500–7200 RPM
PEAK HP---
PEAK TORQUE---
PEAK BOOST---
DANGER---
HP • LEFT SCALETORQUE • LEFT SCALE LB-FTBOOST • RIGHT SCALE PSI
X: powertrain speed (RPM)Y: power/torque left • secondary channel right
RPMBoostHPTorqueAFRTimingKnockCyl PFuel DutyFuel PSI
MAX SPEED---
MAX SLIP---
MAX KNOCK---
MAX G---
SELECTEDSPEEDMPH
MIN---during pass
AVERAGE---during pass
MAX---during pass
FINISH---last sample
X: elapsed time after launch (seconds)Y: speed (MPH)
60 FT QUALITY---
POWER USE---
THERMAL---
SHIFTING---
Launch Grip
0%
Power Delivery
0%
Thermal Headroom
0%
Engine Safety
0%
COMPETITIVE ENGINEERING

Rivals that learn. Racers that never have to be online.

Beat the AI and it develops. Challenge another player's strongest VERIFIED ghost while they are offline.
GHOST WINS 0 GHOST LOSSES 0

BUILT-IN RIVAL DEVELOPMENT

LOSE → STUDY → UPGRADE → TEST → REMATCH
The AI never reads your private Python. When you beat it, it can match higher hardware tiers it observed on your car and tests small legal changes to its own launch RPM, gearing, boost-by-gear, shift RPM, traction control, AFR, timing and cooling using the same vehicle physics.

OFFLINE PLAYER GHOSTS

Only VERIFIED runs appear here. Tunes and hardware remain private; your browser receives only a sanitized time/distance/speed trace needed to put the other car in the lane.
Loading verified offline racers…
RACING LAB CAREER

Engineer your way from street car to unlimited class.

CREDITS
$2,500
TIMESLIP NO PASS
QUARTER MILE
--.---
---.- MPH
Reaction-.---
60 FT-.---
330 FT-.---
1/8-.---
1/8 MPH---
1000 FT-.---
1/4-.---
Trap---.-
RUN HISTORY
No completed passes.
VERIFIED LEADERBOARD PUBLIC DATA ONLY
Checking verified Racing Lab records…
Public records show racer, car, ET, MPH and reaction only. Hardware setups and Python tunes stay private. ANND Labs admins can inspect private run snapshots only for moderation and verification. Client-submitted runs are never published until a server-side validator marks them VERIFIED.