The entity-component tag has no usage guidance.
0
votes
0answers
32 views
Component based architecture in TypeScript
I'm doing a game using Phaser with TypeScript. I want to implement a component based architecture for Actors.
What I'm trying to achieve is this:
var component:AwesomeComponent = actor.getComponent&...
1
vote
2answers
271 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:
class Collider {
public var ...
-1
votes
1answer
71 views
Should entities auto-register to systems based on their component signature?
I see all the upside in entities registering automatically for basic components. If an entity has a Renderable component, it should be registered to a list that's used by a Renderable System. If an ...
1
vote
0answers
40 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 ...
2
votes
0answers
79 views
How to store Lua script's inner state?
Situation:
I am working on an Entity-Component system, and I am using LuaBridge as a Lua binder.
There is only one Lua State.
Currently when I update the game objects, I just check whether it has a ...
5
votes
1answer
480 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 ...
0
votes
1answer
84 views
ECS - Components inside components?
Reading up on ECS, I've tried to implement a simple 'game', if you can call it that.
Basic concepts :
You have planets(entity), they produce gold. (gold is a component inside planet)
Planets can ...
3
votes
2answers
92 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
1answer
36 views
Changing the current state of an entity in the middle of an update step or wait for the end?
Let's say that I use a behaviour component that holds a function call to be called every update step assigned to an entity. Inside that function call I'm changing the active state for the entity to ...
1
vote
1answer
75 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 InputMapper whenever some key is pressed (or released or whatever). ...
0
votes
1answer
252 views
How to render in an entity component system?
I am currently working on a game in Java that uses an entity component system. The game currently has two separate update() and render() methods in the game loop however this does not seem to fit with ...
0
votes
1answer
35 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 ...
0
votes
1answer
59 views
Component super class?
I have recently been programming an Entity Component System in Java for a small game that I am working on. From what I have tested, it works rather well however I question the component part. I ...
1
vote
1answer
82 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 it's internal state and events to inform what's happening to ...
7
votes
2answers
382 views
Entity-Component-System data storage design
I'm working on an ECS and I've already read a lot of articles about it. Most of these articles are talking about a simple case (store data contiguously, read it in a single for loop). However the real ...
1
vote
2answers
75 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 climb to the next floor.
My intention is to have characters randomly be ...
0
votes
2answers
58 views
How do I need to tag different (but a little similar) entities with Entity-Component-System pattern
I have some count of weapons - pistol, shotgun, rifle. And I have one system which deals with all weapons, and another system which deals only with pistol. So I need to create both components "weapons"...
2
votes
1answer
131 views
Different objects interacting based on type
Many many thanks to anyone who chooses to take the time to read through this all and offer any advice.
I'm writing a game in which multiple different kinds of Objects move around a grid-based board ...
0
votes
1answer
128 views
Use Ashley with Scene2d in libGDX?
I want to use Ashley but I also want to use actions and listeners with Scene2d. I read that it is not a good idea, but why? Ican create a system with stage.act(); and stage.draw(); in the update ...
0
votes
1answer
101 views
Creating Multiple Render System to Draw Different Entities in Entity-Component-System
When creating ECS based game engine, do you (or can I) create multiple rendering systems?
Let's say I have an Entity class which is the basic unit in my engine, all it can do is add, remove and get ...
0
votes
0answers
52 views
How to do lazy initialization with an ECS?
I'm trying to use the ECS pattern. My problem has to do with initialization.
In my example below, the bounds of the sprite cannot be computed until the sprite is actually loaded from disk. Once ...
0
votes
1answer
105 views
Implementation details of Command Pattern in conjunction with Entity Component System
I have implemented an ECS where more or less an Entity is just an ID, a Component is just a wrapper for data, and a System holds the logic on operating over different components.
There is an Engine ...
0
votes
0answers
33 views
How to model actions/animations with limited duration in an Entity Component System
Alternative title: How to prevent duplication of progress/duration properties in temporal components in ECS?
I'm trying to wrap my head around ECS and came up with the following problem: Certain ...
0
votes
2answers
124 views
What component should hold the bool attack and vector target?
I am having trouble thinking of what component should hold the attack and target data. In the below code components are holding a redundant data which I want to eliminate.
public class ...
1
vote
2answers
167 views
How to access entites from scripts in an entity-framework?
I'm developing on a simple libGDX-based Game and im using the entity-component-system ashley.
For non-generic but custom behaviour (e.g. the Player Movement), I'm using "scripts" instead of reuseable ...
1
vote
0answers
146 views
How do you handle entity parent-child relationship in Ashley ECS?
In the below code example, is a parent-child relationship of an entities. Now every child should follow its parent position, and the child could be re-positioned anywhere.
Entity character; // ...
0
votes
0answers
72 views
How to properly process 2 entities in 1 system? If possible, is this recommended?
I'm using Ashley ECS framework, in ECS framework the Component handles only purely data while System handles the processing of the data. Now, I've encountered a problem which I have 2 entities which ...
1
vote
2answers
101 views
How to convert and handle (controlling) OOP game objects via ECS?
I'm having hard time converting OOP game objects to Ashley ECS framework. I have a character, gun & a bullet class. The character uses the gun as weapon, the gun class has a fire method that ...
1
vote
1answer
91 views
Problem in nested parent-entity relationship in ecs
In the given flow, the character is the parent entity, gun is child of character and bullet is child of gun. I've got a component called NodeComponent which has the storage of child entities and a ...
0
votes
1answer
183 views
Entity polymorphism and entity attributes
I want to design the entity system of my game in a way such that entities are modular, easily modified without affecting other entities, and finally easy to add new types of entities. So ideally some ...
1
vote
0answers
89 views
How do I pool a bullet in libgdx ashley ECS approach?
I'm having problem creating bullet pool in ashley ECS approach, because i'm using PooledEngine, everything is pooled. So I've done is I just use engine.createEntity(), engine.addEntity() and engine....
1
vote
0answers
123 views
What is the proper way of creating bullet in libgdx ashley ecs framework?
I'm still thinking, how do I properly pool a bullet in libgdx ashley? Because the PooledEngine is available, which the Entities, Components and Systems are already Pooled. I made this below example, ...
2
votes
2answers
357 views
Entity System and “composite” entities
I'm new to the Entity Component System pattern and there's something I cannot figure out. Let's say I have the following entity:
Player: {
Components: [
Position: {
x: 0,
...
2
votes
0answers
133 views
When NOT to use ECS architecture? [closed]
I'm familiar with the notion of entity-component-system architecture, and its advantages over traditional class trees. That being said, are there scenarios where one wouldn't want to use entity-...
1
vote
1answer
859 views
Updating a multithreaded Entity-Component-System
I am currently trying to implement an (sort-of) Entity-Component-System. I've got the gist of it, that is, how an ECS is supposed to work. So far i have 4 classes in my design (not yet fully ...
3
votes
1answer
135 views
How to propagate component updates? (Changing components at runtime)
Whenever an entity is being added to an entity controller (which is essentially just a bag of entities), I scan through it's components to figure out if I need to register additional entity processors ...
2
votes
2answers
422 views
Adding new components and systems in my ECS requires lots of boilerplate code
I'm writing an entity component system for a project I've been working on. It's currently in a working condition, and overall i'm pretty happy with it, but I've noticed that adding new components and ...
0
votes
1answer
116 views
ECS: performance of many systems cycling on entities
I have been working with an ECS for my current game and I noticed that I came up with quite a few systems that go over lists of entities that sometimes overlap, so it's not unlikely that I loop on the ...
0
votes
1answer
163 views
How to make my components only contain raw data?
I'm reading that Components in ECS are just only data and have no logic. I'm trying to follow this and I got that working:
class Sprite : public Component
{
public:
Sprite(const std::string &...
1
vote
1answer
297 views
Multiple lua scripts using newthread
I'm trying to hook lua-scripts to my entities, where several entities of the same type want to use a separate instance of the same script. Problem is, when I run two or more scripts and use any C-api ...
1
vote
1answer
704 views
Dynamic Events in an Entity Component System
My game makes extensive use of libGDX's Entity Component System Ashley, and my game world (including all levels and areas) is created with Tiled.
In Tiled, I have an object layer where all of my ...
1
vote
1answer
232 views
Getting a Specific Component in an Entity Component System
I've got component class:
class Component
{
public:
Component();
...
};
then my various components derive from the base Component class
class VelocityCom : public Component
{
public:
...
3
votes
1answer
459 views
Communicating with Collision System in ECS
I have read tons of articles and forums threads about ECS but still can't understand how anything in engine should communicate with Collision System. Let's say I have Input System that handle keyboard ...
0
votes
1answer
120 views
Generic multiple containers derived classes for Entity System
I am working on an entity system for a game. I have read that cache is very important with the common operation of iterating over entities and their components.
Currently I have a class World that ...
0
votes
3answers
87 views
How can I pass messages from multiple components to another?
I want to start with an (easy) Entity Component System. I have a question regarding the messaging between Components.
Let's say I have a RenderComponent. This component needs 2 integer values x and y ...
1
vote
3answers
970 views
Collision Response in Entity Components Systems
This question seems to be a duplicate of mine, but I don't think it is.
I'm trying to build a game using an ECS, but I want this ECS to be as simple as possible, therefore I am eschewing messages.
...
5
votes
2answers
3k views
How does Unity's Entity-Component System Work In Practice? [closed]
On the surface Entity-Component seems like a good way to program games. Everything is a game object and those game objects are made up of components. The attraction is components are very flexible, ...
1
vote
1answer
711 views
C++ Entity Component System: Diverse Behaviours
I'm trying my hand at an action RPG kind of game and using a modified version of entityx from alecthomas, which is basically an Entity Component System. I have really big troubles with some of the ...
0
votes
1answer
211 views
How do I efficiently deal with entities moving between chunks?
I am working on a game in which entities need to be stored in chunks.
This is the basic chunk format:
public static Entity [row][column][entities] chunkEntities;
However, some of my entities move. ...
2
votes
3answers
660 views
How do you filter entities in an Entitiy Component System?
I am currently writing my own ECS in C++ and I am using std::bitset.
I register a component at compile time and give it an ID.
Position has ID 1
Direction has ID 2
..
vector<bitset<...