Announcement

Collapse
No announcement yet.

AI Behavior Tree - Service or Task? how to choose?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AI Behavior Tree - Service or Task? how to choose?

    TL;DR: What are the guidelines to create a service vs a task for a specific action?

    I'm looking into Behavior Tree and I'm looking into some guidelines on when to use a service vs task.

    For example, I was thinking on using a task to find the AI enemies (like the player), using a perception component.
    I then looked at the ActionRPG example, and noticed they have a service to doing something like that.

    I then thought perhaps it's about an actual action (like moving) vs updating the blackboard. But I found a node in the same ActionRPG example
    with a task for "Finding new location round target", which is the same thing.

    So what is it? What are some points/guidelines that can help one decide if he should use a service or a task a behavior tree?

    #2
    Hello,

    Have you seen what the documentation has to say about the issue? Maybe there is a snippet in there that clarifies the best way of implementing your idea. Unfortunately, I personally do not have an answer for you.

    Decorator Nodes: Also known as conditionals. These attach to another node and make decisions on whether or not a branch in the tree, or even a single node, can be executed.

    Service Nodes: These attach to Composite nodes, and will execute at their defined frequency as long as their branch is being executed. These are often used to make checks and to update the Blackboard. These take the place of traditional Parallel nodes in other Behavior Tree systems.
    https://docs.unrealengine.com/en-US/...nce/index.html
    https://docs.unrealengine.com/en-US/...ors/index.html
    https://docs.unrealengine.com/en-US/...ces/index.html

    Comment


      #3
      Yup, looked already. Tried to look all over the documentations and examples.
      There doesn't seem to be any guideline as far as I can tell, and I'm not really sure when to use which.

      Comment


        #4
        The service is to get information that is then used to make decisions: "Finding new location round target", "low hit points?"...

        The tasks are more the physical actions of the character: "Move to target", "Use health potion"...

        Comment


          #5
          Services best sit on the selector or sequence nodes. They are good at making calculations on that node.
          Tasks do exactly that.

          Services biggest thing is that they can run parallel, like you can have an AI run via a task and shoot via a service.

          Check out my itch.io page, I'm really excited about it.
          https://kinos141.itch.io/

          Please check out my AI package: Action AI System Feat. Stealth
          https://www.unrealengine.com/marketp...m-feat-stealth
          or get it from itch
          https://kinos141.itch.io/action-ai-system-feat-stealth

          Comment

          Working...
          X