Decision
Crowds: decisions slow and staggered, execution every tick
A city of pedestrians cannot each think every frame, and does not need to.
- Deciding is slow and staggered; carrying out is every tick. A person perceives and chooses a task at 2 Hz or lower. Steering, animation and the response to being hit run every simulation tick.
- A rate is a period and a phase, counted in ticks. At 30 ticks a second, a 2 Hz update is every 15th tick, and there are 15 phases. Phases are given out so that each tick carries about the same work: 150 people at 2 Hz are 10 a tick, not 150 on every fifteenth.
- The stagger is the reaction time. A person ready for something reacts in about a quarter of a second, and in half a second or more when they must choose. A 2 Hz update at a random phase gives each person a delay between 0 and 500 ms, different for each, for nothing. Noticing a shot needs no event that wakes everyone at once.
- What stays immediate is physical: a body struck by a car, anything two people do together.
- In a fight, reaction time is a number a designer owns, not a side effect of the rate.
- The rate falls with distance, with a limit where the player can see: someone watched through a scope cannot take two seconds to react.
The script scheduler has the same rule for its threads, so a designer writes "guards decide four times a second" in one line and each guard lands on a tick of its own.
A design decision with the scheduler behind it built and tested. There are no pedestrians in the game yet.