Virtual-Agents-Framework
Virtual-Agents-Framework copied to clipboard
Behavior tree more node types
Adds the following new nodes:
Decorator Nodes:
- RepeateUntilSucces: First executes its child normally. If it fails, it restarts its child. This is repeated until the child succeds or a configurable repeating limit is meet.
- TimeOut: Executes its child normally, until it either succeds or the configured timeout time is exceeded, in that case it lets the child automatically fail. In combination with RepeateUntilSucces, this can be used to wait a certain time for events and then perform another action in case the event didn't happen in time.
- InverterNode: If its child succeds, it fails. If it fails, it succeds instead. Can for example be used to convert RepeateUntilSucces to RepeateUntilFailure
- AlwaysSucceed: All endstates are converted to success. Useful if you don't care if a task actually succeeded.
CompositeNodes:
- Random: Chooses one of its childs at random, then executes it normally. The proababilitys of the individuall children can be changed.
Tasks:
- CheckForProximity: Immediatelyfails or succeds, depending on if a specified object has a specified distance to the agent.
- CheckForValidPath: Fails if the agents NavmeshAgent can't find a path to the specified destination, succeeds if it does. User can configure if partial paths count as sucess or not (default only allows complete paths).
- BehaviourTreeTask: A task that executes its own BehaviourTree. Makes it possible to create small component trees that can then be reused in different trees. However, currently it is not possible to change scene specific data for subtrees, only for the main tree selected in the BehaviourTree runner that is possible.
This PR also fixes problems with the tree serialization which caused heavy performance problems and quadratic file size (e.g. reduces the file size of the Behaviour Tree Sample Scene from 600KB to 40KB).
Depends on PR #4