I have a question regarding Decorators.
I need an event-based decorator that is triggered based on some event in the world.
e.g. When an Alien lands, all minions stop what they are doing and run.
As far as I know, the current options don’t seem to facilitate this:
If I mark a decorator’s Flow Control as None, then it is only evaluated when the node is evaluated which can be quite a while based on the tasks.
e.g. Minions dont check to see if alien lands unless they are done whatever they are doing.
If I mark a decorator’s Flow Control as Observer Aborts, then it is evaluated every tick of the tree … e.g. polling the condition. This is the correct behavior, and when it triggers it instantly cancels behavior. e.g. Minions are constantly checking some state to see if the alien lands. But this seems ineffecient and scales poorly with the number of agents?
A service does not appear to work in this instance either, as it is constantly polling as well.
Ideally, I would like an Event-based Decorator condition. E.g. Some other Game Actor could trigger an event which causes the condition to trigger.
When the decorator is first executed, it could bind an event to a dispatcher.
Then if the event is triggered, it would perform the same as Observer Aborts. (But it would not need to poll).
Is this approach valid or is there an easier approach?
Thanks for any feedback / ideas