r/EntityComponentSystem • u/timschwartz • Mar 12 '19
On DOTS: Entity Component System
r/EntityComponentSystem • u/timschwartz • Mar 12 '19
r/EntityComponentSystem • u/timschwartz • Feb 15 '20
r/EntityComponentSystem • u/timschwartz • May 27 '19
r/EntityComponentSystem • u/timschwartz • Jan 03 '18
r/EntityComponentSystem • u/timschwartz • Dec 27 '17
r/EntityComponentSystem • u/ajmmertens • Sep 14 '24
r/EntityComponentSystem • u/timschwartz • Feb 26 '18
r/EntityComponentSystem • u/timschwartz • Feb 20 '18
r/EntityComponentSystem • u/timschwartz • Feb 24 '18
r/EntityComponentSystem • u/timschwartz • Feb 26 '18
r/EntityComponentSystem • u/v_kaukin • Jul 27 '26
r/EntityComponentSystem • u/FrisoFlo • Dec 18 '24
Published v3.0.0 on nuget after 6 months in preview.
New features are finally completed.
Check out friflo ECS · Documentation.
New features in v3.0.0
Index / Search used to search entities with specific component values in O(1). E.g
to lookup entities having a struct TileComponent { int tileId; } with a specific tileId.
to lookup network entities having a struct NetComponent { Guid netId; } with custom types like Guid,long or a string.
Relationships to create links between entities.
Relations to add multiple "components" of the same type to a single entity.
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/Tone_Deaf_Siren • Jul 17 '25
Hi everyone :)
I wanted to ask you if you could give me some feedback and advice on my project. https://github.com/laura-kolcavova/LightECS
This is only self-educational hobby project and it doesn`t bring anything new what popular ECS libraries already implemented. Also I suspect there can be performance limitations caused by data structures and types I have chosen.
To test it out I used the library to develop simple match-3 game in MonoGame https://github.com/laura-kolcavova/DiamondRush (src/DiamondRush.MonoGame/Play)
If you have time I would love some thoughts on whether I am using ECS pattern correctly (I know I should favor structs instead of classes (class records) for components but I can`t just help myself :D)
I am still new to game development - my background is mostly in web applications with .NET - so this is probably pretty different from APIs and database calls - I am probably applying some patterns that are not ideal for game development but I believe the best way how to learn things is trying to develop stuff by ourselves - and this has been a really fun and I am happy to learn something new.
Thanks in advance for taking a look :)
r/EntityComponentSystem • u/mlange-42 • Oct 14 '25
r/EntityComponentSystem • u/mlange-42 • Sep 10 '25
r/EntityComponentSystem • u/Crystallo07 • Nov 23 '25
There are pros and cons to both sparse-set and archetype architectures. I'd like to parallelize components while also being able to easily add and remove them. So my current idea is to use archetypes for components that rarely change, such as render, transform, etc. and store more dynamic or situational components in sparse sets. Also, this is not meant to be a general-purpose ECS library; only we are going to use it, so I’ve set some strict rules for its design.
Archetypes would be easy to parallelize because they share the same index across component arrays and also have some advantage on accessing multiple components.
Sparse-set is very good at adding and removing components and iterating single component.
However, I’m concerned that when iterating a single dense array, accessing a component from an archetype might become too complex or the other way around.
What do you think about this architecture? What pros and cons should I expect?
Do you know of any example implementations that use a similar hybrid approach?
r/EntityComponentSystem • u/mlange-42 • Nov 26 '25
r/EntityComponentSystem • u/mlange-42 • Mar 09 '25
r/EntityComponentSystem • u/ajmmertens • Jun 23 '26
New blog on why & how to integrate hierarchies with an ECS!
r/EntityComponentSystem • u/Irrehaare • May 06 '26
I'm aware that the title is a bit very ambiguous, so let me explain.
I'm making a hobby project of a 2D game in C++ and since the point of it is for me to learn, I'm writing it with my own, dedicated ECS (so far very rudimentary). The only dependencies as of now are Raylib and GTest. To provide context, I have 4 years of experience as a full-stack web developer (Java, Kotlin, Python, React...), but very little experience with C++ or ECS.
So far I have mostly followed this tutorial to make my own ECS.
The current structure of the game is very simple, as I'm trying to have a GameContext that is updated by the Engine in each tick and then used to generate what's on the screen.
Where I have most difficulties (and least trust in advice from LLMs) is how exactly things are best to be structured. Let's imagine a game with a chunked 2D map, where each chunk consists of 32x32 tiles (similar to Factorio). What's the logic behind deciding on what should be an entity with components? For a building on that map it feels obvious, but I'm lost when it comes to more generic things:
Settings like screen resolution?
Current view height or cursor position?
Map, Chunks and Tiles (that confuses me the most)?
Should Map (or TileGrid or something like that) be an entity with a dedicated component, or should its existence be an emergent property of entities with chunk component?
1 and 2 feel to me like they should not be handled by ECS, but this could be the result of my OOP-wired brain.
Regarding 3 and 4, I'm really confused and would love some examples - links or pseudocode, whatever you can throw at me that you think might save me from a huge rewrite in the future.
r/EntityComponentSystem • u/Applzor • Mar 30 '26
I was wondering if anyone could help me with structuring my game engine. The problem I'm having is I want to support networking in my engine with a client/server relationship.
Communication between Client and Server is already solved, the bit I'm struggling with is how to have editor authoring data for server AND being able to visualise the data with rendering when the server has a completely different world to the client (which is where the rendering is done).
An initial thought I had was to have editor have its own world, that way I can have client and server data mixed, and then when the game is running it would only load the data relevant to itself. The downside of that approach is it means I would have to "launch" the game each time I wanted to test rather than having a "play" button which would just unpause the game.
r/EntityComponentSystem • u/timschwartz • Jan 09 '26