VOOZH about

URL: https://www.nuget.org/packages/EasyEcs/

⇱ NuGet Gallery | EasyEcs 3.1.1




EasyEcs 3.1.1

dotnet add package EasyEcs --version 3.1.1
 
 
NuGet\Install-Package EasyEcs -Version 3.1.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyEcs" Version="3.1.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyEcs" Version="3.1.1" />
 
Directory.Packages.props
<PackageReference Include="EasyEcs" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyEcs --version 3.1.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasyEcs, 3.1.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EasyEcs@3.1.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyEcs&version=3.1.1
 
Install as a Cake Addin
#tool nuget:?package=EasyEcs&version=3.1.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

EasyEcs

👁 build
👁 license

An Entity-Component-System library

Why?

Sometimes we may want to remove bidirectional dependencies between our code, and ECS is a good way to do this.

This design pattern offers a clean way to separate the data from the logic, and it's also a good way to improve the performance.

What is ECS?

E - Entity

C - Component

S - System

But what really is it?

Well, as a human, we (entities) live in the world (context), and we have some properties (components). Moreover, we have things to do based on our properties (systems).

Concepts in EasyEcs

  • A Context holds several Entity instances, some System instances and some SingletonComponent instances.
  • Each Entity has some Component instances.
  • Each Component (or SingletonComponent) has only data properties.
  • Each System can filter lots of Entity instances in the same Context by their components and operate logics on them.

Why it removes bidirectional dependencies?

  • Only System contains logics and none of them should reference on each other. But we allow one system depends on another by specifying Priority. (They should only depend on the filtered entities/components)
  • Component only contains data properties and no logics. (Again, no way to have dependency)
  • Entity only contains components. (It is really just a container)

Why is it fast?

  • As a System can operate on a batch of entities with components, we can well utilize the cache of the MMU.
  • We can also easily parallelize the systems to improve the performance, in a multi-core CPU environment.

Anything special in EasyEcs?

  • We have priority for System, so you can control the order of systems.
  • We have frequency for System, so you can control the frequency of systems being executed.
  • We only allow asynchronous interfaces for System and Context, so our ECS should not block the thread (unless you screw up).
  • We introduce built-in parallelism and/or concurrency for System, so you can easily parallelize your systems (for those who are in the same priority) and well utilize the multi-core CPU.
  • We have a cool guy who is maintaining this library. (Just kidding)

What's New in v3.1.0

New Features

  • Count and IsEmpty on GroupResultEnumerator — check query result count without iterating:
    var group = ctx.GroupOf<Health, Position>();
    if (!group.IsEmpty) { /* ... */ }
    int n = group.Count;
    
  • CountOf<T>() and AnyOf<T>() on Context — lightweight alternatives that skip enumerator creation:
    if (ctx.AnyOf<Health>()) { /* ... */ }
    int count = ctx.CountOf<Health, Position>();
    
  • Tag.SetBits / Tag.ClearBits — bulk bit operations with params ReadOnlySpan<int>:
    tag.SetBits(bitIdx1, bitIdx2, bitIdx3);
    
  • Tag.ContainsAll — SIMD-optimized archetype matching via Vector256.AndNot, replacing the previous (mask & query) == query pattern (eliminates temporary Tag allocation and reduces from 2 SIMD ops to 1).

Performance Optimizations

  • GetFragmentationStats() is now lock-free (previously locked + iterated all archetypes every call).
  • Update() reuses a cached task buffer instead of per-bucket ArrayPool.Rent/Return.
  • ExecuteFrequency is cached as a local variable per Update call to avoid repeated interface property access.
  • AggressiveInlining added to GroupOf, CountOf, and AnyOf methods.
  • All archetype dictionary iterations replaced with index-based List traversal for better cache locality.

Example

Just check out the EasyEcs.UnitTest project. I have comments there.

Documentation

Believe me, one day I will make a website for this and document everything.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.1 137 3/22/2026
3.0.5 409 11/21/2025
3.0.4 426 11/21/2025
3.0.3 447 11/20/2025
3.0.2 267 11/6/2025
3.0.1 243 11/6/2025
3.0.0 245 11/6/2025
2.1.6 694 6/5/2025
2.1.5 248 6/5/2025
2.1.4 245 6/5/2025
2.1.3 232 6/5/2025
2.1.2 234 6/4/2025
2.1.1 237 6/4/2025
2.1.0 245 6/3/2025
2.0.10 239 6/1/2025
2.0.9 242 6/1/2025
2.0.8 209 6/1/2025
2.0.7 194 6/1/2025
2.0.6 233 4/11/2025
2.0.5 227 4/11/2025
Loading failed