Ok, so I’ve been rereading the “rules of thumb” for an entity system and I am slightly confused by one of the rules:
Never modify the same component from different systems. I’ve been trying to rewrite my systems to apply this rule (because past me didn’t know better apparently) and was unsure of how to take certain usecases.
For example, I have a system called HealthSystem that takes care of setting the health of my entities as well as processing any damage that they take. This system also sets a death component to any entity that reaches the health of 0 or lower.
I also have systems that take care of the entity behaviors (e.g. MonsterBehavior) that, by my original design implementation, could set any types of components as it saw fit (like a death component if the entity reached a certain state). Now obviously this pretty much breaks the rule of only one system should modify a certain type of component, because the behavior system and the health system would be both writing death components. So my question is; how would I go about implementing my systems so that they respect that rule while keeping my game logic decoupled?