{"id":21233526,"url":"https://github.com/friflo/ecs-wiki","last_synced_at":"2025-07-10T17:31:40.424Z","repository":{"id":249996918,"uuid":"833172623","full_name":"friflo/ECS-wiki","owner":"friflo","description":"C# Documentation: friflo ECS","archived":false,"fork":false,"pushed_at":"2025-06-18T08:04:55.000Z","size":827,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T09:20:55.644Z","etag":null,"topics":["csharp","data-oriented-design","ecs","ecs-framework","entity-component-system","wiki"],"latest_commit_sha":null,"homepage":"https://friflo.gitbook.io/friflo.engine.ecs","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friflo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-24T13:51:00.000Z","updated_at":"2025-06-18T08:04:58.000Z","dependencies_parsed_at":"2024-07-24T16:33:37.051Z","dependency_job_id":"46966a84-1c47-4880-b88b-fed3bd1a08a3","html_url":"https://github.com/friflo/ECS-wiki","commit_stats":null,"previous_names":["friflo/ecs-wiki"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/friflo/ECS-wiki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friflo%2FECS-wiki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friflo%2FECS-wiki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friflo%2FECS-wiki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friflo%2FECS-wiki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friflo","download_url":"https://codeload.github.com/friflo/ECS-wiki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friflo%2FECS-wiki/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264619049,"owners_count":23638397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","data-oriented-design","ecs","ecs-framework","entity-component-system","wiki"],"created_at":"2024-11-20T23:59:15.552Z","updated_at":"2025-07-10T17:31:40.412Z","avatar_url":"https://github.com/friflo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![friflo ECS](images/friflo-ECS.svg)](https://github.com/friflo/Friflo.Engine.ECS)\n\n[![Github Repo](images/github-mark.svg)](https://github.com/friflo/Friflo.Engine.ECS)\n[![Github Repo](https://img.shields.io/badge/GitHub-grey)](https://github.com/friflo/Friflo.Engine.ECS)\n[![Demos](https://img.shields.io/badge/Demos-22aa22)](https://github.com/friflo/Friflo.Engine.ECS-Demos)\n[![C# API](https://img.shields.io/badge/C%23%20API-22aaaa)](https://github.com/friflo/Friflo.Engine-docs)\n[![Discord](https://img.shields.io/badge/Discord-5865F2)](https://discord.gg/nFfrhgQkb8)   \n[![Benchmarks](https://img.shields.io/badge/Benchmark%20🏁%20of%20C%23%20ECS%20frameworks-ffffff)](https://github.com/friflo/ECS.CSharp.Benchmark-common-use-cases)\n\n\n\n**friflo ECS**, a small and high-performance **C# ECS** - Entity Component System.  \nIts an archetype based ECS with focus on performance and simplicity.\n\n\u003cdetails\u003e\n\u003csummary\u003e🛈 What is an Entity Component System?\u003c/summary\u003e\n\nAn Entity Component System (**ECS**) is a software architecture pattern. [Wikipedia](https://en.wikipedia.org/wiki/Entity_component_system).  \nIt is often used in software development for **Games**, **Simulation**, **Analytics** and **In-Memory Database** providing high performant data processing.\n\nAn ECS has two major strengths:\n\n1. It enables writing **highly decoupled code**. Data is stored in **Components** which are assigned to objects - aka **Entities** - at runtime.  \n   Code decoupling is accomplished by dividing implementation in pure data structures (**Component types**) - and code (**Systems**) to process them.  \n  \n2. It provides **high performant query execution** by storing components in continuous memory to leverage L1 CPU cache and its prefetcher.  \n   It improves CPU branch prediction by minimizing conditional branches when processing components in tight loops. \n   [Data-oriented design ⋅ Wikipedia](https://en.wikipedia.org/wiki/Data-oriented_design).\n\u003c/details\u003e\n\n## Design goals\n\n\u003cdetails\u003e\n\u003csummary\u003e🔥 \u003cstrong\u003eHigh Performance\u003c/strong\u003e\u003c/summary\u003e\nOptimal and efficient query / system execution.\u003cbr/\u003e\nFast entity creation and component changes.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🎯 \u003cstrong\u003eSimple\u003c/strong\u003e\u003c/summary\u003e\nSimple API - convenient to debug.\u003cbr/\u003e\nNo boilerplate code.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🔄 \u003cstrong\u003eLow memory footprint\u003c/strong\u003e\u003c/summary\u003e\nMinimal heap allocations at start phase.\u003cbr/\u003e\nNo heap allocations after internal buffers grown large enough.\u003cbr/\u003e\nNo GC pauses / no frame drops.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🛡️ \u003cstrong\u003eReliable\u003c/strong\u003e\u003c/summary\u003e\n100% verifiably \u003cstrong\u003esafe C#\u003c/strong\u003e. No \u003cstrong\u003eunsafe\u003c/strong\u003e code or native bindings.\u003cbr/\u003e\nFull test coverage. Expressive runtime errors. Actively maintained.\u003cbr/\u003e\nYour code requires no \u003cstrong\u003eUnsafe\u003c/strong\u003e quirks for maximum performance.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e🤏 \u003cstrong\u003eSmall\u003c/strong\u003e\u003c/summary\u003e\nFriflo.Engine.ECS.dll size: only 320 kb.  \u003cbr/\u003e\nNo code generation. No 3rd party dependencies.\n\u003c/details\u003e\n\n\n# Overview\n\nA common ECS provide the basic features listed bellow.  \nTo solve other common use-cases not covered by basic implementations this ECS provide the listed extensions.\n\n## Basic features\n\n\u003e An ECS acts like an in-memory database and stores entities in an [EntityStore](docs/entity.md#entitystore) aka *World*.  \n\u003e An [Entity](docs/entity.md) is a value type - aka `struct` - with a unique `Id`.\n\n\u003e Data is stored in [Components](docs/entity.md#component) added to entities.  \n\u003e Components are stored highly packed in continuous memory.\n\n\u003e The major strength of an archetype based ECS is efficient and performant [Query](docs/query.md) execution.  \n\u003e [Query filters](docs/query.md#query-filter) are used to reduce the amount of components returned by the query result.\n\n\n## Extended features\n\n\u003e Support [Events](docs/events.md) to subscribe entity changes like adding or removing components.  \n\u003e Event handlers can be added to a single `Entity` or the entire `EntityStore`.\n\n\u003e [Index / Search](docs/component-index.md) to enable lookup entities with specific component values. **v3.0.0**  \n\u003e A lookup for a specific component value - aka search - executes in **O(1)** ~ 4 ns.  \n\u003e *Possibly the first and only ECS that supports indexing.*\n\n\u003e [Relationships](docs/relationships.md) to create links between entities. **v3.0.0**  \n\u003e A link is directed and bidirectional. Deleting *source* or *target* entity removes a link.\n\n\u003e [Relations](docs/relations.md) to add multiple *\"components\"* to an entity. **v3.0.0**  \n\u003e Relations are not implemented as components to avoid *archetype fragmentation*.\n\n\u003e [Systems](docs/systems.md) are optional. They are used to group queries or custom operations.  \n\u003e They support logging / monitoring of execution times and memory allocations in realtime.\n\n\u003e [Hierarchy / Scene tree](docs/entity.md#hierarchy) used to setup a child/parent relationship between entities.  \n\u003e An entity in the hierarchy provide direct access to its children and parent.\n\n\u003e [JSON Serialization](docs/entity.md#json-serialization) to serialize entities or the entire EntityStore as JSON.\n\n\n## Library\n\n\u003e 100% verifiably safe 🔒 C#. No [*unsafe code*](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code)\n\u003e or native bindings.  \n\u003e This prevents *segmentation faults* or *access violations* crashing a process instantaneously.\n\n\u003e Minimal heap allocations.  \n\u003e After internal buffers grown large enough no heap allocation will occur.  \n\u003e At this point no garbage collection will be executed. This avoids frame stuttering / lagging caused by GC runs.  \n\u003e Especially no allocation when\n\u003e - Creating or deleting entities\n\u003e - Adding or removing components / tags\n\u003e - Adding or removing relations or relationships\n\u003e - Emitting events\n\u003e - Changes in entity hierarchy\n\u003e - Query or system execution\n\n\u003e Aims for 100% test coverage:  \n\u003e Code coverage: [![codecov](https://img.shields.io/codecov/c/gh/friflo/Friflo.Engine.ECS?logoColor=white\u0026label=codecov)](https://app.codecov.io/gh/friflo/Friflo.Engine.ECS/tree/main/src/ECS)\n\n\u003cbr\u003e\n\n\n# Project\n\n[Release Notes](package/Release-Notes.md) - document all nuget releases.\n\n[Library](package/Library.md) describes assembly specific characteristics.\n\n[Unity Extension](extensions/Unity-extension.md) with ECS integration in Unity Editor.\n\n\n## External Links\n\nGitHub: [https://github.com/friflo/Friflo.Engine.ECS](https://github.com/friflo/Friflo.Engine.ECS)\n\nDiscord: [friflo ECS](https://discord.gg/nFfrhgQkb8)\n\nBenchmark: [C# ECS Benchmarks](https://github.com/friflo/ECS.CSharp.Benchmark-common-use-cases)\n\n\u003cbr/\u003e\n\n\n## GitHub\n\n[![Star History Chart](https://api.star-history.com/svg?repos=friflo/Friflo.Engine.ECS)](https://github.com/friflo/Friflo.Engine.ECS)\n\n💖 In case you like this project?  \nLeave a ⭐ on [GitHub ⋅ friflo/Friflo.Engine.ECS](https://github.com/friflo/Friflo.Engine.ECS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriflo%2Fecs-wiki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriflo%2Fecs-wiki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriflo%2Fecs-wiki/lists"}