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
0
votes
1
answer
171
views
How to structure this concept in ECS?
High level
At a high level, I'm looking to create a galaxy exploration-style game.
A number of points of interest will be selectable on the map (I'd like to aim for several hundred, but flexible and ...
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 ...
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 ...
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 ...
0
votes
1
answer
3k
views
How do I contiguously store and iterate over ECS components in C++?
I'm writing an entity component system and want to store each type of component separately and contiguously in memory in a way that's easy to iterate over.
Component...
2
votes
2
answers
4k
views
How to Implement ECS Archetypes in C#?
I'm trying to figure out how to implement a simple ECS with an Archetype approach, similar to what Unity's ECS uses.
An archetype is just a category for entities that have a specific set of components....
0
votes
1
answer
141
views
Should abilities have their state and functionality separated?
I'm developing a top-down game using Javascript and Canvas in an ECS architecture.
I'm wondering, which of these is better from a design / elegance point of view?
Method 1: Combining the ability ...
0
votes
1
answer
569
views
Cannot decide between using a MessageBus and entities for events in my ECS game
For example, let's say that the player walks into an enemy and in response, a chain of events should occur (such as: his score goes up, the enemy dies, a cinematic starts, etc.)
I see two "proper&...
0
votes
0
answers
41
views
ECS: Should Systems access only one component-type [duplicate]
Let's say I have a Transform-component-type, and a Color-component-type (to keep things simple).
I also have an entity E that is ...
1
vote
2
answers
3k
views
How does ECS handle systems which need to know more about the environment of the entities it processes?
I'm trying to wrap my head around the concept of ECS (Entity Component System). I think I grasp the concept of the different parts, Entities, Components, and Systems.
Entities: Basically just a ...
0
votes
1
answer
186
views
Hidden copies of the environment in an entity component system
For reasons outside the scope of this question, my game has several full copies of the game environment running asynchronously. At any one time, only one of these is rendered.
This is trivial to ...
1
vote
1
answer
224
views
Where should I put units and items in a squad-combat ECS-based game?
So I'm working on a game where squads of varied units would explore, fight, trade and build on an overworld map. Combat would be automated more or less, and happen on the overworld. Basically, ...
0
votes
1
answer
475
views
How to handle dynamic hierarchical entities in ECS
Here's the analogy:
I have an organism which is composed of cells which can be further composed of a medley of attachments.
What I have currently is a sort of event chain between child/parents to ...
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 ...
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 ...
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 ...
0
votes
2
answers
2k
views
Implementations for storing entities in an ECS system
I'm restructuring my model of entities, components and systems, where entities are:
...
0
votes
1
answer
3k
views
How can I iterate over all entities with a particular component?
I'm currently designing a game engine and want to implement my own ECS implementation, so I decided to look around for ideas.
Unity has recently updated their engine and seems to be pushing towards ...
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 <...
1
vote
1
answer
496
views
How MMOs store IDs for game entities
Wondering in general how IDs are stored in a large massively multiplayer online game.
From what I can imagine, it seems that each "game entity" would have a globally unique ID (GUID). Say there are ...
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 ...
1
vote
2
answers
2k
views
ECS - should everything be a system?
I've just recently started working with LibGDX and Ashley, and I find it to be really useful and I like working with the whole entity/component/system workflow. But I've been starting to layout the ...
1
vote
1
answer
690
views
How does Ashley keep systems up-to-date with its entities?
I am currently trying out Ashley and overall learning how an ECS works internally. What I currently don't understand is how Ashley in particular keeps its systems up-to-date by adding or removing ...
0
votes
2
answers
1k
views
Event-Based Entity-Componenty-System
So, I'm new to ECS. The concept is very interesting in contrast to traditional OOP and heavy inheritance. I'm working on a game right now that is open-sourced, but does not actually have a game loop. ...
0
votes
1
answer
1k
views
Make the components of an ECS polymorphic
I have implemented an entity component sytsem (ECS) in my game engine (SFML and C++ 17). An entity has an array of components. You can get a components by its type e.g.: ...