Skip to content

Glossary

Trecs uses several similar-sounding terms with distinct meanings. Each entry links to the page that covers it in depth.

Identifying entities

Term What it is
Entity An identifier that groups components. Has no data of its own.
EntityHandle A stable reference to an entity that survives structural changes. Primary user-facing identifier. Carries Component<T>(world) / TryComponent<T>(world, out) / Remove(world) / SetTag<T>(world) / UnsetTag<T>(world) / AddInput<T>(world, v). Remove, SetTag, and UnsetTag also have NativeWorldAccessor overloads for Burst.
EntityIndex (Advanced) A transient reference (buffer position within a group). Only valid within the current submission cycle. Same method surface as EntityHandle but skips the handle-to-index lookup. Always prefer EntityHandle unless profiling identifies the lookup as a bottleneck.

Classifying entities

Term What it is
Tag A zero-cost marker struct (ITag) that classifies entities. Used in template definitions and as a query filter.
TagSet Stable identity for a tag combination — a 32-bit interned ID derived from the member TypeId values. Portable across runs and serializable.
Template Compile-time blueprint declaring an entity's tags, components, partitions, and inheritance.
Abstract template A template marked with the C# abstract keyword. Usable as an IExtends<> base but cannot be passed to WorldBuilder.AddTemplate.

Where entities live in memory

Term What it is
Group The contiguous memory block holding some number of entities. Created implicitly based on a unique tag combination.
GroupIndex ushort runtime handle for a group, valid only for one World's lifetime.
Partition A group an entity moves between at runtime via SetTag<T>() / UnsetTag<T>(), for cache locality across entities sharing dynamic state. Partitions an entity moves between share the same template and component types.
Set A dynamic membership flag on entities, independent of tags and groups. Iteration visits only members. Allows efficient sparse iteration across groups.

Bundling component access

Term What it is
Component Unmanaged struct (IEntityComponent) holding per-entity data.
Aspect A partial struct (IAspect + IRead<> / IWrite<>) bundling related component access into one reusable view.
Aspect interface A partial interface extending IAspect, for polymorphic helpers across multiple aspects sharing the same component shape.

Touching the world

Term What it is
World Container that owns all entities, components, and systems. Drives the per-frame update.
WorldAccessor Main-thread API for a world. Tagged with an AccessorRole which determines what operations are permitted.
AccessorRole Fixed / Variable / Unrestricted — controls what an accessor can do. System-owned accessors get the right role from their phase.
NativeWorldAccessor Burst-compatible counterpart to WorldAccessor for use inside jobs.

Running logic

Term What it is
System Class implementing ISystem whose Execute() runs each frame.
Phase One of EarlyPresentation / Input / Fixed / Presentation / LatePresentation — controls when a system runs and what role it gets.
[ForEachEntity] Marks a method for source-generated entity iteration.
[WrapAsJob] Turns a [ForEachEntity] method into a Burst-compiled parallel job.
[FromWorld] Auto-populates fields on a hand-written job struct.

Lifetime mechanics

Term What it is
Submission The point in the frame where queued structural ops are applied. Add / remove / partition transitions are deferred until submission.
Heap Storage for managed or unmanaged data outside the component buffer, accessed via SharedPtr / UniquePtr / native variants.
BlobId Stable identifier for a heap blob. Supplied explicitly when allocating shared data on heap.

Quick mental model

  • Tags describe an entity's identity
  • Groups are the contiguous memory blocks entities live in — one per unique tag combination.
  • Partitions are groups that double as runtime state (entities move between them so logic runs with maximum cache locality).
  • TagSets are portable handles naming a tag combination.
  • Sets are ad-hoc subsets you maintain yourself.
  • Aspects are reusable bundles of read/write component access.
  • Templates are the compile-time blueprint; tags are how runtime code refers to entities.