Skip to content

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), 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), 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 and camera's state, 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.

Functions ​