For technical support please post on the Opsive Forums or Discord for community support.
Behavior Designer is a behavior tree implementation designed for everyone - programmers, artists, designers. Behavior Designer offers a powerful API allowing you to easily create new tasks. It also offers an intuitive visual editor with hundreds of tasks and PlayMaker/uScript integration making it possible to create complex AIs without having to write a single line of code!
Behavior Designer was designed from the ground up to be as efficient as possible. As a result, it runs great on all platforms including mobile. It works with both Unity and Unity Pro.
Thanks for taking a look at it. I havenāt completely decided on the price but I think that Iāll have a launch price of around $50 and then move it to $95 eventually. I do plan on creating a free version, it just wonāt be ready at launch.
Youāll be able to easily create any type of task that you want (action, composite, conditional, or decorator) and the runtime source code is available but editor will have a DLL.
I am currently finishing up the documentation and hereās an example of a simple task that the documentation will walk you through:
using UnityEngine;
using BehaviorDesigner.Runtime.Tasks;
public class MoveTowards : Action
{
public Transform target = null;
public float speed = 0;
public override TaskStatus OnUpdate()
{
// Return a task status of success once we've reached the target
if (Vector3.SqrMagnitude(transform.position - target.position) < 1) {
return TaskStatus.Success;
}
// We haven't reached the target yet so keep moving towards it
transform.position = Vector3.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
return TaskStatus.Running;
}
// OnReset is called by the inspector
public override void OnReset()
{
target = null;
speed = 0;
}
}
You will be able to edit the image that appears in the graph by adding a task icon attribute to the class:
[TaskIcon("path/to/icon.png")]
public class MoveTowards : Action
{
...
I still need to upload content to the videos and samples page. I should be able to submit to the Asset Store within the next day or two so hopefully it will be available next week.
Iāve purchased every behavior tree on the asset store and surprisingly none of them have made tutorials so I usually give them 1 star.
I hope you have more sense then them (excluding NodeCanvas, they have a tutorial ) and make tutorials explaining how to use your assetā¦ donāt be shy and speak in them :). not a rush job.
You will have success with this if you take the time to make comprehensive tutorials, also you will save a lot of time in the forum answering the same questions again and again.
I completely agree. I have already recorded four videos that will give an introduction to Behavior Designer totaling about 30 minutes of content, and yes I did speak in them So far the topics have been an overview, writing a new task, PlayMaker integration, and uScript integration. I have created four sample projects and I plan on making a video for each of those explaining how they work as well. In addition I think that it would be good to have a short video on the task attributes.
I havenāt specifically created a task for mecanim but that doesnāt mean I canāt get one in before I hit submit. What are you looking for? One of the nice things about the Behavior Designer system is that it is really easy to create new tasks - basically it is like creating a new MonoBehaviour object except the update function has a return status. For example, I just wrote the following task which starts an animation state based off of a trigger. When the animation is done playing it will return success (this is completely untested but should work):
using UnityEngine;
using BehaviorDesigner.Runtime.Tasks;
public class PlayMecanim : Action
{
public string targetState = "";
public string eventName = ""; // the event that will trigger the stateName
private Animator thisAnimator = null;
private int stateHash = 0;
public override void OnAwake()
{
// cache for quick lookup
thisAnimator = gameObject.GetComponent<Animator>();
stateHash = Animator.StringToHash(targetState);
}
public override void OnStart()
{
// trigger an event which will start targetState
StartCoroutine(playOnce(eventName));
}
public override TaskStatus OnUpdate()
{
var currentState = thisAnimator.GetCurrentAnimatorStateInfo(0);
// if the current state is equal to the targetState hash then the animation isn't finished playing yet
if (currentState.nameHash == stateHash) {
return TaskStatus.Running;
}
// the animation is no longer playing
return TaskStatus.Success;
}
private IEnumerator playOnce(string eventName)
{
thisAnimator.SetBool(eventName, true);
yield return null;
thisAnimator.SetBool(eventName, false);
}
}
Cheers for well written documentation. I hate video tutorials and itās a shame that solid documentation is still somewhat rare on the store.
If you are using common class names like in that example I hope you are wrapping it in its own namespace btw.
An issue Iāve had with other behavior tree implementations is they actually do too much or are too glitchy. Being too intrusive is a problem as I am writing the actual logic myself and have all the pathfinding already completed. I just want a lightweight framework for designing behavior flow and debugging AI states in the editor. Your framework suited to that?
[quote=āSilly_Rollo_1, post:14, topic: 528417, username:Silly_Rollo_1ā]
If you are using common class names like in that example I hope you are wrapping it in its own namespace btw.
[/quote]We are still supporting Unity 3.5.7 and namespaces werenāt really supported until Unity 4 so we have prefixed all of the tasks with āBDTask_ā. Whenever we set the minimum version to Unity 4 weāll transition to namespaces but for now this is a good compromise. Edit: nevermind, Behavior Designer does use namespaces and the minimum Unity version is Unity 4.
Behavior Designer will stay out of your way There really will be no real game-specific functionality with the default Behavior Designer installation. We have lots of well-commented tasks with the sample projects that do include game logic and pathfinding but the base installation will ship with these tasks. As you can see, most of them are very generic and none of them are really game specific.
Behavior Designer has been submitted and is awaiting approval! I updated the first post to include the promo images that will be used on the Asset Store. I also uploaded the sample projects so you can take a look at the structure of the tasks.
In my last post I responded to Fuzzy_Slippers about namespaces saying that we arenāt using any and weāve prefixed the tasks with āBDTask_ā. I started to think about that some more and decided against it. Behavior Designer was submitted with Unity 4.0 and does use namespaces so it should be able to import into any project without problems.
Hey opsive! thanks for that. seeing that your BT system will work with playmaker, Iāll just use your BT for the AI and utilize playmakers mecanim functionsā¦ I think that would work best
Thanks for the effort, I wasnāt expecting you to do that
``[quote=āBuildABurgerBurg_1, post:17, topic: 528417, username:BuildABurgerBurg_1ā]
Hey opsive! thanks for that. seeing that your BT system will work with playmaker, Iāll just use your BT for the AI and utilize playmakers mecanim functionsā¦ I think that would work best
[/quote]
That sounds like it should work great.
I am listing it at $50 for an introductory price then once that is over $95.
I hope you reconsider the DLL only package. A lot, of developer shy away from assets which are DLL only, especially on time critical projects where changes are needed quickly or as a safety net incase the publisher support wanes. The asset looks amazing regardless, definitely the best looking and documented behavior tree asset in the store.
All of the different task types are not hidden away in a DLL so if you need to make changes to a particular task it is available. It also will show you how easy it is to create new tasks, including composite tasks. That said, I definitely see the appeal of having a source code version. In terms of support, if you take a look at the reviews of my other assets youāll see that I am generally able to fix any bugs within the same day. In a previous post I mentioned that I plan on eventually listing a free version, and I also plan on listing a version that includes the source for the runtime. With that Iād like to be able to offer an āupgradeā plan: if you purchase the DLL version, all you need to do is pay the difference for the source version.
[quote]
The asset looks amazing regardless, definitely the best looking and documented behavior tree asset in the store.
[/quote]I appreciate it