Questions tagged [entity-component]
The entity-component tag has no summary.
115 questions
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...
0
votes
1
answer
2k
views
How do you handle entity life-time and entities without all components in an ECS?
I'm just starting to implement my own ECS and am drawing everything down on paper to make sure I understand it all before tackling the implementation in code. However I'm getting stuck on entity-...
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 ...
2
votes
0
answers
159
views
Properway to pass information from one system to another in an entity component system design
After having read some example programs (namely Pong, Snake and Pacman) I am now experiencing with ECS. I am wondering where to put the elements for a reward flow. Do you know good practices for ...
5
votes
1
answer
5k
views
Dealing with more complex entities in an ECS architecture
Preamble: I'm working on a level editor for my engine, which uses an ECS architecture. I have around a dozen component types so far, mostly dealing with graphics, like lighting components, model, and ...
0
votes
0
answers
109
views
Rename Sketchup Component meshes for Unity
When i create a component in Sketchup and i export it to Unity, the component structure is always:
Component_Name
MeshX
How can i avoid having the component name as an empty parent and just set it ...
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:
...
2
votes
1
answer
374
views
Use GKEntity's component(ofType:) with inheritance
I'm writing a SpriteKit game in swift and making use of GameplayKit's entity-component system. There are many components that do different stuff but share the same methods in which they do it, so I ...
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. ...
4
votes
2
answers
2k
views
Appropriate Cache Friendly Associative Container For An Entity Component System
The intro to this problem is a bit of a long one so my apologies in advance. In short I am asking for suggestion as to what type of collection I should use to store data for a particular part of my ...
0
votes
2
answers
755
views
Entity Component System data duplicate
I've read some articles about Entity Component System and I like this idea of "entities" having lots of "components" to define them, so I tried to implement it.
Here is an simple overview of what i've ...
3
votes
2
answers
2k
views
ECS component dependencies / sharing and cache locality
I have been trying to wrap my head around how ECS works when there are components which are shared or dependent. I've read numerous articles on ECS and can't seem to find a definitive answer to this.
...
0
votes
1
answer
490
views
How to efficiently filter by a component with a specific value in an entity component system (all entities in grid position [x,y,z], for example)?
I'm working on a 3d grid based game, and I am trying to implement it using an ECS.
I have a position component which indicates the entity's position on the grid. It is comprised of 3 integers (for ...
0
votes
2
answers
2k
views
How to handle Entity Initialisation and Destruction
I've been using the ECS pattern for a while now and, as the complexity of the game increased, I started having issues with the timing of the entity initialisation and destruction code.
I'll use the ...
1
vote
2
answers
359
views
ECS: removal of group of related components
Currently I'm working with LibGDX and using Ashley for ECS. Everything is fine, until i need to remove groups of related components.
Say we have a player that may use different weapons. For now, in ...
1
vote
1
answer
883
views
ECS -- Textures and Game Objects
I'm developing a game using an entity-component system, and had a question about storing, using and linking textures to entities.
I have a GraphicsSystem that is ...
1
vote
2
answers
3k
views
Entity component system design. Should ID of entities be continuous?
I am implementing an entity-component system. Below is my current implementation in c++.
...
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:
...
0
votes
0
answers
694
views
Nested Entities in Entity Component Systems (ECS) [duplicate]
Say I have an entity that has these components:
-Transformation
-Visual
Imagine that these components can nest:
If I have a parent transformation component, a child transformation relies on the ...
5
votes
1
answer
1k
views
Is "entity component system" a principle or a pattern?
Since the ECS follows the principle Composition over Inheritance, and it makes the behavior of game objects can be changed in the runtime.
If ECS is a principle, from my memory of design patterns of ...
2
votes
2
answers
1k
views
C++ structure for component list
I'm developing a game in C++, making use of the Entity-Component system.
I'm going to store a list of each component, with each component's position in the list mapping to it's entity. So, the 5th ...
0
votes
1
answer
385
views
How would you implement and differentiate between input actions and input states?
Im currently trying to setup my game and Ive started to implement input. It works like this:
I have an Input class who notifies the ...
0
votes
1
answer
242
views
Entity Components Ids and Max Integer Values
I have been studying several entity component systems (Anax and EntityX) to get an idea of how they work.
For Entity ids, both use 2 numbers. The first number is basically a position in an array, and ...
2
votes
1
answer
1k
views
Entity interaction in a component design with events
My components are 100% isolated. No component knows about anything outside of itself in any way. Components have functions that operate on their internal state, and events to inform what's happening ...
1
vote
2
answers
150
views
How should one component "trigger" another one in a component system?
In my game I have a MoveComponent and a ClimbComponent.
Some characters can only move around on one level, others are able to ...