Skip to content

five-on-it / packages/ai/src/wanted

packages/ai/src/wanted ​

The Wanted level (GAME_DESIGN §12): what each player's crimes add up to. A crime is read off the simulation's events of the last step and counts when somebody saw or heard it: gunfire near people (a pedestrian or a police officer within reach of the muzzle or of where the shot ends), hitting or killing a pedestrian (a car running one over too: the victim saw it), carjacking (the driver saw it), picking a car's lock in front of a witness, wrecking a car with people in it, blowing a car up where somebody sees or hears it (the car the player set alight, or one its blast lit in turn: @foi/sim's fire.ts keeps whose the fire is), and, dearer, hitting or killing a police officer or shooting at a police car; breaking property in front of a witness (a light piece of the level knocked loose, somebody else's car wrecked with nobody in it, a security camera shot to pieces), cheaper; wrecking a police car (policeWreck) and shooting down a police drone (drone), dear, and escalations both; walking or driving into a game's restricted zone that raises the Heat, in front of a witness (restricted.ts). Speeding past the police is a crime too, which the police system sees for itself (speedingCrime): an officer that notices a player going well over the road's limit. Only players commit crimes; what the NPCs do to each other is theirs.

Crimes raise the player's Heat, up to WANTED's cap of 100, and the Heat crosses thresholds into stars, one to five (HEAT_STARS). Stars six to ten are earned, not ground out (GAME_DESIGN §12): only an escalation adds one, a crime of the gravest kinds (killing an officer, an explosion seen or heard, wrecking a police car, downing a police drone) by a player at five stars or more whose Heat is up at 90, at most one every ten seconds; above five the Heat stays at its cap until the stars are back at five. A game's rules.maxStars caps them all (PoliceBook.maxStars). Out of police sight and without a new crime for a few seconds the Heat cools by one a second, never below the stars it holds; the stars come down one at a time only when no officer, drone or camera has seen the player (and no crime has been reported) for a while, longer at more stars: losing the police. Sitting on a bench out of sight, the player blends in: the Heat cools WANTED.sitCooling times as fast, sooner, and the stars come down in half the time. A respray in a garage clears the Wanted level, unless the police saw the player lately (resprayClears: they saw the car go in). Pure state and the rules that change it; the police system (police.ts) says who sees whom and acts on the stars. The book is part of the AI world and of its hash (hashAiState).

Interfaces ​

Type Aliases ​

Variables ​

Functions ​