
Crafting immersive experiences that bridge players and game worlds.
Gameplay and Engine programmer
Behavior Tree
A simple behavior tree system which can run in a standalone app for testing, and can also be directly used in game by AI controllers.
Behavior Tree and TreeNodes:
A behavior tree updates by ticking from the root node down to the leaf nodes every frame or at a set interval. The root node starts the process by ticking its child, propagating execution downward through composite nodes and decorator nodes. Once a leaf node is reached, it returns Success, Failure, or Running, which propagates back up the tree.
If a node returns Running, the current iteration will resume in the next tick, keeping the behavior reactive. Otherwise the tree resets and starts a new iteration, allowing dynamic AI responses.
XML-Driven:
Behavior trees are stored in XML files, utilizing the hierarchical structure of XML files to represent the parent-child relationships of behavior tree. Each treenode in the behavior tree is defined as an xml element with their type and attributes directly specified as text.

TreeNode Factory:
TreeNodes are generated by a dynamic node creation system designed by myself. Once registered on the name, the node factory can dynamically instantiate tree node instance based on their type. Also ensure the extensibility of the system.

Behavior Tree Viewer:
An standalone application that can not only test run a behavior tree with breakpoint, but also serve as a local networking client, receiving data sent from behavior trees running in games to display their status.

In-game implementation:
The behavior tree is attached to the boar to on its controller for a simple patrol (move to location) logic. And the behavior tree viewer is monitoring real-time status of the boar bahavior tree.


