You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
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.Veritas– Veritas2014-08-27 18:41:27 +00:00Commented Aug 27, 2014 at 18:41
-
@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.Telastyn– Telastyn2014-08-27 18:45:08 +00:00Commented Aug 27, 2014 at 18:45
-
@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).Hey– Hey2014-11-26 08:21:35 +00:00Commented Nov 26, 2014 at 8:21
-
@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.Telastyn– Telastyn2014-11-26 12:37:29 +00:00Commented Nov 26, 2014 at 12:37
-
@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.Hey– Hey2014-11-26 20:40:29 +00:00Commented Nov 26, 2014 at 20:40
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you