11
votes
Accepted
Event handling in Pure Entity Component Systems, is this approach correct?
Merging systems, such as collision and collision response, is a bad idea. The reason being that there can be many different responses to collisions: Physics based, and game-logic based.
In most game ...
10
votes
Accepted
Dealing with more complex entities in an ECS architecture
Games typically approach this type of issue using a transformation hierarchy.
In this model, each entity can be treated as a "child" of a "parent" entity. The entity's local ...
8
votes
Entity Component System: system and components relation
One of the big reasons some ECS proponents favour a strict separation of components and systems is that it helps architect game functionality in a data-oriented style.
In the ideal data-oriented flow,...
5
votes
Accepted
Should entities auto-register to systems based on their component signature?
TL;DR Entities SHOULD NOT auto-register to systems based on component signatures; prefer instead to explicitly declare component sets/nodes to register your entities to systems that operate on ...
5
votes
Accepted
Appropriate Cache Friendly Associative Container For An Entity Component System
Do the simplest thing that works, especially early on.
If you've ever seen videos of triple-A titles in alpha, you'll know how slow / buggy they are. This is normal; in fact, it's desirable. And it's ...
5
votes
Accepted
How to implement n-body in an Entity Component System
One nice thing about systems in an ECS architecture is that they don't all necessarily need to follow the same structure of ...
4
votes
Accepted
ECS component dependencies / sharing and cache locality
Reducing cache misses doesn't need to mean getting rid of them entirely, so we do need to be wary of "making the perfect the enemy of the good enough"
After all, the absolute worst performance your ...
3
votes
Accepted
Implementation details of Command Pattern in conjunction with Entity Component System
How do I populate the execute command if there isn't any logic that
"belongs" to an entity?
But there is a mechanism for applying logic to an entity: Systems. In ECS, Systems map behavior to ...
3
votes
Accepted
ECS - Components inside components?
First of all, there is no "right" or "wrong" way to structure a game's software architecture. Just ways which work or don't work for you.
Usually you wouldn't nest components. What you would do ...
3
votes
Event handling in Pure Entity Component Systems, is this approach correct?
Your question boils down to
Is it a good idea to use a publisher-subscriber-based GUI and to keep this subsystem
distinct from my ECS (while enabling interop between them)?
Yes, keep your UI and ...
3
votes
Should entities auto-register to systems based on their component signature?
I think you may be overthinking this.
The point of ECS is to be simple:
An entity is nothing more than an aggregate of components.
A system is only interested in a subset of those components. For ...
3
votes
How to Implement ECS Archetypes in C#?
Here is a sketch of how you can implement an archetype in C#:
...
2
votes
Accepted
ECS -- Textures and Game Objects
You could have a map in graphicsSystem where the key is the name of the texture file and the value is a reference to the loaded texture object.
When adding ...
2
votes
Accepted
Entity component system design. Should ID of entities be continuous?
The concern that @philipp mentioned can be eliminated with a bit of fancy bit manipulation.
Rather than treat your Entity's ID as a single 32-bit value, split that value into two parts, one which ...
2
votes
Accepted
Component based architecture in TypeScript
I've got some good suggestions on Phaser forum, the solution shown by user @flyovergames was what I was looking for:
...
2
votes
Accepted
C++ structure for component list
Given the constraints (unknown number of components, components can be added or removed at runtime, components have different memory footprints, components derive from the same class), the ...
2
votes
Entity Component System: system and components relation
My point is: if the Systems are the ones responsible for the actual
game logic update (practically speaking, the game logic code is
written inside the system), is there a 1:1 relation between ...
2
votes
How to handle Entity Initialisation and Destruction
This is one of the common problems with ECS architecture: Intersystem communication.
There is no silver bullet solution, and research is ongoing, but common solutions are:
Observer patterns. Any ...
2
votes
Accepted
Event-Based Entity-Componenty-System
Entity movement is a great example.
In most games, they do not care what triggers the movement, only that entities move in a common and standardized way. So the idea is to design some middle-man ...
2
votes
Appropriate Cache Friendly Associative Container For An Entity Component System
ArcaneEngineer's advice is good, particularly for early development (to an extent - once you configure your engine to work a particular way, it can be significantly hard to rework it later).
For ...
2
votes
Implementations for storing entities in an ECS system
Neither of the three approaches are typical. The first approach could be considered a "naive" approach as it works, but is not very efficient because you'd need to check for every entity if it matches ...
2
votes
Pass data down to components
Will you have networking?
I understand that you are probably making a single player game engine. However, thinking about how to deal with the network very, very, very early in the desgin will push ...
2
votes
Accepted
Where should I put units and items in a squad-combat ECS-based game?
As a general disclaimer and as DMGregory already stated it: The rules of ECS are not written in stone. Doing it on way has benefits, doing it another way has some others. So, you need to know, what ...
2
votes
Accepted
How to Implement ECS Archetypes in C#?
Those Archetypes are IEnumerable<TComponentKind>, where TComponentKind is what you use to identify components. You can, of ...
1
vote
Event-Based Entity-Componenty-System
As Naro's said, you need a component for every player, that joins a Guild / Party / Alliance to save the information, that they are in that alliance or whatever.
But you most likely need a serverside ...
1
vote
How does an ECS work for a world subdivided into chunks (example)?
This answer is focused on how I would approach solving the problem instead of a prebaked specific answer.
For google reference, the basic ideas are based on broad phase and narrow phase collision ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
entity-component × 115entity-system × 79
component-based × 33
architecture × 24
c++ × 21
entity × 12
libgdx × 11
entity-component-system × 9
java × 8
unity × 6
design-patterns × 5
c# × 4
lua × 4
game-design × 3
javascript × 3
events × 3
scripting × 3
game-component × 3
artemis × 3
input × 2
software-engineering × 2
optimization × 2
data-oriented × 2
opengl × 1
rendering × 1