Skip to content

five-on-it / packages/ai/src/traffic / TRAFFIC

Variable: TRAFFIC ​

const TRAFFIC: object

Defined in: packages/ai/src/traffic.ts:98

The numbers of the traffic.

Type Declaration ​

bailMoving ​

readonly bailMoving: 0.2 = 0.2

…and of a moving one.

bailSlow ​

readonly bailSlow: 0.6 = 0.6

Chance a scared driver bails out of a slow car (under 3 m/s)…

cruiseMax ​

readonly cruiseMax: 0.95 = 0.95

…at most.

cruiseMin ​

readonly cruiseMin: 0.82 = 0.82

The share of the road's speed a driver cruises at: at least…

despawn ​

readonly despawn: 260 = 260

Cars farther than this from every player go (m).

maxAbandoned ​

readonly maxAbandoned: 12 = 12

Cars left by their drivers kept at most: the oldest out of sight goes beyond.

maxCars ​

readonly maxCars: 64 = 64

Cars wanted at most.

panicRadius ​

readonly panicRadius: 18 = 18

A shot, a blast or a hit this near a car scares its driver (m).

panicTicks ​

readonly panicTicks: 360 = 360

Ticks a scared driver speeds away for.

sight ​

readonly sight: 55 = 55

Out of a player's sight beyond this (m): where stuck cars and walkers may vanish.

spawnClear ​

readonly spawnClear: 14 = 14

No other vehicle this near a new car (m).

spawnClearPerson ​

readonly spawnClearPerson: 7 = 7

Nobody on foot this near a new car (m): past a bus's half length, so no car is made around a person.

spawnJunctionClear ​

readonly spawnJunctionClear: 6 = 6

A new car keeps this far from a junction's box (m).

spawnMax ​

readonly spawnMax: 220 = 220

…and at most (m).

spawnMin ​

readonly spawnMin: 60 = 60

New cars appear this far from the nearest player at least… (m)

spawnTries ​

readonly spawnTries: 6 = 6

Spots tried per tick for a new car.

walkerFleeTicks ​

readonly walkerFleeTicks: 240 = 240

A walker runs for this many ticks from what scared it…

walkerStuckTicks ​

readonly walkerStuckTicks: 20 = 20

…turning aside after this many ticks without getting anywhere.