loading… 0 of 6 answered
01 why
An entity currently has {LocalTransform, Health}. You call AddComponent<Velocity> on it. What physically happens to the entity's data?
a A Velocity field is appended in place; the other components stay putb The entity's existing components are copied from its old chunk to a chunk of the new {LocalTransform, Health, Velocity} archetype, and the old slot is freedc Nothing moves; the entity gains a pointer to a separate Velocity arrayd The whole chunk is reallocated to make room for Velocitycheck 02 why
Why does the runtime group entities by their entire component *set* rather than by a single component type?
a To save memory by deduplicating component valuesb So that for any combination of components an archetype has, each component's array is dense and parallel — making every query over any combination cache-friendly and vectorizablec Because C# generics require a single concrete type per collectiond To make entity IDs shortercheck 03 why
Your archetype's components sum to 96 bytes per entity. What ChunkCapacity will Unity report, and why?
a ~170 — (16384 − 64) / 96b ~156 — the 8-byte Entity handle raises per-slot cost to 104c 128 — the bytes would allow ~156, but the enableable-bitmask cap clamps capacityd ~48 — each component array pads to a full cache line per entitycheck 04 why
A hot archetype carries a 128-byte component that your main loop never reads. Since SoA means the loop doesn't stride over it, what is the actual cost?
a There is no cost — SoA makes unread components entirely freeb The loop must skip past 128 bytes per entity, slowing iterationc It lowers chunk entity-capacity, so every query over that archetype spreads across more chunks and packs fewer entities per line of the components it does readd It forces the loop to run single-threadedcheck 05 how
Why is 16 KB — rather than, say, 512 KB — a sensible chunk size?
a 16 KB is the maximum a single struct may occupy in C#b It keeps a chunk's streaming working set inside fast L1/L2 cache while still amortizing per-chunk header and iteration overhead; much larger chunks stop fitting cache and coarsen parallel workc It matches the operating system's virtual memory page size exactlyd Larger chunks would exceed Burst's stack limitcheck 06 what
What does the Entity value itself contain?
a The entity's component data, inlineb A pointer to a managed C# object representing the entityc An index and a version number — a handle the runtime uses to locate the entity's componentsd The archetype's full component listcheck
your notes stored in this browser · syncs when you sign in
← m01.l02 m01.l04 →