My components are 100% isolated. No component knows about anything outside of itself in any way. Components have functions that operate on their internal state, and events to inform what's happening to their internal state.
I then create a script on my game object called
CommHub where I hook up all the component events to component functions. This works really well and I love it. I love having completely decoupled components and one central place to see how the communications between them are setup. It gives me a high level, while being functional, view of said game object, and some game objects can have a lot of components.
My question is now entity to entity interaction and how to do that while keeping this idea of 100% decoupled components.
Say we have the player game object and a zombie game object. Each is made up of components. The high level idea is the zombie looks in a radius around itself for all entities and if one is the player it'll walk towards it. When in a certain range it'll start a struggle with the player. This is the first interaction between 2 entities. The zombie controller component is the one that checks if it's in range of the player (its target found from the search component) and if so needs to communicate with the player to tell it to start a struggle with this zombie.
A system for communication between the entities is what I'm interested in talking about, while still keeping the rule of components not being aware of other components directly (ie. no component knowledge from within another component). I can't think of a good way to do it like I have with inter-entity components.
How can I approach this?