column-serialize
only.Expand description
Fast column-major serialization
Stores each archetype in a block where each type of component is laid out contiguously. Preferred for data that will be read/written programmatically. Efficient, compact, and highly compressible, but difficult to read or edit by hand.
This module builds on the public archetype-related APIs and World::spawn_column_batch_at()
,
and is somewhat opinionated. For some applications, a custom approach may be preferable.
In terms of the serde data model, we treat a World
as a sequence of archetypes, where each
archetype is a 4-tuple of an entity count n
, component count k
, a k
-tuple of
user-controlled component IDs, and a k+1
-tuple of n
-tuples of components, such that the
first n
-tuple contains Entity
values and the remainder each contain components of the type
identified by the corresponding component ID.
Traits
- Implements deserialization of archetypes
- Implements serialization of archetypes
Functions
- Deserialize a column of
entity_count
T
s fromseq
intoout
- Serialize all entities in a
World
that satisfy the givenQuery
through aSerializeContext
to aSerializer
- If
archetype
hasT
components, serialize them intoout
- If
archetype
hasT
components, serializeid
intoS