personalities
How each kind of AI driver drives, as plain data tables that `AiDriver` reads every tick: target speed scale and cap, cornering g, planned braking deceleration, pedal and steering gains and smoothing, pure-pursuit lookahead, following gap, randomness, lane, how much of the road a…
aiDrivers.personalities
How each kind of AI driver drives, as plain data tables that AiDriver reads every tick: target speed scale and cap, cornering g, planned braking deceleration, pedal and steering gains and smoothing, pure-pursuit lookahead, following gap, randomness, lane, how much of the road a racing line may use, and switches for overtaking, leaning on cars, drifting (target slip angle) and the tourist's moods (wander, missed turns, random stops, hesitations), plus the brain's tick rate.
Built in: commuter (careful, modest speed, early braking, big gap, smooth), aggressive (fast, late braking, tailgates, overtakes, leans on cars), racer (racing line, brakes as late as grip allows, flat out on exits), drifter (handbrake flick into corners, holds the slide on countersteer and throttle; turns the car's assists off), tourist (slow, wanders, misses turns and U-turns back, stops for no reason).
Add one with define(name, table), usually from extend(base, changes); AiDriver:setPersonality(name) then drives by it.
local P = require("aiDrivers.personalities")
P.define("granny", P.extend("commuter", { maxSpeed = 8, followGap = 4, label = "Granny" }))
car.component.get("AiDriver"):setPersonality("granny")
Scoped to this part · feeds back into the world's score.