Skip to content

five-on-it / packages/ai/src/police-signals

packages/ai/src/police-signals ​

The green wave (GAME_DESIGN §12, four stars and up): the city's traffic lights turned against a wanted driver. Every signalled junction on the road the player is predicted to take (police-precrime.ts), within GREEN_WAVE.reach of them, turns red for every approach for GREEN_WAVE.holdTicks (gridlock): the ambient traffic stops and queues at it (traffic-drive.ts reads the lights), which closes the road; the police's own cars pay the lights no heed. It is the overrides layer of @foi/world's signals (SignalOverride, a mission's setSignal too): the plan stays a pure function of the tick, the override sits on the junction for its time, is hashed with the traffic, and goes to the clients with the other junctions switched by hand, so their lamps show it. A junction a mission switched is left alone; the police release theirs early when the stars drop, and leave a junction be for GREEN_WAVE.restTicks after it turned green again. The tell is the red lights themselves, and a line on the radio. Deterministic: players by stars then client id, the route walked by node ids.

Interfaces ​

Variables ​

Functions ​