Skip to content

Engine → ECS

world_hash.h

Deterministic state hash.

Forward Declarations

world

class world;

Functions

Public

world_hash

[[nodiscard]] CONJURE_API u64 world_hash(
    const world &source);

Hash of every alive entity and component value in the world. Equal worlds (same entities in the same row order, same bytes) hash equal regardless of archetype creation order; one flipped float bit changes it. Non-trivial components are serialised into one JSON writer reused for the whole call, so the writer allocates as it grows to the largest component, not once per component. An asset reference field of a described type takes part through its uuid alone, never through its bound slot, so a world hashes the same in every process and whether or not its references are bound yet. Reads the world without locking it: call it while no structural change is in flight.