Questions tagged [entity-component-system]

The entity-component-system is an architectural pattern that uses very few and simple entity classes whose instances are dynamically composed of components that provide structural and behavioral features.

The entity-component-system is an architectural pattern that uses a simple entity class whose instances are dynamically composed of components that provide structural and behavioral features.

The pattern is based on the principle of composition over inheritance and aims to avoid deep class hierarchies that are difficult to maintain. At the same time it facilitates dynamic configuration and combination of features.

Its properties made it popular in the videogame industry, where it facilitates the dynamic configuration of new characters and items.

22 questions
27
votes
4 answers

How to avoid "managers" in my code

I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it comes to "manager" classes, perhaps I'm not naming my…
21
votes
5 answers

Is the Entity Component System architecture object oriented by definition?

Is the Entity Component System architecture object oriented, by definition? It seems more procedural or functional to me. My opinion is that it doesn't prevent you from implementing it in an OO language, but it would not be idiomatic to do so in a…
14
votes
3 answers

Entity-Component-System architecture: interaction between systems

I am studying the Entity-Component-System architecture philosophy. As I have read about it, a typical entity system has: 1) Entities - which are merely ID tags which have a number of components 2) Components - which contain data on various aspects…
13
votes
2 answers

Isn't an Entity-Component System terrible for decoupling/information hiding?

The title is intentionally hyperbolic and it may just be my inexperience with the pattern but here's my reasoning: The "usual" or arguably straightforward way of implementing entities is by implementing them as objects and subclassing common…
PawkyPenguin
  • 251
  • 1
  • 2
  • 6
12
votes
1 answer

OOP ECS vs Pure ECS

Firstly, I am aware that this question links with the topic of game development but I have decided to ask it here since it really comes down to a more general software engeneering problem. During the past month, I have read a lot about…
6
votes
2 answers

Bottleneck performance in ECS

I've been looking into building an entity-component-system. Basically, an entity is just an id wrapped around a struct, components are data belonging to that entity(and reference said id), and systems are the code. Entities and components are all…
5
votes
5 answers

How does one resolve low level types dependent on high level types?

I frequently come across this problem when developing games and simulations. As an example, I'm currently writing an implementation of chess. I'm using it as a vehicle to experiment with entity-component systems and responsibility chains, inspired…
5
votes
2 answers

A more data oriented design approach to Entity Component System

I'm creating my first c++ game engine project (for learning purposes) and in it I've attempted to implement an entity/component system utilizing some data oriented design principles while also not fully giving up my object oriented way of thinking.…
Jason
  • 459
  • 1
  • 4
  • 10
5
votes
2 answers

How to allow for custom Rules in a Entity Component System designed game engine?

So I've been doing a lot of research into game engines, and Entity Component System (ECS) seems to be the most flexible and extendable design to use. Just to summarize, in ECS the basic idea is that you have Entities which are just containers for…
3
votes
1 answer

different collision geometries in a component based game engine

I'm writing a simple game engine and after a lot of rethinking/refactoring I settled with sort of a component based architecture (not strictly ECS, but it isn't inheritance based anymore either). So everything in my world is an entity, and each…
Luca
  • 181
  • 2
  • 7
3
votes
2 answers

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 work, because of lack of experience I am having…
2
votes
1 answer

Rust/specs – what is the good/idiomatic way of design level walls/static objects handling in an ECS architecture

Warning: long question ahead, don't be afraid, I just tried to be as precise as possible about details for who wants them but many paragraphs are skipables if you already understood what I want ;). Context: I passed the last few weeks learning Rust…
jthulhu
  • 141
  • 5
1
vote
1 answer

What is a common practice to refer to other datas within a data oriented design?

This question has been in my mind for a while now, especially in the context of high performance, interactive 3d applications. Just want to find out what is the general practices in DoD for referencing other objects. Let's take an example:…
1
vote
1 answer

How to model interaction between entities in ECS?

I am exploring the ECS pattern and my pet project is a simulation of an economy where the primary mode of interaction between economic agents is a transaction. Some of these agents are market makers (they passively advertise offers to trade -…
Chechy Levas
  • 127
  • 3
1
vote
1 answer

Writing a data-oriented ECS update loop that handles multiple components

So I have an engine in progress that's structured like this: entities are simple ids (unsigned short) components are stored in pools which are static members systems are stored by the manager, and all inherit from a single base What this looks…
1
2