Skip to content

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

packages/ai/src/police-budget ​

The city's public safety budget (M5) and the adaptive pressure (M6), GAME_DESIGN §12.

  • The budget is the room's: BUDGET.max points. Every police actor put out (an officer, a car, a drone, a truck: what the room's count of actors grows by) costs BUDGET.perActor; what the players destroy drains it (a police car wrecked, a drone down, an officer killed: BUDGET.drain); it refills slowly. Run dry, the room is overrun: the news says so and the response thins, the room's cap on police actors at BUDGET.thinShare of itself, until it has refilled to BUDGET.recover. It is the lever that keeps 32 players' chaos within what one city pays for.
  • The pressure is each player's: a factor from 0.8 to 1.2 (kept in tenths), 1 to begin with. Escaping easily (from five stars or more to none, not arrested, within PRESSURE.easyTicks of reaching five) raises it a tenth; being busted PRESSURE.busts times in a row lowers it a tenth. It scales the cruisers sent after the player and how soon they are sent (police.ts' dispatch).

Both are hashed with the police's book. Deterministic: the players in client order.

Interfaces ​

Variables ​

Functions ​