Archetype ECS for C# and MonoGame, check it out ! :)

I developed a C# highperformance archetype ECS which can be used with .NetStandard2.1, .Net6 and .Net7… and thus also with MonoGame :slight_smile:

Its incredible fast ( actually one of the fastest benchmarked ECS according to ECS.CSharp.Benchmark ) and easy to use with little boilerplate code, its bare minimum to give full controll the user himself. Its also oriented to unity ECS and offers multithreading support out of the box.

genaray/Arch: A high performance c# Archetype Entity Component System ( ECS ) with optional multithreading. (github.com)

A small code sample looks like this :

var world = World.Create();
var query = new QueryDescription{ All = typeof(Position), typeof(Velocity) };  // Query all entities with Position AND Velocity components

// Create entities
for (var index = 0; index < 1000; index++) 
    var entity = world.Create(new Position{ x = 0, y = 0}, new Velocity{ dx = 1, dy = 1});
        
// Query and modify entities 
world.Query(in query, (ref Position pos, ref Velocity vel) => {
    pos.x += vel.dx;
    pos.y += vel.dy;
});

Since i put a lot of love into this project and theres still much to come, i would appreciate any feedback, contribution or star ! :smiley:

2 Likes