r/EntityComponentSystem • u/ajmmertens • Jul 19 '23
A Roadmap to implementing Entity Relationships
r/EntityComponentSystem • u/ajmmertens • Jul 19 '23
r/EntityComponentSystem • u/sebasjammer • Apr 01 '23
if you are bored this weekend, check this out:
https://www.sebaslab.com/svelto-ecs-3-4-internals-how-to-integrate-computesharp/
We know ECS is SIMD and Multithreading friendly, but did you know you could use it to run C# code on the GPU through compute shaders? Now we can with ComputeSharp and Svelto.ECS.
Have fun with the demo included.
r/EntityComponentSystem • u/sebasjammer • Mar 16 '23
Svelto.ECS 3.4 is out, the main feature is the update of Svelto-On-DOTS to DOTS ECS 1.0.
And here my article on the topic with my early DOTS ECS 1.0 impressions:
https://www.sebaslab.com/svelto-ecs-3-4-svelto-on-dots-ecs-update/
r/EntityComponentSystem • u/jumpixel • May 01 '22
r/EntityComponentSystem • u/Chilluminatler • Feb 26 '22
r/EntityComponentSystem • u/skypjack • Oct 09 '21
r/EntityComponentSystem • u/ajmmertens • Jul 07 '20
r/EntityComponentSystem • u/Crystallo07 • Jul 14 '25
Hi everyone,
I’ve been studying ECS architectures, and something doesn’t quite add up for me in practice.
Let’s say an entity has 10 components. According to archetype-based ECS, this exact set of components defines a unique archetype, and the entity is stored in a chunk accordingly. So far, so good.
But in real-world systems, you rarely need all 10 components at once. For example:
•A MovementSystem might only require Position and Velocity.
•An AttackSystem might need Position and AttackCooldown.
•A RenderSystem might just want Position and Mesh.
This means that the entity will belong to one archetype, but many systems will access only subsets of its data. Also, different archetypes can share common components, which means systems have to scan across multiple archetypes even when querying for a single component.
So here's where my confusion comes in:
•Isn’t the archetype system wasting memory bandwidth and CPU cache by grouping entities based on their full component set, when most systems operate on smaller subsets?
•Doesn’t this fragmentation lead to systems having to scan through many archetypes just to process a few components?
•Doesn’t this break the very idea of cache-friendly, contiguous memory access?
Am I misunderstanding how archetype ECS is supposed to work efficiently in practice? Any insights or real-world experiences would be super helpful. Thanks!
r/EntityComponentSystem • u/timschwartz • Nov 30 '24
r/EntityComponentSystem • u/FrisoFlo • Jul 11 '24
Repository on GitHub
ECS.CSharp.Benchmark - Common use-cases
The Motivation of this benchmark project
Compare performance of common uses cases of multiple C# ECS projects.
Utilize common ECS operations of a specific ECS project in most simple & performant way. This make this benchmarks applicable to support migration from one ECS to another.
Contributions are welcome!
r/EntityComponentSystem • u/ajmmertens • Oct 16 '22
r/EntityComponentSystem • u/UnfairSpinach1985 • Mar 28 '22
Let's say I have an ECS with physics and I want to kill the player when a arrow hit him. So I have a callback when there is a collision. Now there is of course different behaviour with different collisions with 2 bodies (heal with heart, damage with weapon, etc...) so plenty of combinations of collisions.
I would think in ECS I will check the components each body has and call the appropriate behaviour, but of course the more behaviours I have the more it will cost, because each combination should be checked for each collision.
More generally, don't ECS add more cost when there is more behaviour ? In traditional way, no matter how many different bhaviours you have, you will always pay only one method call.
r/EntityComponentSystem • u/skypjack • Aug 02 '20
r/EntityComponentSystem • u/timschwartz • Jan 09 '26
r/EntityComponentSystem • u/FrisoFlo • Jul 08 '24
Just released Friflo.Engine.ECS v3.0.0-preview.2
New Features:
Entity Relationships - Enable links between entities. 1 to 1 and 1 to many
Relations - Enable adding multiple components of same component type to an entity
Full-text Search - Support searching component fields with a specific value in O(1)
Documentation of new features at GitHub Friflo.Engine.ECS ⋅ Component Types
Some use cases for these features in game development are
Attack systems
Path finding, Route tracing or Routing
Model social networks. E.g friendship, alliances or rivalries
Inventory Systems
Build any type of a directed graph.
Feedback welcome!
r/EntityComponentSystem • u/mlange-42 • Feb 20 '23
Arche is an archetype-based ECS for Go: https://github.com/mlange-42/arche
Over the past 2 weeks, I developed Arche due to a lack of fast and mature ECS implementations in Go. It is primarily designed for building (individual-based) simulation models rather than games.
Arche's features:
Simple core API. See the API docs.
Optional rich filtering and generic query API.
Fast iteration and component access via queries (≈2.5ns iterate + get).
Fast random access for components of arbitrary entities. Useful for hierarchies.
No systems. Just queries. Use your own structure!
Not thread-safe. On purpose.
No dependencies. Except for unit tests (100% coverage).
Your feedback is highly appreciated!
I would like to thank u/skypjack and u/ajmmertens, the authors of EnTT and Flecs, resp., for their blog post series that were very helpful during the implementation.
r/EntityComponentSystem • u/thejaguar83 • Oct 25 '22
r/EntityComponentSystem • u/ajmmertens • Jun 04 '22
r/EntityComponentSystem • u/GasimGasimzada • Apr 30 '22
I am starting to think that either ECS does not make sense in game development or I am misunderstanding something very fundamental about ECS.
I really like the concept behind ECS, especially if I have the centralized container that stores all the components in nice, cache friendly sparse sets. If I need a new component, I just create a structure and set it in the entity storage and everything works well. No hierarchy, no gigantic data structures. Good separation of concerns as well.
However, my problem starts when dealing with the "System" part of ECS. At this point, I have the following systems in my application -- Scene Updater (for parent-child transforms), Physics system, Rendering, Scripting.
Except for scripting, every other system needs some kind of synchronization and internal data representation:
Scene updater: Need to store the hierarchy to be able to update the entities
Physics system: Need to synchronize transforms with the Physics (I am using a 3rd party physics system; so, this is understandable)
Rendering: Need to store all the transforms in buffers and pass them to the GPU. The entire system only has one point of contact with the entities -- creating buffers. Everything else is internal data structures and storages.
If every system synchronizes the entity data with internal structures, what's the point of the ECS in the first place?
r/EntityComponentSystem • u/skypjack • Aug 29 '21
r/EntityComponentSystem • u/skypjack • Apr 02 '21
r/EntityComponentSystem • u/corysama • Dec 29 '20
r/EntityComponentSystem • u/timschwartz • Dec 27 '20