five-on-it / packages/sim/src/acts
packages/sim/src/acts
What a character is doing with its hands, for the renderers to animate (GAME_DESIGN §4): nothing the simulation acts on, only what it tells. A character that fires, punches, knocks someone out from behind, throws a grenade, picks something up, drops it, uses an item, opens a container or a door, talks to a contact, types at a terminal or shakes a sleeper awake is marked with that act for ACT_TICKS ticks (long enough for a few snapshots to carry it); a counter of the acts tells a new one from the same one again. Some last as long as their cause: getting in and out of a car (on the way to its door, getting in at it, standing at it just out: boarding.ts), climbing a ladder (ladders.ts), swimming (water.ts), cowering in hiding (a frightened target), picking a lock, a body's pockets or a container open (searching, rummaging), and the phone as the player's input says (out in the hand, held to the ear on a call, or in a conversation or at a terminal's screen of the world). A dog's bark is an act too (dogs.ts): its mouth, not its hands.
The snapshot carries all of it in one byte (actByte): the act's index in ACTS in the low five bits, the counter in the high three. The act and its clock are components, hashed with the rest; the phone is the input's.