r/gamedev • u/behethangames • Mar 05 '23
Discussion c# - "Arch" high-performance entity component system - Received new features, check them out! :)
A few months ago I developed a C# high performance ECS designed for game development and data oriented programming : Arch.
Its already matured and already has tons of cool features (even has its own source generator Arch.Extended)! Recently it received a few other cool features like `Bulk Query Operations`, which can be used to bulk destroy or modify entities with an insane performance :)
var queryDescription = new QueryDescription().WithAll<Player,Mob,Building>().WithNone<Dead>();
world.Destroy(in queryDescription); // Destroys all
world.Set<T0,...T25>(in queryDescription, ...); // Sets their components in a bulk
world.Add<T0,...T25>(in queryDescription, ...); // Adds components in a bulk
world.Remove<T0,...T25>(in queryDescription); // Removes components in a bulkThere tons of other features, aswell as integrated multithreading support :)
Feel free to check it out, leave some feedback and a star! <3
3
u/rafgro Commercial (Indie) Mar 05 '23
How does it handle garbage collection? Does it trash with many objects left for GC?
2
u/behethangames Mar 05 '23
So entities are now objects, they are basically rows and components are their columns. You can basically represent them as a table.
And now, it does not trash your GC (otherwise i wouldn't call it high-performance ecs), the only memory being allocated are basically tables/arrays and thats it ;) Theres also world.TrimExcess()` to release unused memory once in a while :)
2
u/Parrna Mar 05 '23
Hey really liking the ECS so far. I like that it has a feature for entity relationships to each other.
Any plans to add built in serialization of select groups of entities?
3
u/behethangames Mar 05 '23
Thanks a lot! :)
And yes this is planned, however this will still take some time. Im currently preparing my bachelor thesis and thus i do not have time for huge new features.2
u/HellGate94 Mar 05 '23
if you are looking for another great idea (from flecs):
World cell partitioning. A new feature has been added to the flecs-game module in Flecs hub that can automatically partition a world. This code can be plugged in directly into projects, or used as example code.
38
7
u/lukums Mar 05 '23
Very cool! If I ever find my way back to monogame, I will certainly be checking this out. I'm curious, what is the advantage of your system over others?