Changelog
What changed in each EasyEcs release, newest first: new APIs, performance, fixes and the changes that need code changes.
What changed from one EasyEcs release to the next, newest first, for code that uses EasyEcs. Upgrading across a major or minor version that needs code changes? The migration guide has the steps. Each GitHub release also lists every pull request it contains.
4.6.0
New
world.Load(input, markWritten: false)loads a whole save without change ticks: no loaded row counts as written or removed, also for systems added after the load, so a restart that resumes a saved world does not send every record again. See restart.world.AddSystem<T>(changesFromNow: true)(andAddSystem(system, changesFromNow: true)) starts a system at the current tick: the first run of its[Changed<T>]and[Removed<T>]methods visits only what is written or removed after the call. See ticks.
Fixes
- Native AOT publishes without warnings: a program with tracked components (
ITrackChanges, also the built-inChildOf) or disabled components got an IL3054 warning (generic recursion), which fails a build that treats warnings as errors. See Native AOT.
4.5.0
New
entity.Run(ref job)runs a struct job (IForEachEntity<T1..T9>) on one entity: it returns false when the entity is stale or lacks a component, andentity.Run(ref job, filter)also when aQueryFilter(With,Without,WithAny,Changed,Removed, a group) rejects it. The job'sWritesstamp change ticks as in a pass, itsrefparameters stay valid across its own structural changes, and its writes reach the moved row even when it throws. See one entity:entity.Run.- A system group can filter through interfaces:
IGroupWith<T>/IGroupWithout<T>on the group, or on an interface it implements, act as[With<T>]/[Without<T>]. A generic interface gives each type its own group (IActorGroup<TActor> : IGroupWith<Inbox<TActor>>), which attributes cannot express. See group filters. world.Descendants(root)walks a whole subtree, depth first, allocation-free once warm: collect a group with every level of children before moving or saving it. See list them.world.LoadEntitiesInto(input, entities, markWritten: false)restores a record without counting it as a change, so[Changed<T>]savers and replicators do not send it back; that holds for a value it replaces too, such as a prefab's default. See a record of what persists.- The EasyEcs package brings Nino's generator: a
[NinoType]component gets its formatter with no other package reference, so a project can drop itsNino.Generatorreference (a kept one must not be older than the Nino of EasyEcs). See declare the components.
Fixes
4.4.0
New
world.SaveEntities(output, ids, set)saves only the components of aComponentSet(ComponentSet.Create().With<Bank>(), orWith(typeof(Bank))for types learned at run time): a record of what persists, without the runtime components around it, which then need no Nino formatter. See a record of what persists.world.LoadEntitiesInto(input, entities)loads such a save onto entities that exist already: the i-th saved entity's components are added to or replace those of the i-th entity, each entity moving table at most once, with indexes, groups, change tracking andEntityIdfields following. See a record of what persists.- A component renamed or moved to another namespace keeps its saves with
[NinoFormerName("Old.Name")]: saves record types by their Nino type id. See when the code changed. - An unmanaged
[NinoType]component is written by its Nino formatter, so aVersionTolerantorKeyedone may gain members between builds and still load its old rows. See when the code changed. - A refused load names the cause and the fix: raw rows against a formatter, a changed size or layout, two types of the process sharing an id. See why a save does not load.
Performance
- A
DynamicBuffer<T>that dies (its entity destroyed, the component removed) hands its emptied list to the next buffer of its element type the thread creates: entities that come and go with buffers allocate nothing once warm. See dynamic buffers and decision D32.
Changes that need code changes
- Saves written by 4.3 or earlier do not load (
InvalidDataException): write again the data that must outlive the upgrade. See the migration guide. - EasyEcs builds on Nino 4.0.0-rc.6: reference
Nino.Generator4.0.0-rc.6. See the migration guide. - An unmanaged component marked
[NinoType]is saved by its formatter instead of as raw rows; remove the attribute where raw rows are meant. See the migration guide.
Fixes
- EECS033 no longer suggests a generated member the receiver does not have
(
entity.Read<ChildOf>()was told to becomeentity.ChildOf, a member of query items, which does not compile).
4.3.0
New
- Performance rules in the analyzer, for code that works but does more than it needs. Warnings, for code that costs:
EECS025 a
ref/Span<T>parameter,Get<T>()orWriteX()that only reads, EECS026 a[ForEach]parameter the method does not use, EECS027 a component or singleton looked up through the visitedEntityor theWorldon every row, EECS028 an allocation in a[ForEach]method orOnUpdate, EECS029 an instance[ForEach]method that uses nothing of its system, EECS030 a structural change entity by entity over a query, EECS031 entities created one by one in a counted loop, EECS032Count() > 0instead ofAny()and counting or filtering in a loop. Suggestion (Info), for the same cost written shorter: EECS033 a generic call with a generated member of the same meaning (entity.Get<Position>()asentity.Position). Error: EECS034 a system that callsWorld.Update(). Why each rule is in and the ones left out: decision D29. - Code fixes for the new rules where the change is mechanical:
in,ReadOnlySpan<T>,Read<T>(),[With<T>],static, the bulk call (SetAll,RemoveAll,DisableAll,EnableAll,DestroyEntities),CreateEntitiesorEnsureCapacity,Any/Count, and the generated member. Each is offered only when the result compiles. - Every analyzer diagnostic links its section of the analyzer rules page.
Changes that need code changes
- A build that treats warnings as errors fails on the new warnings (EECS025 to EECS032) until the code is changed or
the rule is suppressed, and a system that calls
World.Update()no longer builds (EECS034). See the migration guide.
4.2.0
New
world.EnsureCapacity<T1, …, Tn>(count)pre-sizes the table of exactly those components and the entity storage, so the nextcountCreateEntity/CreateEntitiescalls with them never grow either (Friflo'sarchetype.EnsureCapacity, Arch'sEnsureCapacity(signature, n)). See structural changes.
Performance
- Creating many entities in a fresh world no longer sets off a full garbage collection inside the call: a
reservation (
EnsureCapacity,EnsureEntityCapacity,CreateEntities,InitialEntityCapacity) grows the table and the entity storage to what it needs instead of the next power of two, and large entity storage sized by one goes to the pinned object heap, beside the columns. See decision D28.
Changes that need code changes
- A
[ForEach]method's singleton parameter throwsInvalidOperationExceptionwhen the world has no such singleton, likeworld.XandGetSingleton<T>()(it used to add the default value);world.SingletonRef<T>()throws the same way. Add the singleton where the world is built, before the firstUpdate():world.SetClock(…)orworld.AddSingleton<Clock>(), orworld.GetOrAddClock()where the default is right. See singletons and the migration guide.
Fixes
- A
[ForEach]method with a parameter namedownerno longer fails to build with CS0100 in generated code. world.EnsureCapacity(prefab, count)called while a query or[ForEach]pass walks the table it grows no longer leaves the pass writing to the old columns for the rest of the table. See structural changes.
4.1.0
New
- Archetype tables: each table stores its components as columns of rows, unmanaged columns pinned and 64-byte aligned. Removing a component keeps the row and clears a presence bit, so states that come and go never move data. See architecture.
- Immediate structural changes with stricter iteration: a pass visits each entity at most once, and
refwrites of a[ForEach]method survive the body's own structural changes. See structural changes. - Static
[ForEach]methods outside systems, generic systems and runners, filters on system groups,Maybe<T>parameters,UpdatePhase, and systems need nopartial. See systems. - Ordering by dependency with
[UpdateBefore<T>]/[UpdateAfter<T>]; errors as data withSystemErrorPolicy.Disableandsystem.Error; per-system timing withWorldOptions.MeasureSystemsandsystem.Stats. See systems. - Change tracking (
ITrackChanges,[Changed<T>],QueryFilter.Changed<T>(since)) and removal detection ([Removed<T>],QueryFilter.Removed<T>(since)). See change tracking. - Generated members for every component, tag, singleton, index, buffer and query shape:
hero.Position.X += 1,hero.SetVelocity(1, 0),hero.SetDead(),world.Battle.Tick++,world.ZoneIndex.Find(3),item.Position,prefab.SetLoot(…). See entities and components. - Prefabs (
new Prefab(), derived prefabs, groups withAddMember),world.Instantiate,EnsureCapacityandentity.Clone(). See prefabs. DynamicBuffer<T>: a list per entity held as a tracked component. See dynamic buffers.- Value indexes (
IIndexed<TKey>,world.Index<T, TKey>()), ordered walks (Range,Ascending), relations (IRelationbuffers) and target policies (WhenTargetDestroyed). See indexes and relations. - Hierarchies:
ChildOf(EntityId Parent), children, destroy cascades. See hierarchy. GroupBy<T>()splits tables by a value, so a query for one zone walks only its tables. See groups.entity.Disable<T>()/Enable<T>()and cleanup components (ICleanupComponent). See cleanup and disable.- Bulk
SetAll/RemoveAll/DisableAll/EnableAll, andCreateEntities/DestroyEntities. See bulk changes. - Snapshots:
world.Capture()/world.Restore(snapshot). See snapshots. - Saves:
world.Save/Loadthrough Nino. See saves. SaveEntities/LoadEntities/MoveEntitieshand a group of entities to another world or process, andworld.RemoveTypes(assembly)takes a plugin's types out of a world so itsAssemblyLoadContextcan unload. See migration and unload.WithAny<T>filters,entity.Read<T>()andentity.TryGetRef<T>(out found). See queries.world.Describe(),entity.Describe()and a debugger view of entities. See API.- Analyzer rules up to EECS024 and code fixes for them, bundled in the package. See analyzer.
- Templates:
dotnet new install EasyEcs.Templates. See getting started.
Performance
- A realistic server tick of 100,000 entities runs much faster than in 4.0.1 and allocates nothing. See performance.
- Structural changes check a plain owner flag instead of a compare-and-swap, so creating and destroying entities is faster.
- Jobs that cannot change structure iterate with no per-entity bookkeeping.
- Parallel runs use the thread pool and wake helper threads only when they pay (D22).
- A
QueryFilterholds no object reference, so building one at the call is cheaper (D18). - Counting rows by their set bits with
Vector512/Vector<T>(D21).
Changes that need code changes
Every step is in the migration guide.
WorldOptions.ParallelisWorldOptions.ParallelSystems: writenew WorldOptions { ParallelSystems = true }.Entity.Idis anEntityIdandEntity.Versionis gone: readentity.Id.Indexandentity.Id.Version, and storeEntityIds in components (EECS017 warns aboutEntityfields).EcsSystem.Priorityis gone: order systems with[UpdateBefore<T>]/[UpdateAfter<T>].- The
World.SystemErrorevent is gone: usenew WorldOptions { SystemErrors = SystemErrorPolicy.Disable }and readsystem.Error. world.DestroyEntity(entity)is gone: callentity.Destroy().entity.Add<T>()is gone: writeSet(new T(…))or the generatedSetX(…)to add or replace,GetOrAdd<T>()to add a default only when missing.world.CompactArchetypes()andworld.GetFragmentationStats()are gone: tables stay dense on their own.IForEachjobs receive only the components: take the entity throughIForEachEntity.Queryresults are ref structs: noawaitin the loop, no storing items in fields, lambdas or LINQ.- Structural changes belong to the world's owner thread; one made inside a parallel stage or a parallel
[ForEach]throwsInvalidOperationException. See threading. - EECS007 (state in a system) and EECS008 (a system referencing a system) are errors; they were warnings in 4.0. Move the state into a component or singleton, and let systems communicate through data.
QueryEnumerator.CountandIsEmptyare gone: callworld.Count<…>(filter)/world.Any<…>(filter).UpdateIntervalandUpdatePhaseshould return constants: EECS018 warns when they do not.- Refs into a table can be invalidated by structural changes of other entities; iteration order follows table rows;
AddSingletonresets an existing singleton in place; stale handles answerHas/TryGetwith false. See refs and await.
Fixes
Entity.GetHashCode()is deterministic across runs, computed from the entity's index and version.- The analyzer knows generated writers by their symbols: a component named
Settings, read throughentity.Settings, no longer hides an EECS013.
4.0.1
New
WorldOptions.Parallelruns systems side by side when their generated read/write sets do not conflict, with the same result as running them in order. See threading.- A
[ForEach]method may take no component when a[With<T>]names what to query:[ForEach, With<Dead>] static void Remove(Entity e). See systems.
4.0.0
New
- A rewrite for .NET 10 in one
EasyEcsnamespace:World,Query, and a single version-checkedEntityhandle whose accessors returnref T. - Synchronous
EcsSystems with source-generated[ForEach]methods, system groups with[UpdateInGroup<T>], recycled entity ids and per-world singletons. - An analyzer that enforces the ECS principles (EECS006-EECS008). See ECS principles.
Changes that need code changes
Every rename is in the migration guide.
ContextisWorldandGroupOfisQuery.- Systems are synchronous: no UniTask, no async callbacks.
- Events are gone: state changes are components.
3.1.1
Fixes
- The release build uses the .NET 8 SDK (C# 13); the library is unchanged.
3.1.0
New
CountandIsEmptyonGroupResultEnumerator, andCountOf<T>()/AnyOf<T>()onContext.Tag.SetBits/ClearBitstake aparams ReadOnlySpan<int>.
Performance
Tag.ContainsAllmatches archetypes with SIMD.GetFragmentationStatsis lock-free, andUpdate()reuses its task buffer.- Archetypes are walked by index instead of by dictionary enumeration.
Fixes
Avx2.TestZcorrected toAvx.TestZ.
3.0.5
Performance
- No state machine cost for tasks that already completed.
3.0.4
Performance
- Tiny tasks run inline instead of on the thread pool.
3.0.3
Performance
- Parallel work uses an array pool instead of materializing UniTasks.
3.0.2
Performance
- Faster
GetMatchingArchetypes.
3.0.1
Fixes
- A repeat of the 3.0.0 release with the same contents.
3.0.0
New
- Archetypes, and adding or removing several components in one call.
Performance
- Entity creation and destruction and component changes take effect at once.
- Faster
GroupOfand tags, with better locality.
Changes that need code changes
- Callbacks are gone and changes run at once. See the migration guide.
2.1.6
Performance
- Iterating systems allocates nothing.
2.1.5
Performance
- Getting groups allocates nothing (no red-black tree).
2.1.4
Performance
- Faster
Update.
2.1.3
Performance
- Every overload of
GroupOfallocates nothing.
2.1.2
Performance
- Faster task scheduling.
2.1.1
Performance
- Faster task dispatching.
2.1.0
Performance
- Singleton components allocate less.
2.0.10
Performance
- A better resize strategy.
2.0.9
Performance
- Faster component lookup.
2.0.8
Performance
- Faster entity and component lookup.
2.0.7
Performance
- No
SortedListneeded.
2.0.6
Performance
- Fewer allocations through
ValueTask.
2.0.5
Fixes
- Several bugs fixed.
2.0.4
Fixes
- A tag type is registered automatically on first use.
2.0.3
Fixes
- The
AddSingletonComponentcallback passes aref.
2.0.2
Performance
- Better memory use.
2.0.1
Performance
- Faster iteration, refs, entity creation and component adds.
2.0.0
New
- A lock-free context for parallel systems, components that allocate nothing, faster component lookup.
1.0.8
Changes that need code changes
- Initializing a context no longer catches exceptions.
1.0.7
Changes that need code changes
- Components are classes that hold a reference to their entity.
1.0.6
New
- An entity gives access to its context.
1.0.5
New
SingletonComponent: a context holds any number of them.
1.0.4
New
- Systems run in parallel.
1.0.3
Fixes
- Several systems with the same priority all run.
1.0.2
New
- Get an entity from a context by its id.
1.0.1
New
- Systems can be added after the context has been initialized.
1.0.0
New
- The first release: an ECS with asynchronous, parallel systems.
Last updated on
How is this guide?
Features
Every EasyEcs feature on one page, grouped by job. What each does, when to use it, what it costs, how it compares with Arch, Friflo and DefaultEcs.
Migration guide
Upgrade EasyEcs one version step at a time: what to change in your code from v2 to v3, v3 to v4 and between 4.x releases, with code before and after.