Module racing

Source
Expand description

Bounded polyline racing driver. Produces ordinary controls, never teleports or awards progress. Hosts pass perceived nearby traffic, not hidden rival state.

Call RacingDriver::step on fixed simulation ticks, inspect RacingDriver::status for presentation, and RacingDriver::reset after a teleport, restart or path replacement. Progress is a nearest-path observation, not a lap counter or checkpoint authority. No history or path is allocated.

Structs§

DriverInput
DriverProgress
Projection onto the supplied closed path, as demonstrated by RacingDriver::status. Equal-distance segments choose the lowest index. Intersections and teleports can change the projection discontinuously; it does not establish that the driver visited any checkpoint.
DriverSettings
DriverStatus
Finite, allocation-free diagnostics for the last successful positive tick. Timers are measured after that tick; Reversing describes the returned controls even on the final reverse tick when the remaining time reaches zero. See RacingDriver::status for an example.
RacingControl
RacingDriver
Rival

Enums§

DriverRecovery
Explanation of the controls returned on the most recent tick. See RacingDriver::status for an example.
RacingError
WrongWayReason
Why the most recent tick looks wrong-way relative to its nearest segment. Facing means heading alignment below -0.5; moving means signed along-path speed below -cruise * 0.02. These observations also apply during an intended reverse: consult DriverStatus::recovery before showing a warning. See RacingDriver::status for an example.