Arch-Events 3.0.0

dotnet add package Arch-Events --version 3.0.0
                    
NuGet\Install-Package Arch-Events -Version 3.0.0
                    
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="Arch-Events" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arch-Events" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Arch-Events" />
                    
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 Arch-Events --version 3.0.0
                    
#r "nuget: Arch-Events, 3.0.0"
                    
#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 Arch-Events@3.0.0
                    
#: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=Arch-Events&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Arch-Events&version=3.0.0
                    
Install as a Cake Tool

Arch Discord Maintenance Nuget License C#

A high-performance C# based Archetype & Chunks Entity Component System (ECS) for game development and data-oriented programming.

  • 🏎️ FAST > Best cache efficiency, iteration, and allocation speed. Plays in the same league as C++/Rust ECS Libs!
  • 🚀 FASTER > Arch is on average quite faster than other ECS implemented in C#. Check out this Benchmark!
  • 🤏 BARE MINIMUM > Not bloated, it's small and only provides the essentials for you!
  • ☕️ SIMPLE > Promotes a clean, minimal, and self-explanatory API that is simple by design. Check out the Wiki!
  • 💪 MAINTAINED > It's actively being worked on, maintained, and comes along several Extensions!
  • 🚢 SUPPORT > Supports .NetStandard 2.1, .Net Core 6 and 8, and therefore you may use it with Unity or Godot!

Download the package, get started today and join the Discord!

dotnet add PROJECT package Arch --version 2.2.0

⏩ Quickstart

Arch is bare minimum, easy to use, and efficient. Let's say you want to create some game entities and make them move based on their velocity... sounds complicated? It's not! Arch does everything for you, you only need to define the entities and the logic.

I bet you don't want to read tons of documentation, theory, and other boring stuff right?
Let's just ignore all that deep knowledge and jump in directly to get something done.

using Arch;

// Components
public record struct Position(float X, float Y);
public record struct Velocity(float Dx, float Dy);

// Create a world and an entity with position and velocity.
using var world = World.Create();
var adventurer = world.Create(new Position(0,0), new Velocity(1,1));

// Enumerate all entities with Position & Velocity to move them
var query = new QueryDescription().WithAll<Position,Velocity>();
world.Query(in query, (Entity entity, ref Position pos, ref Velocity vel) => {
    pos.X += vel.Dx;
    pos.Y += vel.Dy;
    Console.WriteLine($"Moved adventurer: {entity.Id}"); 
}); 

The example is very simple. There more features including queries without lambda or an API without generics and much more. Checkout the Documentation!

💡 Highlights

This is all you need to know, with this little knowledge you are already able to bring your worlds to life.
However, if you want to take a closer look at Arch's features and performance techniques, check out the Wiki! There's more to explore, for example...

🤝 Our promise

  • Bare minimum - No overengineering, no abstracted hidden costs
  • Incredibly fast and efficient
  • Is actively maintained and developed
  • Grateful for every contribution

🚀 Features

  • Archetypes with configurable chunks (16KB by default) for your massive worlds
  • Incredibly small Entity size
  • Optional Pure-ECS for maximum performance and efficiency
  • Bulk/Batch Entity operations
  • High-performance Queries
  • Multithreaded Queries
  • Enumerators
  • CommandBuffers
  • Events
  • Generic and Non-Generic API
  • AOT friendly
  • Several extensions with systems, tools, source generators and more
  • Monogame, Unity, Godot Integration guides
  • And much more...

⚡ Iterating fast

Pick the query style that fits, from simplest to fastest:

var description = new QueryDescription().WithAll<Position, Velocity>();

// 1. Lambda, the simplest.
world.Query(in description, (ref Position pos, ref Velocity vel) => pos.X += vel.Dx);

// 2. Struct, the call is inlined. Keep the Query to skip looking it up on every call.
var query = world.Query(in description);
var move = new Move();
world.InlineQuery<Move, Position, Velocity>(query, ref move);

// 3. Chunk, gets all components of a chunk as spans, which allows SIMD.
var moveChunks = new MoveChunks();
world.InlineChunkQuery<MoveChunks, Position, Velocity>(query, ref moveChunks);

public struct Move : IForEach<Position, Velocity>
{
    public void Update(ref Position pos, ref Velocity vel) => pos.X += vel.Dx;
}

public struct MoveChunks : IChunkForEach<Position, Velocity>
{
    public void Update(Span<Position> positions, Span<Velocity> velocities)
    {
        var x = MemoryMarshal.Cast<Position, float>(positions);
        var dx = MemoryMarshal.Cast<Velocity, float>(velocities);

        var index = 0;
        for (; index <= x.Length - Vector<float>.Count; index += Vector<float>.Count)
        {
            (new Vector<float>(x.Slice(index)) + new Vector<float>(dx.Slice(index))).CopyTo(x.Slice(index));
        }

        for (; index < x.Length; index++)
        {
            x[index] += dx[index];
        }
    }
}

Chunk queries pay off if the data fits into the CPU cache, about 2.5x faster in our benchmarks. Iterating millions of entities is limited by memory bandwidth, there larger chunks help, which is the only thing that does. Set World.DefaultChunkSizeInBytes = 65_536; once at startup, or pass World.Create(chunkSizeInBytes: 65_536). In our benchmarks 64KB chunks iterated 1M entities about 20% faster than the default 16KB, but every archetype allocates at least one chunk. Parallel queries (ParallelQuery, InlineParallelQuery) split the chunks over all threads of the World.SharedJobScheduler, they pay off for a few thousand entities per thread or expensive updates.

🧩 Extensions

Arch has some extensions that add more features and tools. Among them for example :

  • 🛠️ Arch.Extended > Adds a set of tools and features to save boilerplate code!
  • ⚡ Arch.ZeroAllocJobScheduler > The allocation-free job scheduler that runs Arch's multithreaded queries, with dependencies, parallel-for, cancellation and idle workers that sleep!
  • 🔎 Godot Entity Debugger > An Arch Entity debugger for the Godot engine!
  • 🔎 Stride Entity Debugger > An example of Arch in the Stride engine, with additional entity and system inspector!
  • 🔎 Arch.Unity > A library that makes the integration of Arch in Unity much easier, with many cool new features!
  • 🔎 Zinc-Framework > A small but fine engine framework which is based on Arch and also has its own source generator to define entities declaratively!
  • ❓ Your Tool-Library? > If you develop more tools and features for Arch, let us know and we'll list them here!

🚀 Performance

Arch is already one of the fastest ECS and uses the best techniques under the hood to achieve maximum performance and efficiency. Care is always taken to find a healthy balance between CPU performance and ram utilization.

If you are more interested, have a look at the benchmark!

📖 Documentation

Were we able to convince you? If so, let's get started. We have prepared a whole wiki to explain all the important aspects and provide examples. Click here for the documentation!

💻 Projects using Arch

Arch is already used in some projects, for a more detailed look, take a look at the wiki!

Cubetory

Build a huge factory on a tiny island! Resources are scarce and unique - tweak and optimize everything for peak efficiency. Start with simple painted cubes, unlock tons of upgrades, and scale up to complex production chains. No enemies, just satisfying spaghetti. Try it out!

Ingame screenshot

Trailblazers

Embark on a thrilling adventure in this roguelite colony-sim strategy game. Command your Landship in tactical battles, care for a crew composed of all sorts of characters, shape your home, manage resources, and lead expeditions into the March. Discover what lies at its heart... and in yours. Try it out!

Ingame screenshot

Hivetide

Build your defenses and face the tide. Hivetide is a mix of tower defense and real-time strategy where each bullet counts. Try it out!

Ingame screenshot

Decentraland Unity Client

Unity Explorer is the official desktop client implementation for Decentraland 2.0, allowing users to explore and interact with the Decentraland metaverse using Unity. This desktop client delivers a smoother, more immersive experience compared to the previous web-based version, setting the foundation for Decentraland's future expansion! Try it out!

Ingame screenshot

EquilibriumEngine-CSharp

Equilibrium Engine is a data-oriented C# game engine that takes advantage of ECS pattern followed by Hot-Reloading of your libraries which allows you to quickly iterate on different aspects of your projects.

Equilibrium Engine screenshot

Contributors

<a href="https://github.com/genaray/Arch/graphs/contributors"> <img src="https://contrib.rocks/image?repo=genaray/Arch" /> </a>

A huge thanks to all the supporters who did their part, especially TwistableGolf for their dedication and design of the official Arch logo and banner!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.0 0 11/27/2026
2.2.0 51 11/24/2026
2.1.0 996 5/27/2025
2.1.0-beta 205 4/25/2025
2.1.0-alpha 258 4/24/2025