r/EntityComponentSystem • • Jul 03 '20

ECS (entt) based flocking behaviour

Thumbnail
youtube.com
7 Upvotes

r/EntityComponentSystem • • May 17 '20

Entity Memory Contiguity: A Tale About Simplicity

Thumbnail ryanfleury.net
7 Upvotes

r/EntityComponentSystem • • May 09 '20

EnTT v3.4.0 is out: Gaming meets Modern C++

Thumbnail self.gamedev
7 Upvotes

r/EntityComponentSystem • • Mar 14 '20

ECS back and forth, part 8: Type Id

Thumbnail
skypjack.github.io
7 Upvotes

r/EntityComponentSystem • • Jul 08 '19

I have written a tutorial on the entity-component-system I am developing for my game

Thumbnail
pvigier.github.io
7 Upvotes

r/EntityComponentSystem • • Aug 29 '26

I just published the source for 4 (browser playable) ECS example games!

Thumbnail gallery
6 Upvotes

r/EntityComponentSystem • • May 21 '23

Dominion ECS - the Release Candidate is out

Thumbnail self.java
6 Upvotes

r/EntityComponentSystem • • Feb 12 '23

ECS: Methods on components versus putting everything into systems

Thumbnail self.gameenginedevs
6 Upvotes

r/EntityComponentSystem • • Jun 12 '22

I think I'm missing the point of ECS

Thumbnail self.gameenginedevs
6 Upvotes

r/EntityComponentSystem • • Jun 04 '22

Handling state of referenced entites in an ECS

Thumbnail self.gamedev
6 Upvotes

r/EntityComponentSystem • • Jan 25 '22

Edict v0.0.5 experimental ECS with refcounted entities

Thumbnail self.rust_gamedev
6 Upvotes

r/EntityComponentSystem • • Dec 27 '21

Using ECS, who is responsible to create new Entities?

6 Upvotes

I'm creating RTS. Units can attack: shoot bullets. Do i need BulletSpawnSystem?

How it should do spawn new bullet entities? Events from AttackSystem?

And where to store array of bullets? Common / global entity list?


r/EntityComponentSystem • • Dec 01 '21

OO encapsulation of Components inside Systems

6 Upvotes

Typical ECS engine: holds all Components together in the singleton World storage. The singleton Engine provides interface to add or remove components. It also provides Systems with some query functions that allows iterate through the subset of World's Entities with only System's necessary components.

But why we want to add or remove orphan Components? We usually change, add or remove Entities and their specific Components from the Systems and typically only inside those Systems.

If we privately keep the Components needed for the given System inside this System we resolve many problems and can optimise data layout for the custom usage.

In the case several Systems need some shared Component we can use old singleton World approach only for this Component, nothing to win or lose. But in my limited experience this shared case is not that common.


r/EntityComponentSystem • • Aug 07 '21

Fundamental ECS design choice

Thumbnail self.roguelikedev
6 Upvotes

r/EntityComponentSystem • • Jun 15 '21

Understanding ENTT/ECS and cache

Thumbnail self.gamedev
6 Upvotes

r/EntityComponentSystem • • May 31 '21

Tile Map with ECS: Should I have an entity per tile?

Thumbnail self.gamedev
6 Upvotes

r/EntityComponentSystem • • Nov 13 '20

Confused by ECS

6 Upvotes

I think I must be missing something big about entity component systems, because I have never been happy with anything I have written.

For example, I do not understand how to properly implement damage in an ECS. Clearly, I can't let every system that wants to damage something handle all the damage logic, because that logic could grow to be pretty rich.

At the same time, I don't think it makes sense to have a "Damage" system that response to "I want to damage something" messages. That seems like a huge performance killer, and what if the consumer needs to know if the damage failed? Do I want several ticks to find out? It just seems dirty.

The closest I came to writing something useful is creating an event system the systems can participate in. Like... DamageEvent : SystemEvent<DamageArgs>. Then other systems can trigger the logic there when they want to damage something, and other systems can register to intercept or modify the damage request. For example, a system could call damageEvent.TryTrigger(args) when it wants to damage, easily get back success/failure, along with any modifications made to the args by other systems. The biggest drawbacks here are potential complexity and getting in the way of concurrency, and I guess to me it still feels like a big departure from the simplicity of ECS.

Is there a fourth component to ECS to handle stuff like this? Am I just missing something super simple?


r/EntityComponentSystem • • Jul 23 '20

Doing a lot with a little: ECS identifiers

Thumbnail
medium.com
6 Upvotes

r/EntityComponentSystem • • Mar 29 '20

New to ECS, am I doing it correctly?

6 Upvotes

Hey, so I am quite new to ECS and to learn it I made my own system for it. I got it working quite well but now that the system is up and I want to make a game with it, I came across some logic issues.

I have a space ship which moves with a certain speed / curve over a delta between 2 points. I have 3 components:

  • Movement (Holds Curve and Speed)

  • Targeting (Where targets get registered)

  • Timelines (Where different time lines get registered and progressed)

These 2 Systems in place:

  • ClickTargetingSystem (Adds targets to `Targeting*` component holders)* [only if they have the right feature tag `ClickTargeting`]

  • MoveToTargetSystem (Uses the Movement and Targeting comps to determine the movement, and uses Timelines on each of those entities to track where they are on the movement track) [only if they have the feature tag `MovementToTarget`]

What I wonder is the following. I have made the Timelines component initially to hold data which I wanted to put inside `MoveToTargetSystem`, but made the component because systems can't have values. But for the sake of more systems to come, I made it so the Timeline has a Dictionary (key -> value pair logic) to find a Timeline with a given ID. And the `MoveToTargetSystem` just makes a `MovementID` timeline and removes it as it is finished.

I just want to hear opinions / confirmations whether I am going the right or wrong direction. And how you were to solve this type of movement (moving over a track over time, not with physics yada yada)

Thank you in advance, and please ask for more info if things are not clear.

Edit:
The Timeline and Targeting components simply store the same values in different hash layers, so multiple systems can use 1 component on an entity to store their own values. This is what I wonder should be done differently. And if so, how..


r/EntityComponentSystem • • Nov 19 '19

ECS back and forth, part 6: Nested Groups

Thumbnail
skypjack.github.io
6 Upvotes

r/EntityComponentSystem • • Sep 28 '19

Replicating Polymorphism in ECS

Thumbnail
coffeebraingames.wordpress.com
6 Upvotes

r/EntityComponentSystem • • Oct 23 '18

EnTT: Gaming meets modern C++

6 Upvotes

Hi all,

I didn't know of this community, but it looks like users could be interested in a project of mine: EnTT.
It started as a fast and reliable ECS in modern C++ and after a year it got used also by Mojang in Minecraft.

Nowadays, the library offers more things than the sole ECS. As an example, support for signals, a reflection system, minmal support for resource management and so on.
Everything is designed as a header-only library and all parts are almost independent from the other ones. It means that users can freely use the ECS stuff while getting rid of the reflection system and everything will work like a charm anyway.

EnTT is under active development and more and more features will be added in future.
Suggestions and feedback would be really appreciated. There exists also a gitter channel you can join to discuss the project and make questions to other users.

Here is the original post for the announcement made on /r/gamedev a while ago.


r/EntityComponentSystem • • May 06 '26

How should a game use ECS?

5 Upvotes

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:

  1. Settings like screen resolution?

  2. Current view height or cursor position?

  3. Map, Chunks and Tiles (that confuses me the most)?

  4. 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 • • Jan 08 '25

Comparative benchmarks for Go ECS implementations

Thumbnail
github.com
5 Upvotes