Skip to content

Home v0.1

José Rey Méndez edited this page Aug 21, 2020 · 2 revisions

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

Brief Description.

Planilo 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 a 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.
  • Make your behavior trees modular using the Sub-tree nodes already implemented. This nodes never return the Running result allowing you to interrupt them from their parent trees.

Finite State Machine

  • Create a new finite state machine using the context menu asset creation FSM/Machine open it and start editing.
    • The minimum requirement for a finite state machine to work is to have a state node set as the entry state. Select your entry state node by using the context menu on a node and using the "Set as Entry State" option.
    • Connect different states to create transitions between them, transitions are executed in order so the first valid transition will cancel all following transitions.
    • Add checks between state connections to limit the transitions to certain conditions.
  • You can create your own states by inheriting from FSMStateNode and overriding the Run method were the actual work of your state takes place.
    • Optionally implement the Enter and Exit methods for set up and clean up of the state.
    • See example DebugState
  • You can create your own checks by inheriting from FSMCheckNode and overriding the InternalCheck returning a bool to indicate whether the transition needs to take place or not.
v0.1
Clone this wiki locally