Questions tagged [entity-system]
A programming paradigm in which gameobjects (entities) are composed out of components, and are operated upon by systems. Each entity is an ID that points to specific components.
401 questions
120
votes
10
answers
22k
views
How does entity communication work?
I have two user cases:
How would entity_A send a take-damage message to entity_B?
How ...
1
vote
0
answers
689
views
Why does ROBLOX use an object-oriented system rather than an entity component system? [closed]
I decided I would develop a game engine in c++, so I was thinking about different ways of handling objects. I also have experience with ROBLOX, so I know that it uses an object-oriented design as ...
21
votes
5
answers
5k
views
Improving an O(N^2) function (all entities iterating over all other entities)
A little bit of background, I'm coding an evolution game with a friend in C++, using ENTT for the entity system. Creatures walk around in a 2D map, eat greens or other creatures, reproduce and their ...
3
votes
2
answers
1k
views
How do different compositions/types of entities interact in an ECS-system?
I have a working ECS-system set up, largely inspired by this brilliant article (not at all required reading to be able to answer my question) on https://indiegamedev.net/ showcasing an ECS-system with ...
7
votes
2
answers
2k
views
How "smart objects" are implemented and actually work?
I'm drafting my game and implementing small stuff in it, but hit a roadblock. You see, for my game I would like for different items to behave the same or to share behavior, for instance, some items ...
46
votes
1
answer
11k
views
How are entity systems cache-efficient?
Lately, I've been doing a lot of reading on entity systems to implement in my C++/OpenGL game engine. The two key benefits that I constantly hear lauded about entity systems are
the easy construction ...
34
votes
5
answers
12k
views
How do I implement features in an entity system?
After asking two questions about entity systems (1, 2), and reading some articles on them, I think that I understand them much better than before. I still have some uncertainties, mainly about ...
0
votes
1
answer
137
views
Entity Framework and reactive
In my games using entity framework (for example using https://github.com/libgdx/ashley ) help me to separate data from logic in different systems.
But a problem I've found is how to handle events ...
0
votes
0
answers
1k
views
How to handle various collision effects within an Entity Component System?
Let's say we have three enemies, a bear trap, a fire trap, and a minotaur. When you walk over the bear trap, the game spawns an invisible entity that, upon the player colliding with it, slows the ...
9
votes
2
answers
2k
views
User-friendly scripting when using an ECS?
I am currently creating a small hobby project to get back into game development, and I have decided to structure my entities using an ECS (Entity Component System). This implementation of an ECS is ...
0
votes
0
answers
903
views
Ways to persist entities and components in an ECS?
I am working on a small multiplayer game with rpg elements using java and "Artemis ODB". Most of the logic is already done but one important thing is missing. The persistence.
So i am ...
0
votes
2
answers
3k
views
How to represent a modular FSM for AI using ECS?
I am considering to implement AI using ECS which actually contradicts working with naive FSMs. My current idea is to have multiple components which represent the particular state an Entity that has a <...
9
votes
2
answers
7k
views
ECS: AI components and systems
I'm trying to find the best design pattern for my AI code using an ECS.
Right now the entities that act as CPU-controlled have components like:
WeaponComponent
ChargeComponent
MovementComponent
...
17
votes
3
answers
7k
views
Why is it a bad idea to store methods in Entities and Components? (Along with some other Entity System questions.)
This is a followup to this question, which I answered, but this one tackles with a much more specific subject.
This answer helped me understand Entity Systems even better than the article.
I've read ...
8
votes
1
answer
4k
views
Unity Hybrid ECS with "old way"
Is it possible to use Hybrid ECS with some components and the standard MonoBehaviour with all your old code?
I want to know because I already have some game ...
7
votes
2
answers
15k
views
Event handling in Pure Entity Component Systems, is this approach correct?
I want to ask if the following is an effective way to architect event propagation using an ECS?
Here is a hypothetical collision scenario using an ECS.
Components:
...
27
votes
4
answers
3k
views
What is an appropriate level of granularity for component-based architecture?
I'm working on a game with a component-based architecture. An Entity owns a set of Component instances, each of which has a set ...
12
votes
4
answers
4k
views
Identifying Entity 'Types' in an Entity-Component System
If an Entity has no explicit 'type' (e.g. player) and is simply a collection of components, how do I identify the entities that my systems should and should not be working on? For example, in a game ...
6
votes
2
answers
5k
views
Entity Component System: system and components relation
I'm planning to develop a game in C# (but I don't think that language matters) and I'll be using Entity Component System since I know by design that my game will have a lot of different game items ...
4
votes
2
answers
1k
views
How to implement n-body in an Entity Component System
Recently I've been throwing problems at Entity Component Systems to see how far I can push the paradigm. One problem in particular I struggle with, which is writing an elegant implementation of the n-...
1
vote
1
answer
3k
views
How to delete Unity Hybrid ECS Entities?
I'm trying to get into Unity's Hybrid ECS feature. Creating and Manipulating Entities has worked fine so far for me, but somehow I can't find a viable option to delete Entities which works 100% of the ...
59
votes
1
answer
18k
views
Using component based entity system practically
Yesterday, I've read a presentation from GDC Canada about Attribute / Behaviour entity system and I think it's pretty great. However, I'm not sure how to use it practially, not just in theory. First ...
1
vote
3
answers
2k
views
ECS in MMOs - How to handle IDs for different object types?
Using a DOD approach, what is the typical way to handle dealing with the actual IDs of game objects?
Obviously, each entity has a unique entity_id that is ...
5
votes
2
answers
5k
views
Understanding Entity Component System
I'm new in game development and I'm struggling to implement Entity Component System (ECS) properly, I have no idea whether I'm doing it right or completely wrong.
Basically, I try to implement ECS ...
9
votes
1
answer
6k
views
Should I implement Entity Component System in all my projects?
I'm not here to ask for any specific code implementation, I'm here just to make my ideas clearer. But let me explain the situation:
I have already developed some little and amatorial game projects (...