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
2
votes
1
answer
1k
views
Are references between entities in Entitiy Component System allowed?
I've got a player entiy in my game that can pick up weapons when colliding with item entities. The player can hold and use the weapon in their hand (the weapon sprite is rendered relative to the ...
2
votes
0
answers
2k
views
How can I build Goal Oriented Action Planning within an Entity Component System?
I've been creating an interactive fiction game in javascript that uses an entity component system as described here. The problem I've encountered is in developing the AI system for the game. Ideally, ...
0
votes
2
answers
2k
views
Should a system be able to render things? (ECS)
I'm currently building an entity component system and I just have one question... Should a system be allowed to render things to the screen?
For example, should I make a SpriteComponent that contains ...
1
vote
2
answers
1k
views
Entity-Component-System design
I read a lot about ECS (strategy) pattern and have a few questions. Consider simple space game.
We have stars there. Obviously star is an entity. What if I want to ...
-2
votes
1
answer
56
views
Entity update or Keyboard commands transferred to the Gaming server?
I am working on a research project .
I need to know the network communication in games in large Multiplayer games (Battlefield,GTA 5). Is there some official documentation present for these games?
...
0
votes
1
answer
828
views
Circular Dependencies in an Entity Component System
I'm developing a top-down shooter in C++ using an entity-component system, and have run into a problem when attempting to refactor powerups. Currently I have a ...
1
vote
3
answers
2k
views
Binding c++ templated functions to lua
I have started using Lua as a scripting language for my game engine. It works perfectly for things like input, audio etc. However, I'm now trying to bind my entity component system functions which ...
3
votes
2
answers
2k
views
Where is 'game logic' implemented in component based design?
I have been trying to get my head around using an entity component system for a game. But I am struggling to understand how I should do 'game-logic'.
What I have so far:
Components are essentially ...
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.
...
1
vote
1
answer
2k
views
What's the proper practice to organize relationship between components in an ECS pattern?
I'm new to ECS concept and trying to refactor my app with an ECS manner.
After reading some articles, I still don't get a sense about how to organize hierarchy for such pattern. My questions are
Is a ...
0
votes
1
answer
493
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 ...
3
votes
2
answers
2k
views
How do we coordinate which order the systems get processed within an ECS?
If I knew all of the systems at compile time, I could order them myself. However, I intend on having user-defined mods. This adds a level of complexity, in that I (as the framework developer) don't ...
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 ...
0
votes
2
answers
742
views
How should I poll for component state changes when designing an ECS?
I'm implementing an ECS and have run into a predicament.
Let's say my main loop is something like (super simplified, all code below is pseudo-code)
...
1
vote
1
answer
672
views
Handling of persistent key presses in an ECS
I'm currently in the planning phase of a game. The whole thing should be based on the entity-component-system (ECS) pattern. All logic is concentrated inside of the systems, i.e. that the components ...
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 ...
0
votes
0
answers
162
views
Are virtual calls worth it for game entity management?
I have seen a lot of game programming tutorials doing this:
...
1
vote
2
answers
511
views
Getting Components to their respective System in Entity-Component Engine
I asked this question in stackoverflow, but I didn't get any responses. I think it's better suited in this exchange.
I'm building a game engine of sorts (purely educational) and am not sure the best ...
0
votes
1
answer
368
views
Game engine tool generating game entities
I'm writing a game engine with an editor that allows you to create individual components like sprites, fonts, and particles. Then you're able to combine these individual components into what I call an ...
1
vote
1
answer
627
views
How to detect collision between entities using Ashley?
I am developing a game using Libgdx and Ashley, and I would like to know the best way to detect collisions between different entities. Currently I have been using a ContactListener that detects ...
2
votes
1
answer
161
views
Gameserver Request handling
EDIT: I forgot to mention that in this implementation E stands for Entity which is just an ID, C => Component as data-only types and S for Systems which should implement logic
Currently i'm working ...
2
votes
1
answer
445
views
How can I manage resources in memory, and dispose of them at appropriate time with the Ashley framework?
I have been working on libGDX and the Ashley framework, and I have not been able to find any information on resource control in memory.
I would like to know if there is any way to control those ...
5
votes
2
answers
693
views
Where to store contiguous arrays of components?
I've been working on an entity component system and have the trouble of where to define/put the arrays of each component type. Each component type is user defined so I do not know what or how many ...
1
vote
0
answers
204
views
Communication in an entity-component through public variables or public member functions [closed]
I am currently coding my own ECS to get a deeper understanding of how such an engine works. I am currently putting together systems. I am aware that there is no right answer to my question as there ...
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++.
...
0
votes
1
answer
828
views
How to manage changing Z-Index in an Entity-Component-System?
If got an Entity Component System based game-project (like classic zelda).
The Player as well as Enemys are Entities with sprite- and
tranform-components.
The Weapons are also Entities with sprite- ...
2
votes
1
answer
801
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:
...
0
votes
1
answer
2k
views
Integrating Unity physics with Entitas
I've used Entitas a bit and it appeared to me as a great way of creating clean, modular code. I've seen few examples of games created with this framework, and most of them were puzzles, TD's, simple ...
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:
...
1
vote
2
answers
2k
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 ...
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 ...
2
votes
1
answer
2k
views
Entity Component System - Handling Input
I'm developing a using the Entity-Component model, and so far have components for position, input, graphics and a camera, and systems for rendering graphics and handling input.
All seems to be ...
2
votes
1
answer
2k
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 ...
0
votes
0
answers
149
views
Change entity's size based on health [ECS]
I'm making a kind of entity component system framework and I have a doubt:
I have two components 'health_damage', 'physic' (which contains position, weight,...) and 'sprite' (position, dimensions...)....
12
votes
1
answer
3k
views
Entity Component System - How to implement an object's Transform?
In designing an entity-component system for my engine, I've come across a little snag in the way of storing and retrieving a particular type of component.
First, let me set clear up a bit of ...
0
votes
1
answer
388
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
238
views
How would you handle different level-types in an entity-component-system?
Im currently developing a game with the entity-component system of Ashley in Libgdx (Java).
In the game you would be able to walk on planets (2D not 3D), fly in the star system and traverse between ...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
243
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
1
answer
117
views
Assign type to an entity in Entity-Component System (super entity - syntactic sugar)
I have created ECS framework from scratch using C++.
Everything works fine, but I think my code is not so cute (at #1):-
...
1
vote
2
answers
4k
views
Efficient systems in an Entity Component System
I'm designing a simple Arcanoid game with ECS.
With ECS there are many systems that only update components once in a while. For example, Particle systems are animated sprites that can be used for ...
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 ...
0
votes
2
answers
886
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
2
answers
5k
views
How do I better organise rendering in an entity component system?
I'm developing an isometric RPG, with 3D characters in 2D level. I was using a standard object orientated programming paradigm, but was faced with a lot of issues. Recently, I learned about entity ...
1
vote
1
answer
316
views
Communication between the SubSystems and the GameObject components?
Currently I have an architecture (not 100% accurate):
The RenderData contains primitives, which will be processed by the GraphicsEngine.
Upon creation I have to send the pointer of the renderData ...
0
votes
2
answers
195
views
Unused methods after component inheritance in component based architecture?
I have a GameObject class, which contains Components, like:
Renderer
Camera
Behaviour
Rigidbody
First I inherited all of them from Component which has an Update() method, and it is called every frame ...
3
votes
1
answer
745
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
2
answers
899
views
How to add the concept of entities and components into an isometric tile map?
To get some practice with SpriteKit, entities and components I built a little demo.
I created a SKNode subclass (...
1
vote
1
answer
831
views
AI and EntitySystem
I'm using an Entity-Component System and have an AI System that acts on certain entities (agents) within the system. My question is: how should the AI system interact with the world and the agents? I'...
0
votes
1
answer
1k
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 ...