EntityId

type EntityId

Runtime identity of a simulated thing.

Two flavors, deliberately distinguishable at a glance:

@g:milky-way/s:SOL/b:2 — a generated entity, identity is its address #7 — a dynamic entity (player ship, spawned object)

Dynamic ids come from a counter that lives in the save file rather than from a UUID: a random id would make two replays of the same session disagree, and the counter is exactly as unique while staying deterministic.

universe/src/address.ts:384

Type

Brand<string, 'entity'>