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

3
votes
1answer
66 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 ...
5
votes
3answers
149 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 ...
0
votes
1answer
51 views

Right place for Entity logic

In terms of Component Entity System, where should I put an entity logic that should be processed on each animation frame? Say, I wish some logic like "when x-position is more than .. start rotation ...
0
votes
1answer
62 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
1answer
91 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
59 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 ...
1
vote
2answers
102 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
20 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 ...
2
votes
1answer
172 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
216 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
46 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
107 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 ...
0
votes
0answers
64 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 ...
4
votes
1answer
106 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
1answer
108 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
57 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
97 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 ...
2
votes
1answer
78 views

System function in entity component architecture

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 ...
1
vote
0answers
82 views

Are there any popular games using a component entity system? [closed]

I've been looking around, and it seems that almost everyone agrees that entity component systems are better for game development than, say, MVC. However, I couldn't find any successful games that ...
1
vote
1answer
131 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
260 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
94 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
164 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 ...
5
votes
0answers
189 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 ...
0
votes
1answer
91 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 ...
1
vote
1answer
173 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 ...
0
votes
1answer
254 views

Handling AI with ECS in a turn based roguelike

I am trying to implement the Entity Component System pattern to use in a roguelike game. Right now, I have 3 systems. Input, AI, and Action. The input system basically is just a system used by the ...
2
votes
2answers
273 views

How to manage state in a component-based game engine?

I'm working on a small, data-driven game engine with some friends. We use GameObjects (a.k.a. Entities, Actors, or whatever it is called in your favorite engine) to represent every entity in the ...
0
votes
2answers
71 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: ...
3
votes
2answers
322 views

Efficient removal and adding of Components in ECS

i'm working with the Ashley Entity-Component-System (related to libGDX) to program a server-side simulation for an online game and i stumbled upon a serious performance drawback, that is probably ...
0
votes
2answers
106 views

entity component - get object from entity system without knowing it's ID

Ive been building a game using a Entity Component system, but im having a bit of an issue finding a specific object in my entity system without knowing the Entity's Id. My game is organized in ...
1
vote
3answers
262 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. ...
2
votes
0answers
45 views

Entity Component System - Physics Animation Matrix Calculation?

The problem is how many times the matrices representing the bones (for animation and rendering) of an entity get calculated. If i have these components: Position Skeleton (holds matrices for bones) ...
0
votes
3answers
152 views

ECS Reference another Entity's Properties

In an entity component system (implemented where components only contain data and systems operate on groups of data) one can guarantee that the entity in which a system is operating on has the desired ...
1
vote
0answers
196 views

How to architect systems is Enity Component System, in C++ [closed]

When creating an ECS in C++, what are good, simple approaches to architecting the systems. Should each system be a static function of a dedicated class (is this semantically different than just ...
5
votes
1answer
333 views

Intersystem communication in a ECS game

Apologies if this question has been answered before, but after relentless searching I couldn't find anything. As many, I've recently jumped on the ECS-bandwagon, and I am currently killing some time ...
0
votes
1answer
183 views

Entity Component System, How to decouple components need for entity as parameter?

I use Artemis entity system framework, C# port. I have problem with figuring out a good way to handle items and using them. Game is AI driven mostly, so it's not the player that is interacting, but ...
2
votes
1answer
244 views

Character states in component based entity system

I'm working on a Zelda-like game (github), and I made a component-based entity system. I've a Scene class which holds a std::vector of SceneObject. SceneObject is a collection of components Scene ...
1
vote
1answer
516 views

Entity component system, Communication between components [duplicate]

I am trying to implement ECS for my simple 2D game. I would like to ask a question about how components should communicate between themselves and with entity. I tried to implement few components, ...
0
votes
1answer
96 views

Collision response callback

First at all, I'm not asking how to handle or detect collision. I already have that. My actual situation is, I have a system collision and I detect the collisions. Every collision detected is store ...
1
vote
2answers
157 views

Defining collision response in an Entity system

I'm building a really simple top-down 2d shooter which uses an Entity Component pattern. I've added several different entities to a level and given them different collision groups. I have an entity ...
1
vote
1answer
441 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
158 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. ...
0
votes
0answers
152 views

Cross component communication -Java

I am making my first simple game engine and decided to go with a ECS (Entity component system) from inspiration from Unity. I spent quite awhile online trying to figure out how to implement it. I ...
0
votes
1answer
255 views

How can this kind of entity/component organization improve cache efficiency?

I've been reading up about entity component systems as a design pattern for an OpenGL engine. The style I'm trying to implement has entities only being integers, and components being long contiguous ...
1
vote
0answers
316 views

What is the proper methodology for nesting entities inside of each other in an Entity Component System [closed]

I've been working on working up a basic prototype for a game in C# using MonoGame and Artemis. I'm new to Entity Component Systems, and have run into a design concern related to nesting. I've read a ...
2
votes
2answers
122 views

Destroying object from object method

My game uses an entity manager and entities to represent everything including the player, enemes, items, ..everything in the game. In my engine it's the responsibility of every entity to update ...
2
votes
3answers
412 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 .. ...
1
vote
1answer
143 views

Handling creation of entities on level creation

I'm currently working on a 2d physics based plat former, kinda in the style of super meat boy. In super meat boy, you have multiple levels and I want a similar sort of thing but is there a general way ...
5
votes
2answers
1k views

Stroring components in arrays (entity component system)

I'm looking for ways to improve my ECS and I've seen many people suggest storing components in arrays. This seems great, considering fast access for a component using entity id and more importantly, ...