Questions tagged [entity-component-system]

Used when referring to the Entity-Component-System (ECS) architecture.

0
votes
1answer
133 views

How could I implement an ECS in C? [closed]

I'm looking into how to do a game engine using only C and wanted to know how to implement ECS in C. I didn't find any ECS implementation for C, it only seems to exist for C++. So I'm wondering... Is ...
0
votes
0answers
19 views

Approach to storing multi-cell-objects on a sparse Grid (Example: Buildings in Anno)

I am currently working on a citybuilding game and planing on how to store buildings on the map. In previous projects I used either a grid where each Object was exactly 1 cell; or Unity Objects ...
0
votes
1answer
130 views

How to design components for tile-based movement in an RPG using ECS

I'm trying to re-write a small game of mine using ECS mostly for educational purposes and to see if it fits top-down RPG games in the style of Pokemon (gameboy). Since everything is tile based, ...
3
votes
1answer
165 views

Handling input in a custom ECS engine

I've been implementing an Entity Component System into my custom toy engine so I can learn more about it. Currently I have the following problem: I can't think of a way of implementing input as a ...
1
vote
2answers
92 views

How do the systems find the entities they should operate on in Entity-Component-System pattern?

I have read many articles about ECS patterns. Many of them are clear on what the entity and components are but don't really talk about the system because it "varies" or just use plain English to ...
1
vote
2answers
112 views

How can I handle scripting-like tasks in my ECS?

So I have been getting more and more into ECS architecture, and I am having a bit of trouble wrapping my head around how to handle custom actions/callbacks. For instance, let’s say I want to have a ...
0
votes
1answer
40 views

How to update model transform of components when using physics?

I implemented a high level components system for my renderer and am curious about the right way to update the transforms components of models that have a physics rigidbody attached. I am using ...
1
vote
1answer
162 views

Pure ECS, How to copy all components from one entity to another

I am attempting to create component payloads using prefabs. My goal is to use ...
1
vote
2answers
147 views

How are one-to-many relationships usually expressed in ECS architecture?

I'm trying to implement a simple ECS to help understand the concepts, and I am having a bit of trouble wrapping my head around how it would be used in cases where there is not a 1-to-1 mapping between ...
0
votes
0answers
76 views

Array-Backed Entity Component System with Component Polymorphism

I'm tinkering with an array-backed ECS in C++ along the lines of EnTT. Components are stored in a struct-of-array fashion where each component type lives in its own homogeneous contiguous memory block....
0
votes
1answer
392 views

How to delete Unity Hybrid ECS Entities?

I'm trying to get into Unity's Hybrid ECS feature. Creating and Manipulating Entities has worked fine so far for me, but somehow I can't find a viable option to delete Entities which works 100% of the ...
1
vote
1answer
298 views

Should components in Entity Component System pattern have logic?

Is often read that in entity component system pattern we should treat components just as a passive data structure with no logic at all, this way we follow to a data oriented design approach with ...
0
votes
1answer
767 views

How to design prefabs in Entity Component Systems

In Unity (and I presume other game engines) you can create "prefabs" which are blueprints for game objects. They contain a list of components, and default values for those components. Prefabs can be ...
4
votes
2answers
427 views

How to implement n-body in an Entity Component System

Recently I've been throwing problems at Entity Component Systems to see how far I can push the paradigm. One problem in particular I struggle with, which is writing an elegant implementation of the n-...
45
votes
3answers
14k views

In an Entity-Component-System Engine, How do I deal with groups of dependent entities?

After going over a few game design patterns, I have settle with Entity-Component-System (ES System) for my game engine. I've reading articles (mainly T=Machine) and review some source code and I ...