EntitiesDb
A high-performance, cache-efficient Entity Component System (ECS) for C#. Features chunk-based storage, fast queries, source-generated iteration, multithreading, SIMD support, and zero external dependencies.
Install / Use
/learn @Juiix/EntitiesDbREADME
A High-Performance, Lightweight C# Entity Component System
A modern, cache-efficient Entity Component System (ECS) designed for games, simulations, and other data-oriented workloads. EntitiesDb focuses on raw performance, simple APIs, and zero external dependencies — all within pure C#.
- 🚀 Fast — Chunk-based, archetype-organized storage with SIMD-friendly handles
- 🧩 Simple — Define any type as a component and query with expressive filters
- 🧵 Parallel-Ready — Built-in multithreaded query execution and reduction
- 0️⃣ GC-Friendly — Minimal allocations, predictable memory layout
- 📚 Documentation — API reference and guides in DOCS.md
Features
- Archetypes with cache-efficient chunking
- Any type as a component
- Component buffers for unmanaged types
- High-performance component queries
- Command buffers
- Multithreaded queries
- Manual archetype/chunk enumeration
- Source generated delegate queries
- Chunk change filters
- SIMD-friendly
Quick Start
using EntitiesDb;
// Define components
public record struct Position(float X, float Y);
public record struct Velocity(float Dx, float Dy);
public record struct Health(int Points, int Max);
// Create database
using var db = new EntityDatabase();
// Create an entity
var player = db.Create(
new Position(10, 10),
new Velocity(5, 5),
new Health(100, 100)
);
// Build a query
var query = db.QueryBuilder
.WithAll<Position, Velocity>()
.Build();
// Update all matching entities
query.ForEach((ref Position pos, in Velocity vel) =>
{
pos.X += vel.Dx;
pos.Y += vel.Dy;
});
Installation
Install via NuGet:
Package Manager
Install-Package EntitiesDb
.NET CLI
dotnet add package EntitiesDb
Package Reference
<ItemGroup>
<PackageReference Include="EntitiesDb" Version="*" />
</ItemGroup>
Documentation
Looking for the full API, examples, and advanced usage?
📚 Docs: DOCS.md
🧩 Includes: components, queries, buffers, tags, multithreading, SIMD, and more.
License
MIT License. Feel free to use EntitiesDb in commercial or open-source projects.
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
