You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-30Lines changed: 37 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Inspired by Fluent Behavior Tree.
8
8
9
9
* Extendable, write your own custom re-usable nodes
10
10
* Pre-built library of tasks to kickstart your AI
11
+
* Tree visualizer to debug your trees at runtime
11
12
* Heavily tested with TDD and unit tests
12
13
* Tracks the last position of your behavior tree and restores it the next frame
13
14
* Built for Unity (no integration overhead)
@@ -20,29 +21,6 @@ See upcoming features and development progress on the [Trello Board](https://tre
20
21
21
22
## Getting Started
22
23
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
-
46
24
When creating trees you'll need to store them in a variable to properly cache all the necessary data.
47
25
48
26
```C#
@@ -51,6 +29,7 @@ using CleverCrow.Fluid.BTs.Tasks;
51
29
usingCleverCrow.Fluid.BTs.Trees;
52
30
53
31
publicclassMyCustomAi : MonoBehaviour {
32
+
[SerializeField]
54
33
privateBehaviorTree_tree;
55
34
56
35
privatevoidAwake () {
@@ -81,6 +60,12 @@ Depending on what you return for a task status different things will happen.
81
60
* Failure: Same as success, except informs that the node failed
82
61
* 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.
83
62
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
+

68
+
84
69
### Extending Trees
85
70
86
71
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 {
114
99
}
115
100
```
116
101
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
+
117
131
## Table of Contents
118
132
119
-
*[Example Scene](#example-scene)
120
133
*[Library](#library)
121
134
+[Actions](#actions)
122
135
-[Generic](#action-generic)
@@ -145,12 +158,6 @@ public class ExampleUsage : MonoBehaviour {
0 commit comments