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

1
vote
2answers
149 views

Entity Component System: Store pointer in Component to Entity

I was wondering if it is a bad idea to store a pointer in every Component to the Entity which owns the Component. E.g. I have a Component "NPC". Each entity which owns this Component also must have ...
0
votes
0answers
32 views

ECS isn't actually about data locality? [on hold]

My understanding about ECS was that a game was broken up into 3 parts: Entity, which would just be a unique ID Components, which is just data and information about the entity Systems, which do work ...
2
votes
4answers
399 views

Executing Components in an Entity Component System

Ok so I am just starting to grasp the whole ECS paradigm right now and I need clarification on a few things. For the record, I am trying to develop a game using C++ and OpenGL and I'm relatively new ...
91
votes
9answers
11k views

Entity communication: Message queue vs Publish/Subscribe vs Signal/Slots

How do game engine entities communicate? Two use cases: How would entity_A send a take-damage message to entity_B? How would entity_A query entity_B's HP? Here's what I've encountered so far: ...
4
votes
2answers
104 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, ...
2
votes
2answers
94 views

How to get a component from an Entity?

In my Entity class I've got a function that returns a specific component, that looks like this: template<typename ComponentType> ComponentType* GetComponent() { for(unsigned int i = 0; i ...
2
votes
2answers
86 views

Entity/Component System - Unique Behaviour

So, I decided to see what the Entity/Component system of game development was all about. I really liked it. So, I decided to implement my current game with it. My problem: Unique Behaviour with the ...
0
votes
3answers
204 views

Entity Component Architecture and Scripting without using threads

I am working on a small game engine for practicing purpose and also for putting some of my ideas into action. What I have so far is a couple of systems for rendering, sound etc. The next step is to ...
13
votes
1answer
565 views

How are entity systems cache-efficient?

Lately I've been doing a lot of reading on entity systems to implement in my game engine (C++/OpenGL). The two key benefits that I constantly hear lauded about entity systems are 1) the easy ...
0
votes
1answer
108 views

How do components and systems relate to each other in an entity component system?

I'm trying to learn and understand the ECS (Entity Component System) so that I can create a game using this design pattern but I've got a lot of things that I still don't understand. Lets say I've ...
1
vote
2answers
207 views

Implementig State-driven agents in an Entity-Component-System

A state-driven agent is an agent that performs an action based on its current state. The logic can be implemented through the use of a D-FSM that changes state depending on the Agent's "perception" ...
1
vote
2answers
107 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 ...
0
votes
1answer
130 views

Who Handles Collision in a Component Based Entity System [duplicate]

I kind of stucking at my current plattformer protoype for learning the component based entity system pattern. I have CollisionComponent and a CollisionSystem. The CollisionSystem checks every frame ...
1
vote
1answer
277 views

How can I correctly use an unordered_multimap as entity and component storage?

The Setup I've made a few games (more like animations) using the Object Oriented method with base classes for objects that extend them, and objects that extend those, and found I couldn't wrap my ...
-1
votes
1answer
263 views

Communication pattern in Entity Component System

I'm putting together a ECS for my game with another two main components: an event bus for communication and a Lua interpreter to load scripts. Now, the parent element is a framework/game object with ...
0
votes
2answers
126 views

How to cleanly serialize/de serialize a Dictionary whose values are of a derived class using c# newtonsoft json [closed]

I am working on and entity component system and I am storing entities as a JSON file. Components are stored in an entity as a Dictionary of components. I am using newtonsoft's JSON library. After ...
1
vote
1answer
135 views

Component-Entity Systems Code Generation [closed]

I'm really enjoying component entity approach (I'm currently using ASH haxe, but particular language/framework doesn't really matter). However the problem is - there're way too many elementary ...
2
votes
3answers
263 views

Issues with ECS performance

I'm currently implementing ECS in "classic" sense, as defined by this wonderful post, where we have Entities, Components and Systems. And I'm having a serious (for me) performance issues. They come ...
5
votes
3answers
481 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 ...
3
votes
5answers
1k views

How should IDs be assigned in an entity component system?

I haven't actually implemented this system yet. I'm trying to work through the major conceptual hurdles before I actually start writing code, and the proper way to generate IDs is a little confusing ...
1
vote
2answers
316 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
1
vote
5answers
2k views

Entity System creating Components

Over every entity system I see implemented in C++, or even in Java/C# (e.g. the Artemis framework). I see components not allocated via a new operator (or something similar, e.g. std::make_shared). For ...
0
votes
1answer
124 views

Entity Component Architecture - initialization between multiple components

I'm starting work on an game set in an isometric world, and I'm having a bit of trouble understanding how to implement certain aspects of the entity component system idea. Here are the Components and ...
5
votes
3answers
494 views

Modeling “singletons” in an Entity-Component System

I'm writing a basic Asteroids implementation as an exercise in learning how to think in entities and components, and most of it is fairly straightforward. But one thing I keep running into is ...
3
votes
1answer
538 views

How can I manage entities(in entity component system) using Lua scripts?

Suppose I have a code like this in C++ // Game.cpp Entity* hero; Entity* witch; ... // entity initialization if(/player near witch/) { if(hero->get<HealthComponent>()->getHealth() ...
2
votes
3answers
2k views

Entity System with C++

I'm working on a game engine using the Entity System and I have some questions. How I see Entity System : Components : A class with attributs, set and get. Sprite Physicbody SpaceShip ... System ...
0
votes
2answers
157 views

How can I efficiently update only the entities that matter in a given frame?

I'm making a RTS, which can potentially have lots of units in one map (think Age of Empires). I'm looking for a way to update my units. I want to avoid calling a virtual Update() method every frame ...
1
vote
1answer
203 views

How do I implement space partitioning in entity component system?

My systems work on components without needing to now anything about entities. I want to implement simple grid partitioning, so each entity will be given a cell based on its current position. But how ...
1
vote
1answer
240 views

ECS and life management of entities

I am done with my game's framework and I am trying to implement a life-management system. My framework so far has: Systems that hold pointers to the Entities they are interested in. An Engine ...
0
votes
1answer
257 views

What is the component for the AI system in a component-based entity implementation?

In order to wrap my head around component-based systems, I started making my own little framework. Unfortunately I am not completely sure how systems are supposed to be used in some specific cases. ...
2
votes
7answers
882 views

is ECS a kind of (or vs) OOP? [closed]

Is Entity Component System (ECS) considered a part of OOP or is it a completely different concept?
2
votes
2answers
273 views

What are the advantages of having component logic in a “system” versus the component itself?

For the past few days I've been trying to make my first game. I did some research on usual development practices and patterns and I settled on a composition system where the different components ...
3
votes
3answers
196 views

How do I deal with different “types” of entities in Entity-Component-System model?

I have CollisionSystem which basically iterates through the array of PhysicsComponent and checks if there was some collision between two entities. But where should interaction code go? And how should ...
9
votes
1answer
1k views

How to benefit from cpu cache in a entity component system game engine?

I often read in the ECS game engine documentations that is a good architecture for using cpu cache wisely. But I can't figure how we can benefit from cpu cache. If components are saved in an array ...
2
votes
1answer
160 views

Viewing one of multiple worlds in a component entity system?

I've been working on a space simulation game. The player can control a ship and fly through wormholes to get from one solar system to another. I would like the player to be able to switch the camera ...
1
vote
1answer
540 views

Scene Graphs and Entity Component Systems

I am trying to determine how to move my current implementation of nodes in a scene graph to an entity component system and am struggling to wrap my head around how the two can work together, if at ...
4
votes
1answer
207 views

What are Blackboards?

I am implementing an Entity System for my game. I am aiming for a larger procedurally generated world. The world will be filled by AI entities where "on screen" and "near screen" entities will be ...
1
vote
1answer
137 views

Drawing Sprites with Artemis

I am trying to trace the StarWarrior code (the Artemis tutorial). I cannot figure out how these sprites are being drawn. This is the code where the player's ship is initialized: /// ...
5
votes
5answers
632 views

How can I efficiently implement a bitmask larger than 64-bits for component existence checks?

In my ECS implementation, I use bit-wise operations (as described and illustrated in this thread) to tell an entity what type of components it currently consists of. So my Entity class has the ...
2
votes
1answer
183 views

ECS how to access multiple components (not the same one) in a system?

I'm implementing a basic entity component system from http://entity-systems.wikidot.com/rdbms-with-code-in-systems#java in C++, but I don't quite understand how I could do multiple components (not the ...
1
vote
3answers
185 views

in an ECS framework why are components indexed via their name rather than an Enum?

I have been reading through a number of discussions on ECS framework and very often I see components being referred to via name rather than through a string object such as an enum or a struct. I'm ...
1
vote
1answer
210 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 ...
4
votes
2answers
228 views

How can I provide attribute extensibility in a component-based entity system?

This question and its answers move against utilizing an entity component system where the component itself is just a generic class with an dynamic container for the attributes/properties of the ...
6
votes
3answers
2k views

How to avoid “Blob-Systems” in an entity component system?

Currently I am facing the following problem: I am trying to write a pong clone by using an entity component system (ECS). I wrote the "framework" all by myself. So there is a class which manages ...
3
votes
1answer
122 views

EventManager adding data to the event message

Some backstory: I decided it was time to start making a game. I've got a bachelor degree in computer sciences, but I didn't really get to code much during my studies. I've started making a quick ...
5
votes
2answers
357 views

How to model interentity membership in entity-component architecture?

I'm falling in love with simple grace of entity-component design, although I still have issues breaking from MVC and OOP practices. Some of my game entities have membership relationships with each ...
1
vote
2answers
694 views

Entity Component System, weapon

I'm new to game programming and currently trying to understand Entity Component System design by implementing simple 2d game. By ECS I mean design, described here for example In my game I have ...
3
votes
2answers
457 views

Alternatives to storing all my entities in an SQL database

I've been trying to build my entity system based on pure SQL data storage as explained in this post series. The idea is that every entity or component is stored in an SQL table. I created my framework ...
1
vote
2answers
190 views

Is it feasible to use a DHT to span an MMO over many servers for improving reliability?

At the moment I have an idea for how to handle distributing MMO servers. At the core is a bunch of worker nodes that all share the same set of distributed hash tables. Each DHT stores a specific game ...
1
vote
3answers
87 views

How can I utilize external libraries within an entity system?

I'm implementing an entity system for educational purposes. I wanted to focus on the system itself and don't know much about rendering and physics, so I'm using external libraries for those tasks. ...