Repository navigation
Added
- Optional columns (3.2.0):
QueryBuilder.OptionalwithOptComp[T]tracks a component
whose absence never excludes an archetype, read when the archetype carries it — one pass in
place of the oldInclude+Excludepair, ~14% faster, no allocation, acrossAll,Pick,
SeekandSeekH. Zero-size tags are optional too (3.2.1): presence comes from the
archetype mask. - Tags in factories (3.2.2):
NewFactorytakes zero-size tag components among the data
ones (&Comp[T]{}), marking the spawned archetype without a data column. - 512 component types (3.3.0): the mask grows from 2 words to 8, a component ID from 8 to
16 bits (MaskSize = 8,MaxComponents = 512). Iteration, Seek, Pick, migrations and
factories measure as before; announcing a new archetype to the queries costs about four
times as much, once per combination of components. - As many queries as a world needs (3.3.0): the matcher catalog keeps matchers in blocks
of 64 instead of one array of 64 that panicked past it; no matcher ever moves.
WithMatcherCap(n)is a hint for a world building many queries, never a limit. - Components known only at run time (3.4.0):
RegCompOf(t)on the ECS and onSysInit,
LoadCompOf(t)and the columnsNewColumn(t)/NewOptColumn(t)areRegComp[T],
LoadComp[T],Comp[T]andOptComp[T]for areflect.Type: a column goes wherever a
&Comp[T]goes and reads the same memory (Base,At,Present);Comp.Indexand
OptComp.Indextell a typed column's position, so aColumncan share it. CmdBuf.Reserve(e, compID)(3.4.0) queues an add and hands back the staged slot to
write the value into beforeSync—AddOnewithout the type parameter, andAddOneis
written over it.ECS.CmdBuf(r)is the buffer a registered system'sUpdateis
handed, for a system queuing changes from outside its ownUpdate.
Fixed
- Chunk memory carries the GC's exact pointer bitmap (3.2.3): 3.1.0 allocated scanned
archetypes as[]unsafe.Pointerviewed as bytes, marking every word a pointer, padding
included; a stale address in padding aborted the process withfound bad pointer in Go heap. Scanned archetypes allocate through a generated Go type, pointer-free ones keep plain
bytes, and theCmdBufarena holds pointer-free payloads only. Seek/SeekHrefuse an archetype missing a tracked column (3.2.3): it baked as
offset 0, the entity-ID column, soComp[T].Atpointed into unrelated storage; both return
false and leave the cursor untouched.- A save keeps every value in its own column, whatever the registration order (3.2.4):
Save wrote an archetype's values in its own order while the directory listed them by type
number, so a type registered early but added to entities later loaded into another
component's column. Saves the bug did not touch load as before; those it did cannot be
repaired. - A matcher is 384 bytes, not 320 KB (3.3.0): its Seek cache was an array over every
possible archetype, about 21 MB for a world's first 6the
archetypes Seek meets.
Changed
CmdBuf.AddOneverifies thatcompIDnamesT(3.2.3), asAddCompValuedid.- Blank (
_) filler fields are accepted in components (3.2.3); persistence skips them.
Additive since v3.1.0: no API removed.