[Unity plugin] AI Behavior Tree Usage Summary

Source: Internet
Author: User

Reference Links:

72937709

52587364

78596732

0. Node

In general, only need to extend the conditional and action of the two nodes, decorator and composite nodes only need to use the built-in is enough.

For conditional nodes, the success or failure can be returned based on the judging criteria.

For an action node, in addition to success or failure, there is a running state that indicates that the node has not finished executing and the next frame continues to execute the node.

For composite nodes, here is a direct reference to the link:

A.sequence:

B.selector:

C.parallel

Test the parallel node here:

Test One:

Test Two:

1. The life cycle of the behavior tree

In general, the life cycle of a tree is over when there are no nodes that can continue to execute.

A. Set the float variable num with a value of 0. The following logic is that if NUM is greater than 0, the output is "greater than 0", otherwise the output is "less than or equal to 0". This tree executes only once.

B.repeater node Tick repeat forever, the tree will continue to execute once it has been executed again.

C. Change the NUM value to 1, increase the action node, and return to running. This behavior tree will then be stuck in the action node and will not continue executing the other nodes, and the life cycle will not end.

D. Because the action node returns running, the behavior tree has not been executed, the Repeater node does not work, and the conditional node executes only once.

[Unity plugin] AI Behavior Tree Usage Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.