Timeline for Entity Component System Coupling
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 26, 2014 at 20:40 | comment | added | Hey | @Telastyn good point about the second case, the system could just check if two "position" components have the same identity. For the first case, the ability to change components on the fly is one of the things about this pattern that appeals to me. Maybe I'm abusing the pattern by doing this, but I assumed the OP here was doing the same: "Systems are responsible for the actually modifying the entities by changing their components." But maybe this means changing the properties of components, not changing which components an entity is composed of. I might write up a question about that later. | |
| Nov 26, 2014 at 12:37 | comment | added | Telastyn | @hey - I suppose, but changing the components at runtime seems like setting yourself up for failure (and debugging pain). In the second scenario, I would expect that component doing the check to reference itself, not its owner - or to have the entity ID passed in. | |
| Nov 26, 2014 at 8:21 | comment | added | Hey | @Telastyn I've run into two cases where systems need access to the entity being processed and not just its components. A system might need to add a component to an entity, or remove one. It might also need to check if an entity is the same as the one being processed; for example imagine a system where you need to find the nearest entity to the entity being processed (that could probably be handled with some kind of "identity" component, but using the identity of the entity itself seems more straightforward). | |
| Aug 27, 2014 at 18:45 | comment | added | Telastyn | @veritas - Systems can act on bundles of components then. If your components aren't somewhat isolated, then I question using that architecture. Having pointers (or references) to locations in an array is totally viable - even if it makes re-sizing the things a complete mess. | |
| Aug 27, 2014 at 18:41 | comment | added | Veritas | Systems can't act on isolate components because they may require more than one component to register an entity. Indices are necessary if I want to keep the components in contiguous memory. Pointers don't work because of possible reallocations and references don't allow for a common interface. The user doesn't need to know about the implementation, a Mapper class is responsible for retrieving the appropriate component by accessing the entity. | |
| Aug 27, 2014 at 15:49 | history | answered | Telastyn | CC BY-SA 3.0 |