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.

learn more… | top users | synonyms

8
votes
1answer
290 views

Entity component system - game progression

I'm quite new to game development (but not to programming) and I'm trying to figure out what would be the best way to handle inter-world communication. What I mean is this: I've been reading about ...
0
votes
0answers
3 views

Handling data logic on libgdx ai state machine or in ashley system?

In this below example, I've combined libgdx ashley and AI state machine. Do you think it's a good idea to handle the logic in state machine or stick on handling the data logic on System? public enum ...
1
vote
0answers
18 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
22 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, ...
1
vote
2answers
107 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, ...
1
vote
1answer
61 views

Loading scenes from files, or hard coding it?

In a game engine I'm working on I'm using scenes similar to what you would find in Unity. The entities in my game are composed of reusable components and custom data which is linked to those ...
0
votes
1answer
97 views

Proper system architecture in a game engine?

This is my first time attempting to create a game engine. I came across a theoretical problem and would like to solve it before implementation. Right now I have a WindowSystem, which opens the window, ...
2
votes
1answer
188 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 ...
1
vote
1answer
57 views

Multiple traversal of a component-based hierarchy

Let's say a game use a component-based hierarchy to store all of its entities. So it can have objects, characters, lights organized in some kind of tree. When rendering the game, it needs to first ...
-1
votes
1answer
67 views

How can I handling rendering of entities with an entity/component system?

I'm implementing an entity system in a game engine which is based on the Artemis framework. My question is, how can I wrap an existing rendering engine (like Ogre or Irrlicht) under this framework? ...
9
votes
2answers
175 views

How can I support component-to-object communication safely and with cache-friendly component storage?

I'm making a game that uses component-based game objects, and I am having a hard time implementing a way for each component to communicate with its game object. Rather than explain everything at once,...
0
votes
1answer
80 views

How to combat exponential growth in sprite messaging?

In my 2D platformer game, I have a number of sprites moving around the world. When two sprites collide with each other, I calculate how deep the collision is and then call a virtual method on both ...
2
votes
3answers
1k views

Rendering order in an Entity System

Say I use a basic ES approach, and also inside Systems I hold lists of all entities that Systems are required to process. How do I maintain this list of entities in desired rendering order, i.e. for ...
10
votes
3answers
836 views

Efficiently separating Read/Compute/Write steps for concurrent processing of entities in Entity/Component systems

Setup I have an entity-component architecture where Entities can have a set of attributes (which are pure data with no behavior) and there exist systems that run the entity logic which act on that ...
1
vote
0answers
73 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-...
3
votes
2answers
1k views

How do I deal with abstracting collision handling code between entities with differing collision components?

I'm using a component based entity design with Components that hold the data and Systems that act on entities based on the components they have. Entities are registered to all systems as they are ...
0
votes
2answers
59 views

Running subsystems at difference update intervals

I want to update the rendering at 60fps, but the logic at some lower rate, say 15Hz. But if an only moves when the game logic updates, then it would appear to stutter badly especially for lower ...
0
votes
1answer
75 views

SceneGraph in Entity Component System, Transformations

I'm recently learning entity component systems, and started implementing it into my test engine, however I'm having an issue integrating this with scene-graph, which I'm trying for the first time. ...
2
votes
3answers
582 views

Where does event-based audio fit in a component-based entity system?

Assuming the underlying low level audio logic is encapsulated in some outside class... what is the best way to add audio effects to a component-based entity framework? I am taking the approach that ...
0
votes
1answer
161 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 ...
2
votes
1answer
88 views

System function in entity component architecture [closed]

I started working with ECS and I am not completely sure that I understand it correctly. As I see it now - systems can implement logic for collision, movement, similar things like that. But would it be ...
5
votes
3answers
227 views

How to handle GameObjects that have been destroyed but are still held by others?

I'm developing my own game engine in C++ as a learning exercise. I have employed a fairly standard method of handling destroyed GameObjects: Mark them as destroyed Have the scene delete destroyed ...
3
votes
1answer
111 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 ...
0
votes
1answer
140 views

Transform components in ECS

Many game engines I've seen which are based on an Entity Component System. It has some kind of a Transform Component as a necessary component attached to all of their entities. While this does seem to ...
2
votes
2answers
224 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 ...
1
vote
1answer
123 views

Relation between game systems and components in a component-based architecture?

Based on a question I previously asked here regarding to decoupling input from other components of an entity I developed a small component architecture on top of XNA to understand how everything works ...
2
votes
1answer
162 views

Component arrays vs. entity structs? [closed]

Two of the main systems I've seen in entity system tutorials are: An Entities class with one array / [hash]map for each component, with indices corresponding to entity IDs. A list of Entity structs, ...
1
vote
1answer
72 views

Libgdx + Ashley moving one texture causes everything to jump

My problem is that as i am moving my player entity all my entities shift position by the reverse total of my player entities movement vector, However the only system to move things is my ...
3
votes
1answer
333 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 (...
4
votes
2answers
406 views

Complex system-component dependencies in entity-component system?

I am trying to design a typical (data-oriented) ECS engine. The issue I am struggling with is that my rendering system have to rely on two different sets of entities to actually do rendering. My ...
0
votes
1answer
80 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
3answers
144 views

Alternative to entity system in a game engine? [closed]

I have been developing a game engine. I was wondering what I should use for a component system. I've read up on entity component systems, but what other alternatives are there? The idea of searching ...
4
votes
1answer
185 views

Event Handling in an ECS

I apologize if this has been answered already. I've looked around here, and read a few blog posts, but none seem to fully answer my question. I am writing an Entity Component System. Entity is a ...
0
votes
0answers
129 views

Entity-Component-System and 2D map with tiles : how to do it?

I have a question : I'm currently programming a roguelike game (with tiles) using the ECS programming paradigm, and I'm struggling with how to implement the map. At first, I made every terrain square ...
0
votes
1answer
99 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 ...
123
votes
1answer
26k views

What is the role of “systems” in a component-based entity architecture?

I've been reading a lot about entity components and systems and have thought that the idea of an entity just being an ID is quite interesting. However I don't know how this completely works with the ...
0
votes
1answer
137 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
130 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 ...
3
votes
2answers
158 views

Where should complex state logic in an ECS reside?

I've been using ECS for a while, at the moment I'm using my own, but it's pretty standard. Components are data only, Entities pretty much just a Map with some additional metadata and Systems that ...
1
vote
3answers
484 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. ...
7
votes
3answers
1k views

Entity Component System for HUD and GUI

This is a very rough sketch of how I currently have things designed. It should, at least, give an idea of how my ECS is currently designed. If you notice in that diagram, I have basically split ...
1
vote
1answer
270 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 ...
7
votes
2answers
397 views

Create entity from template in component-based engine

For my project I would like to use a component-based entities in C++. My current implementation is split to these parts: Systems - Contain a map of components of certain class and operate on these. ...
1
vote
1answer
137 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: ...
2
votes
1answer
245 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 ...
2
votes
3answers
182 views

How can I handle position in an entity system where position can be 2D or 3D?

I'm working on a game engine to learn how it's done (so I might better take advantage of the techniques involved and other, similar engines in the future), and I've run into a problem when handling ...
8
votes
0answers
269 views

How to cache resources in my homebrew rendering system

Background: I am designing a simple 3D render system for an entity component system type architecture using C++ and OpenGL. The system consists of a renderer and a scene graph. When I finish the ...
7
votes
2answers
7k views

Tips for Component Based Entity System message handling

I'm trying to implement a component-based entity system but am a bit confused on how I should handle the messaging. There are two problems I'd like to resolve so I can test the system. Below is the ...
0
votes
2answers
79 views

Firing attack and take_damage events on entity attacking?

I have an Entity class with health, armor, and damage. I want my entities to raise some kind of take_damage and attack events whenever they attack or take damage. Here's my current implementation: ...
1
vote
1answer
200 views

How can I handle invulnerability in an entity system?

I currently have an entity component system with messaging. The messages are delivered to each subscriber, but each subscriber gets their own copy, basically meaning that altering a message doesn't ...