Skip to content

Commit 449e4e6

Browse files
committed
docs: visualizer docs
1 parent 7883dba commit 449e4e6

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

README.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Inspired by Fluent Behavior Tree.
88

99
* Extendable, write your own custom re-usable nodes
1010
* Pre-built library of tasks to kickstart your AI
11+
* Tree visualizer to debug your trees at runtime
1112
* Heavily tested with TDD and unit tests
1213
* Tracks the last position of your behavior tree and restores it the next frame
1314
* Built for Unity (no integration overhead)
@@ -20,29 +21,6 @@ See upcoming features and development progress on the [Trello Board](https://tre
2021

2122
## Getting Started
2223

23-
Fluid Behavior Tree is used through [Unity's Package Manager](https://docs.unity3d.com/Manual/CustomPackages.html). In order to use it you'll need to add the following lines to your `Packages/manifest.json` file. After that you'll be able to visually control what specific version of Fluid Behavior Tree you're using from the package manager window in Unity. This has to be done so your Unity editor can connect to NPM's package registry.
24-
25-
```json
26-
{
27-
"scopedRegistries": [
28-
{
29-
"name": "NPM",
30-
"url": "https://registry.npmjs.org",
31-
"scopes": [
32-
"com.fluid"
33-
]
34-
}
35-
],
36-
"dependencies": {
37-
"com.fluid.behavior-tree": "2.0.1"
38-
}
39-
}
40-
```
41-
42-
Archives of specific versions and release notes are available on the [releases page](https://github.com/ashblue/fluid-behavior-tree/releases).
43-
44-
### Creating a Behavior Tree
45-
4624
When creating trees you'll need to store them in a variable to properly cache all the necessary data.
4725

4826
```C#
@@ -51,6 +29,7 @@ using CleverCrow.Fluid.BTs.Tasks;
5129
using CleverCrow.Fluid.BTs.Trees;
5230

5331
public class MyCustomAi : MonoBehaviour {
32+
[SerializeField]
5433
private BehaviorTree _tree;
5534

5635
private void Awake () {
@@ -81,6 +60,12 @@ Depending on what you return for a task status different things will happen.
8160
* Failure: Same as success, except informs that the node failed
8261
* Continue: Rerun this node the next time `tree.Tick()` is called. A pointer reference is tracked by the tree and can only be cleared if `tree.Reset()` is called.
8362

63+
### Tree Visualizer
64+
65+
As long as your tree storage variable is set to `public` or has a `SerializeField` attribute. You'll be able to print a visualization of your tree while the game is running in the editor. Note that you cannot view trees while the game is not running. As the tree has to be built in order to be visualized.
66+
67+
![Visualizer](tree-visualizer.png)
68+
8469
### Extending Trees
8570

8671
You can safely add new code to your behavior trees with several lines. Allowing you to customize BTs while supporting future version upgrades.
@@ -114,9 +99,37 @@ public class ExampleUsage : MonoBehaviour {
11499
}
115100
```
116101

102+
### Installing
103+
104+
Fluid Behavior Tree is used through [Unity's Package Manager](https://docs.unity3d.com/Manual/CustomPackages.html). In order to use it you'll need to add the following lines to your `Packages/manifest.json` file. After that you'll be able to visually control what specific version of Fluid Behavior Tree you're using from the package manager window in Unity. This has to be done so your Unity editor can connect to NPM's package registry.
105+
106+
```json
107+
{
108+
"scopedRegistries": [
109+
{
110+
"name": "NPM",
111+
"url": "https://registry.npmjs.org",
112+
"scopes": [
113+
"com.fluid"
114+
]
115+
}
116+
],
117+
"dependencies": {
118+
"com.fluid.behavior-tree": "2.0.1"
119+
}
120+
}
121+
```
122+
123+
Archives of specific versions and release notes are available on the [releases page](https://github.com/ashblue/fluid-behavior-tree/releases).
124+
125+
### Example Scene
126+
127+
You might want to look at the [capture the flag](https://github.com/ashblue/fluid-behavior-tree-ctf-example) example project
128+
for a working example of how Fluid Behavior Tree can be used in your project. It demonstrates real time usage
129+
with units who attempt to capture the flag while grabbing power ups to try and gain the upper hand.
130+
117131
## Table of Contents
118132

119-
* [Example Scene](#example-scene)
120133
* [Library](#library)
121134
+ [Actions](#actions)
122135
- [Generic](#action-generic)
@@ -145,12 +158,6 @@ public class ExampleUsage : MonoBehaviour {
145158
* [Development Environment](#development-environment)
146159
* [Submitting your own actions, conditions, ect](#submitting-code-to-this-project)
147160

148-
## Example Scene
149-
150-
You might want to look at the [capture the flag](https://github.com/ashblue/fluid-behavior-tree-ctf-example) example project
151-
for a working example of how Fluid Behavior Tree can be used in your project. It demonstrates real time usage
152-
with units who attempt to capture the flag while grabbing power ups to try and gain the upper hand.
153-
154161
## Library
155162

156163
Fluid Behavior Tree comes with a robust library of pre-made actions, conditions, composites, and other nodes

tree-visualizer.png

21.2 KB
Loading

0 commit comments

Comments
 (0)