> For the complete documentation index, see [llms.txt](https://arch-ecs.gitbook.io/arch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arch-ecs.gitbook.io/arch/readme.md). Agents can also search and read this documentation through its [MCP server](https://arch-ecs.gitbook.io/arch/~gitbook/mcp).

# Why Arch?

Arch, a high-performance and bare minimum C# ECS.

Arch is a high-performance C# based Archetype & Chunks [Entity Component System](https://www.wikiwand.com/en/Entity_component_system) (ECS) for game development and data-oriented programming. To summarize:

<details>

<summary>🏎️ FAST</summary>

Best cache efficiency, iteration, and allocation speed. Plays in the same league as C++/Rust ECS Libs!

</details>

<details>

<summary>🚀 <em><strong>FASTER</strong></em></summary>

Arch is on average quite faster than other ECS implemented in C#. Check out this [Benchmark](https://github.com/Doraku/Ecs.CSharp.Benchmark)!

</details>

<details>

<summary>🤏 <em><strong>BARE MINIMUM</strong></em></summary>

Not bloated, it's small and only provides the essentials for you!

</details>

<details>

<summary>☕️ <em><strong>SIMPLE</strong></em></summary>

Promotes a clean, minimal, and self-explanatory API that is simple by design. Check out the [Wiki](https://github.com/genaray/Arch/wiki)!

</details>

<details>

<summary>💪 <em><strong>MAINTAINED</strong></em></summary>

It's actively being worked on, maintained, and comes along several [Extensions](https://github.com/genaray/Arch.Extended)!

</details>

<details>

<summary>🚢 <em><strong>SUPPORT</strong></em></summary>

Targets .NET Standard 2.1, .NET 6, .NET 8 and .NET 10, so you can use it with Unity, Godot or another compatible C# project.

</details>

## Example <a href="#preparing-for-an-adventure" id="preparing-for-an-adventure"></a>

Install Arch 3.2.0 in a C# console project:

```sh
dotnet add package Arch --version 3.2.0
```

Replace `Program.cs` with this example. It creates an entity and updates its position:

```csharp
using System;
using Arch.Core;

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

// Move all entities that have both components.
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 player: {entity.Id}");
});

// Component declarations follow the top-level statements.
public record struct Position(float X, float Y);
public record struct Velocity(float Dx, float Dy);
```

{% hint style="info" %}
This example is just a foretaste, more syntax and API await you on your adventure! Even non-generic ones and some without lambdas!
{% endhint %}

## Next steps <a href="#setting-off-on-an-odyssey" id="setting-off-on-an-odyssey"></a>

* Learn how to [create entities and access components](https://arch-ecs.gitbook.io/arch/documentation/entity.md).
* [Filter and iterate entities](https://arch-ecs.gitbook.io/arch/documentation/query.md).
* Read the [rules for changes during queries](https://arch-ecs.gitbook.io/arch/examples-and-guidelines/page-2.md).
* Explore the optional [extensions](https://arch-ecs.gitbook.io/arch/extensions/page-3.md).

## Socials

Get involved!

* [Github](https://github.com/genaray/Arch)
* [Discord](https://discord.gg/htc8tX3NxZ)

## Support this project!

But before you leave, take a moment to value this project. Do you notice anything? It is completely **open source**! You can **contribute** and **change** every aspect! So if you like it, [**leave a star** ⭐](https://github.com/genaray/Arch) and [**buy us a coffee** ☕](https://github.com/sponsors/genaray) to support further development!
