five-on-it / packages/sim/src/hash
packages/sim/src/hash
A hash of everything that matters in a world, for the determinism gate: the tick and every vehicle's (its owner, lock and paint with the rest, whether it dozes and how long it has been left alone: dormant.ts; a boat's flood: boat.ts), trailer's, character's (its status, a dart's clock, a lock being picked, its party, its time as a ghost, what it does with its hands, whether it is indoors and its body included; held up or restrained and by whom, a body it drags or who drags it, the dumpster it was hidden in, the pose it is told to hold), every pedestrian's lead (a dog's walker, a walker's dog, what the dog does and makes for: dogs.ts), projectile's, light piece's, door's (a gate's opening for a car too), pickup's, laid nail strip's, container's, terminal's, camera's and device's state (a bomb's fuse, a fuse box's power: devices.ts; what a character holds the key at, holds.ts), then every stack anything holds (an inventory, a container, a trunk; the lock tags are left out, their locked state is in), every player's stored cars and Cash, the vehicle spawners at work, the room clock and its weather. Two worlds that ran the same inputs must hash the same on every tick.