Blueprint interface VS ActorComponent, The Good And The Bad

I’d like to add a third method, since I don’t like the idea of “outside” actors directly talking to all and any components inside my actor and an interface is not always enough if you wish to talk to multiple actors which you might need to find first. In some cases I implement an event component, one which responds to events in the form of a string “mission_34_completed”, “martians_invaded_earth” on a central manager component within GameMode / GameInstance. Bonus is that you can read those events anywhere from actors to dialogs to mission logic wherever you need to know about world events. I based this on my previous project Road To The North.

Once you set up delegates between the event component and central manager, the actor / other component and the event component, there won’t be any casting at all for world events, only for smaller interactions which need to share data such as “pick up actor at line trace”. Technically… some of that can even be overcome if you’d always share JSON on an event and unpack it on the other end. Otherwise you’d get signature mismatches on data you want to send on different events.

Interesting read:

Implementing event-based communication between microservices (integration events) - .NET | Microsoft Learn