|
16 | 16 |
|
17 | 17 | </div> |
18 | 18 |
|
19 | | -# Friflo.Engine.ECS |
| 19 | +# friflo ECS |
20 | 20 |
|
21 | | -***The ECS for finishers 🏁*** |
22 | | -Leading performance in most ECS aspects. |
23 | | -Performance Ratio - see [C# ECS Benchmark](https://github.com/friflo/ECS.CSharp.Benchmark-common-use-cases) |
| 21 | +Friflo ECS is a high performance C# ECS with focus on simplicity and reliability. |
| 22 | +The library is designed for easy integration and a smooth developer experience. |
| 23 | +Among various C# ECS projects, it is currently the only one fully implemented in Managed C#. |
| 24 | +By this no use of `unsafe` code preventing crashes due to memory corruption. |
24 | 25 |
|
25 | | -| | friflo | Flecs.NET | TinyEcs | Arch | fennecs | Leopotam | DefaultEcs | Morpeh | |
26 | | -| ------- | ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| |
27 | | -| *Ratio* | 1.00 | 2.55 | 3.42 | 6.96 | 19.02 | 2.57 | 3.81 | 21.09 | |
28 | | -| *Notes* | | | | | | [^sparse] | [^sparse] | [^sparse] | |
29 | | - |
30 | | -[^sparse]: Sparse Set based ECS projects. |
31 | | - |
32 | | -## News |
33 | | - |
34 | | -- [x]  features in v3.0.0 |
35 | | - Introduced: **Index / Search** with O(1), **Relationships** 1:1 and 1:many and **Relations**. See [New features in 3.0.0](#new-features-in-300) |
36 | | - |
37 | | -- [x] Published [Friflo.Engine.ECS.Boost](https://www.nuget.org/packages/Friflo.Engine.ECS.Boost) to enable |
38 | | - [boosted queries](https://friflo.gitbook.io/friflo.engine.ecs/documentation/query-optimization#boosted-query) with maximum performance. |
39 | | - |
40 | | -- [x] New GitHub benchmark repository [ECS.CSharp.Benchmark - Common use-cases](https://github.com/friflo/ECS.CSharp.Benchmark-common-use-cases) |
41 | | - |
42 | | -## Contents |
43 | | - |
44 | | -* [🔥 Friflo.Engine.ECS](#frifloengineecs) |
45 | | - - [Documentation](#documentation) |
46 | | - - [Feature highlights](#feature-highlights) |
47 | | - - [Projects using friflo ECS](#projects-using-friflo-ecs) |
48 | | - - [Demos](#demos) |
49 | | - - [ECS definition](#ecs-definition) |
50 | | - - [New features in 3.0.0](#new-features-in-300) |
51 | | -* [⏩ Examples](#-examples) |
52 | | - - [🚀 Hello World](#-hello-world) |
53 | | - - [⚙️ Systems](#️-systems) |
54 | | -* [🏁 Benchmarks](#-ecs-benchmarks) |
55 | | - |
56 | | - |
57 | | -## Documentation |
58 | | - |
59 | | -Get an overview of the feature set or explore various use-cases with examples at |
60 | | -[**friflo ECS · Docs**](https://friflo.gitbook.io/friflo.engine.ecs). |
| 26 | +<details> |
| 27 | +<summary>What is ECS - Entity Component System?</summary> |
| 28 | +An ECS is a software architecture pattern. See [ECS ⋅ Wikipedia](https://en.wikipedia.org/wiki/Entity_component_system). |
| 29 | +It is often used in the Gaming industry - e.g. Minecraft - and used for high performant data processing. |
| 30 | +An ECS provide two strengths: |
61 | 31 |
|
| 32 | +1. It enables writing *highly decoupled code*. Data is stored in **Components** which are assigned to objects - aka **Entities** - at runtime. |
| 33 | + Code decoupling is accomplished by dividing implementation in pure data structures (**Component types**) - and code (**Systems**) to process them. |
| 34 | + |
| 35 | +2. It enables *high performant system execution* by storing components in continuous memory to leverage CPU caches L1, L2 & L3. |
| 36 | + It improves CPU branch prediction by minimizing conditional branches when processing components in tight loops. |
| 37 | +</details> |
62 | 38 |
|
63 | | -## Feature highlights |
64 | 39 |
|
65 | | -- [x] Simple API - no boilerplate, rock-solid 🗿 and bulletproof 🛡️ |
66 | | -- [x] High-performance 🔥 compact ECS |
67 | | -- [x] Low memory footprint 👣. Create 100.000.000 entities in 1.5 sec |
68 | | -- [x] Zero ⦰ allocations after buffers are large enough. No struct boxing |
69 | | -- [x] High performant / type-safe queries ⊆ |
70 | | -- [x] Efficient multithreaded queries ⇶ |
71 | | -- [x] Entity component Search in O(1) ∈ |
72 | | -- [x] Fast batch / bulk operations ⏩ |
73 | | -- [x] Command buffers / deferred operations ⏭️ |
74 | | -- [x] Entity relationships and relations ⌘ |
75 | | -- [x] Entity hierarchy / tree ⪪ |
76 | | -- [x] Fully reactive / entity events ⚡ |
77 | | -- [x] Systems / System groups ⚙️ |
78 | | -- [x] JSON Serialization 💿 |
79 | | -- [x] SIMD Support 🧮 |
80 | | -- [x] Supports .NET Standard 2.1 .NET 5 .NET 6 .NET 7 .NET 8 |
81 | | - WASM / WebAssembly, Unity (Mono, AOT/IL2CPP, WebGL), Godot, MonoGame, ... and Native AOT |
| 40 | +### Highlights |
| 41 | +* 🔥 **Top Performance** - C/C++/Rust speed and memory efficiency. Various benchmarks below. |
| 42 | +* 🧩 **Bare Essentials** - Provide only ECS core concepts: components, tags, relations and systems. Thats it! |
| 43 | +* 🎯 **Simple** - Clean & Simple API. No boilerplate. Check the [Documentation](https://friflo.gitbook.io/friflo.engine.ecs) with many examples. |
| 44 | +* 🛡️ **Reliable** - Built for production. Fully Managed C# - No unsafe code. High test coverage. |
| 45 | +* 🙏 **Community** - Helpful and welcoming support on [Discord](https://discord.gg/nFfrhgQkb8) and Github. |
| 46 | + |
| 47 | + |
| 48 | +## Features |
| 49 | + |
| 50 | +- [x] High performant / type-safe queries |
| 51 | +- [x] Efficient multithreaded queries |
| 52 | +- [x] Fast batch / bulk operations |
| 53 | +- [x] Command buffers *aka* deferred operations |
| 54 | +- [x] Entity hierarchy *aka* scene tree |
| 55 | +- [x] Relationships and relations |
| 56 | +- [x] Component Search in O(1) |
| 57 | +- [x] Entity / component events |
| 58 | +- [x] Allocation free enumerators |
| 59 | +- [x] Systems and groups |
| 60 | +- [x] JSON Serialization |
| 61 | +- [x] SIMD Support |
| 62 | +- [x] Type-safe Add/Remove/Get component. No potential memory corruption like in Arch. |
| 63 | +- [x] Single library. No exclusion of feature combinations such as events, assertions or debug/release. |
| 64 | +- [x] Zero allocations after buffers are large enough. |
| 65 | +- [x] Automatic component type registration |
| 66 | +- [x] Supports .NET Standard 2.1 .NET 5 .NET 6 .NET 7 .NET 8 .NET 9 .NET 10 |
| 67 | + WASM / WebAssembly, Unity (Mono, AOT/IL2CPP, WebGL), Godot, MonoGame |
| 68 | +- [x] Native AOT |
82 | 69 | - [x] CLS Compliant API - supporting all .NET languages: C#, F#, VB.NET, ... |
83 | | -- [x] Debug Tools 🐞: Watch entities, components, tags, relations, query results, systems, ... |
| 70 | +- [x] Debug Tools: Watch entities, components, tags, relations, query results, systems, ... |
84 | 71 | <details> |
85 | 72 | <summary>Screenshot - Watch ad-hoc query result in debugger</summary> |
86 | 73 | <img src="docs/images/watch-query-result-set.png" width="656" height="202"/> |
87 | 74 | </details> |
88 | | -- [x] **100%** verifiably safe 🔒 C#. No [*unsafe code*](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code), |
| 75 | +- [x] Fully Managed C#. No [*unsafe code*](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code), |
89 | 76 | *native dll bindings* and *access violations*. |
90 | 77 | <details> |
91 | 78 | <summary>Behavior of access violation bugs using unsafe code</summary> |
@@ -157,19 +144,6 @@ Demo projects on GitHub below. |
157 | 144 | All example Demos - **Windows**, **macOS** & **Linux** - available as projects for **MonoGame**, **Unity** and **Godot**. |
158 | 145 | See [Demos · GitHub](https://github.com/friflo/Friflo.Engine.ECS-Demos) |
159 | 146 |
|
160 | | - |
161 | | -## ECS definition |
162 | | - |
163 | | -An entity-component-system (**ECS**) is a software architecture pattern. See [ECS ⋅ Wikipedia](https://en.wikipedia.org/wiki/Entity_component_system). |
164 | | -It is often used in the Gaming industry - e.g. Minecraft - and used for high performant data processing. |
165 | | -An ECS provide two strengths: |
166 | | - |
167 | | -1. It enables writing *highly decoupled code*. Data is stored in **Components** which are assigned to objects - aka **Entities** - at runtime. |
168 | | - Code decoupling is accomplished by dividing implementation in pure data structures (**Component types**) - and code (**Systems**) to process them. |
169 | | - |
170 | | -2. It enables *high performant system execution* by storing components in continuous memory to leverage CPU caches L1, L2 & L3. |
171 | | - It improves CPU branch prediction by minimizing conditional branches when processing components in tight loops. |
172 | | - |
173 | 147 | <br/> |
174 | 148 |
|
175 | 149 |
|
@@ -199,7 +173,7 @@ for the challenge to improve the feature set and performance of this project! |
199 | 173 | # ⏩ Examples |
200 | 174 |
|
201 | 175 | This section contains two typical use cases when using an ECS. |
202 | | -More examples describing use of various features are in the [friflo ECS - Documentation](https://friflo.gitbook.io/friflo.engine.ecs). |
| 176 | +More examples describing use of various features are at [friflo ECS - Documentation](https://friflo.gitbook.io/friflo.engine.ecs). |
203 | 177 |
|
204 | 178 |
|
205 | 179 | ## **🚀 Hello World** |
@@ -375,6 +349,11 @@ It compares the performance of multiple ECS projects with **simple** benchmarks. |
375 | 349 | So they can be used as a **guide to migrate** form one ECS to another. |
376 | 350 | See discussion of [reddit announcement Post](https://www.reddit.com/r/EntityComponentSystem/comments/1e0qo62/just_published_new_github_repo_ecs_c_benchmark/). |
377 | 351 |
|
| 352 | +**Performance Ratio Overview - see [C# ECS Benchmark](https://github.com/friflo/ECS.CSharp.Benchmark-common-use-cases)** |
| 353 | + |
| 354 | +| | friflo | Flecs.NET | TinyEcs | Arch | fennecs | Leopotam | DefaultEcs | Morpeh | |
| 355 | +| ------- | ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| ----------:| |
| 356 | +| *Ratio* | 1.00 | 2.55 | 3.42 | 6.96 | 19.02 | 2.57 | 3.81 | 21.09 | |
378 | 357 |
|
379 | 358 | ## ECS.CSharp.Benchmark |
380 | 359 |
|
|
0 commit comments