Best practise interacting entities

awiWorks

New member
Hello,

i got a question about best practise about the following setting:

An entity is doing an ingame task (not a behavior tree), for example blackmailing.
the task attachs an executingBlackmail behavior tree to the entity and starts it.
now it seeks for a target; checks if it got some information against it, is it weaker than me or simply try blackmail some stuff on lucky base.
if it reaches the target, it stops the behaviorTree of the target and starts the blackmailTarget behaviorTree on it with the predefined parameters and waits.
the target checks the parameters and chooses reaction; like flee, fight or give in. these are also behavior trees.
for example if it deciedes to flee, it start the flee behaviorTree and attachs the followTarget behaviorTree on the blackmailer.

first of all, it works. but my question is: is there maybe an easier way to solve these kind of task? is it possible to create interacting behaviorTrees between multiple entities?
I thought about global variables, but i think it doesn't work if mulitple entities doing the same stuff.


Thank you in advance and best regards
 
Instead of using parameters you may be able to use the event system to trigger the new behavior:

 
Top