Skip to content
José Rey Méndez edited this page Aug 20, 2018 · 9 revisions

Welcome to the AIGraphs documentation! This project is based on the open source project xNode.

Brief Description.

AIGraphs is intended to be a visual node editor for AI tools, the first available tools will be Behavior Trees and Finite State Machines. Any AI graph can be run from a game object by just adding the AIGraphRunner component.

Blackboard

  • The blackboard is a dictionary used to contain data relevant to identify and execute a single AI runner. Each AIGraphRunner component creates it's own blackboard to contain information.
  • Add blackboard variables to be on your AIGraphs by adding some of the blackboard variable nodes implemented (See here). Set the name of the nodes to the intended blackboard key.
  • Implement your own blackboard variable nodes by inheriting from the generic BlackboardVariableNode.
  • Modify the blackboard on runtime from your components by using the methods SetInBlackboard and UnsetInBlackboard found in the AIGraphRunner component.

Behavior Trees

  • Create new behavior trees using the context menu asset creation BT/BehaviorTree open it and start editing.
    • The minimum requirement for a Behavior tree to work is to have either a composite or decorator node set as root. Select your root node by using the context menu on a node and using the "Set as Root" option.
  • You can create your own tasks and checks by inheriting from BTTaskNode. and overriding the InternalRun method. This method should return one of the defined states in BTGraphResult: Success, Failure or Running.
    • Success and Failure will somehow advance the execution from the behavior tree.
    • Running will normally stop the behavior tree execution and continue from the same point on the next execution.
    • See examples DebugVariable, IsNullCheck.
  • Implement your own composites by inheriting from BTCompositeNode.
    • Override the ShouldBreakLoop method to check what the last children returned and decide whether continue execution or not.
    • Optionally override the PrepareChildren method to modify the order in which the children will be executed.
    • See examples Selector, Sequencer.
  • Implement your own decorators by inheriting from BTDecoratorNode.
    • Override the InternalRun method to run your child node and modify its result or do some extra work with it.
    • See examples Inverter, Succeeder, Debugger.
  • Use your blackboard variables from tasks, checks and other types of nodes by using input ports and using the utility function GetBlackboardValue inherited from BTNode.
v0.1
Clone this wiki locally