Skip to content

five-on-it / packages/ai/src/steer-vehicle / CAR

Variable: CAR ​

const CAR: object

Defined in: packages/ai/src/steer-vehicle.ts:30

The numbers of driving.

Type Declaration ​

arrive ​

readonly arrive: 4 = 4

Within this distance of the route's last point the drive is over (m).

boostAlignment ​

readonly boostAlignment: 0.1 = 0.1

Boost only when the bearing error is under this (rad) and more than this share of the top speed is wanted.

boostShare ​

readonly boostShare: 0.9 = 0.9

brakeAccel ​

readonly brakeAccel: 12 = 12

Braking the speed plan counts on (m/s²; the brakes have more).

bumperRange ​

readonly bumperRange: 2.5 = 2.5

A wall this near the bumper counts as stalled thrice as fast (m).

cornerChord ​

readonly cornerChord: 8 = 8

The chord a corner is taken on, for its speed (m).

cornerLookahead ​

readonly cornerLookahead: 80 = 80

Route ahead examined for corners (m).

cornerMin ​

readonly cornerMin: 0.15 = 0.15

A bend of less than this is no corner (rad).

directRange ​

readonly directRange: 60 = 60

A clear straight line up to this long is driven as it is (m).

episodesToLeave ​

readonly episodesToLeave: 3 = 3

…and this many make a car not worth staying in.

episodeWindow ​

readonly episodeWindow: 600 = 600

Recoveries this close together add up (ticks)…

goalRoadReach ​

readonly goalRoadReach: 8 = 8

…and its goal (farther off the road, the last leg would cross too much).

handbrakeAngle ​

readonly handbrakeAngle: 0.7 = 0.7

The handbrake comes on in bends sharper than this (rad) above this speed (m/s).

handbrakeSpeed ​

readonly handbrakeSpeed: 12 = 12

lateralAccel ​

readonly lateralAccel: 7 = 7

Lateral acceleration allowed in a bend (m/s²).

lookaheadMax ​

readonly lookaheadMax: 30 = 30

…nor farther (m).

lookaheadMin ​

readonly lookaheadMin: 6 = 6

…but never nearer than this (m)…

lookaheadShare ​

readonly lookaheadShare: 0.6 = 0.6

The pursuit point sits this share of the speed ahead (m per m/s)…

ramAlignment ​

readonly ramAlignment: 0.5 = 0.5

ramBackTicks ​

readonly ramBackTicks: 75 = 75

ramContact ​

readonly ramContact: 0.6 = 0.6

A ram is one blow: once the bumper is this near the target car's body (m) the driver backs off for so many ticks before it lines up again, so it never pins a car and pushes it along the road.

ramRange ​

readonly ramRange: 12 = 12

The ram: within this distance (m), above this speed (m/s), within this bearing error (rad).

ramSpeed ​

readonly ramSpeed: 8 = 8

rerouteDrift ​

readonly rerouteDrift: 8 = 8

A goal that moved this far from the planned one asks for a new route at once (m).

reverseTicks ​

readonly reverseTicks: 60 = 60

Ticks of reversing per recovery.

roadDetour ​

readonly roadDetour: 2 = 2

A road route longer than this share of the straight distance, plus this slack (m), is left for the grid.

roadDetourSlack ​

readonly roadDetourSlack: 30 = 30

roadReach ​

readonly roadReach: 14 = 14

How far from a road the car may be for the route to follow the roads (m)…

stallSpeed ​

readonly stallSpeed: 0.6 = 0.6

Slower than this while asking for speed is stalled (m/s), after this many ticks.

stallTicks ​

readonly stallTicks: 45 = 45

tailGain ​

readonly tailGain: 0.8 = 0.8

The gap behind a target closes at this share of the error per second.

throttleGain ​

readonly throttleGain: 3 = 3

The speed error one full throttle answers (m/s).

turnAroundAngle ​

readonly turnAroundAngle: 2.1 = 2.1

Beyond this bearing error, with the goal this near and the car this slow, it backs round (rad, m, m/s).

turnAroundRange ​

readonly turnAroundRange: 18 = 18

turnAroundSpeed ​

readonly turnAroundSpeed: 3 = 3

turnAroundTicks ​

readonly turnAroundTicks: 45 = 45

Ticks of one backing turn.

uTurnPenalty ​

readonly uTurnPenalty: 30 = 30

What a U-turn onto the opposite lane costs against driving on (m).