Search Unity

Behavior Designer - Behavior Trees for Everyone

Discussion in 'Assets and Asset Store' started by opsive, Feb 10, 2014.

  1. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    ok,I change the class name test again~

    OK,It work !,thanks!
     
    Last edited: Oct 27, 2014
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I am working on the next Behavior Designer update and one of the changes that I am making is changing the base class of Task and SharedVariable from ScriptableObject to System.object. ScriptableObject is no longer necessary since Behavior Designer does all of the serialization and drawing. In general the switch should be painless and you shouldn't even notice. The sample projects and unit tests converted over seamlessly. However, if you use any ScriptableObject methods/fields (such as GetInstanceID or .name) in your project you'll receive compiler errors.

    I don't know when I'll be releasing this version yet but if you'd like to get it now send me a PM or email.
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @ZJP -

    I am adding Trigger Event Pro integration now. Are there any tasks in particular that you'd like to see?

    @RandAlThor -

    I have added UniStorm integration tasks. Here's a list of the tasks that I created, let me know if you want any other ones.
    UniStormTasks.PNG
     
  4. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Nothing in particular. I would do with what you add. Thank you for asking the question. :cool:

    Edit :
    Maybe a 'link' to and from the 'Messenger'...
     
    Last edited: Nov 1, 2014
  5. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @opsive Did you get a chance to test Behavior Designer in the Unity 5.0 beta? Does it work?
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @ZJP -

    Here's the list of tasks that I came up with for Trigger Event Pro integration, it pretty much covers everything the Messenger does:

    TriggerEventProTasks.PNG

    @Seith -

    Yes, it has worked with 5.0 for the past month or two. Visual Studio doesn't resolve the Behavior Designer Runtime DLL correctly but that has been fixed in the version that I am submitting within the next few days. It does resolve correctly in Mono Develop though
     
  7. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh, nice. Thanks. :cool:
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Behavior Designer 1.4.3 has been sent to opsive.com purchases and released on the Asset Store. You can take a look at the full change log here. The highlights of this release include a lot of new tasks and integrations. The following integrations have been added:

    Control Freak


    Curvy


    Glow Effect


    Trigger Event Pro


    UniStorm
     
    hopeful likes this.
  9. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Justin, thanks for the new integration.
    This package is getting more and more awesome.
     
  10. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    I'm thinking of purchasing this asset but I just need a couple of things confirming if possible as I couldn't seem to find the answer.

    1) Are legacy animations supported? I'm ditching my current solution because it doesn't.

    2) I'm using Aron's Pathfinding Project Pro, what variables are we allowed to change in your solution? I'm wanting AI to run to the base but if a player is in range before they get there, chase the player. Finally, if they are standing next to the base or player, attack it. Because I have dynamic obstacles, I need to be able to perform a Repath request on the seekers by setting a Repath Rate of some sort, is this possible?

    3) Can you reference variables of another script in some way, so in the 'Attack' block, I can tell it to GetComponent<BaseHealth>.RemoveHealth(10); for example...?

    Once these are answered and possible, I'll purchase straight away.

    Thanks

    EDIT: After watching the videos, I was impressed so purchased it anyway but if you could answer the above, it would be appreciated as I won't get time to test it all until later. I have also sent the email with invoice number to obtain the movement pack for free.
     
    Last edited: Nov 4, 2014
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @rocki -

    I appreciate it! Let me know if there are any other integrations that you'd like to see.

    @auroxi -

    Thanks for your purchase! To answer your questions:

    1.Yes, Behavior Designer includes the full set of animation tasks.
    2. You can really change whatever you want. The integration tasks included in the Movement Pack set the speed and turning speed of the A* component and leave everything else alone. The tasks don't include the repath rate, but you can either set that ahead of time or if you want to change it within the task you can add it with a very small amount of code additions.
    3. Yes, If that is all you want the task to do you can use the Invoke Method reflection task.

    Edit: To expand on this, your questions were mostly focused on what restrictions Behavior Designer has in terms of accessing other API. Behavior Designer tries to stay out of your way as much as possible. The Behavior Designer functionality really comes from the tasks that are used, and those tasks can easily be created/modified. Behavior Designer includes a large set of tasks, but those are by no means the only tasks that it can use. If you download the RTS or CTF sample project you'll see that there were a lot of custom tasks created specifically for those projects.
     
  12. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    To anyone thinking about purchasing this asset, just do it! Justin has been a star helping me out and resolving an issue I had. It's far better than another behaviour asset I had purchased previously and does everything you can imagine. I now have enemies that are doing exactly what I want and animals that are walking around doing their thing :)

    Great asset. Great support.
     
  13. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    I just purchased Behavior Designer, installed the latest version, installed the dialogue system package, and then installed the dialogue system sample scene.

    I am using Unity 4.6(b20)

    The only problem, is that the dialogue system package has a compile error.

    compileerror.png
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for letting me know. Go ahead and download the Dialogue System integration tasks and sample project again - you shouldn't get any more errors.
     
  15. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    Wow. That was amazing fast.

    Thank you.
     
  16. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I am facing an issue, I don't know whom should I send the question. I am using BD 1.4.2 (Apex path movement Pack) with AI for mecanim. Attached is the State diagram. Patrol movement pack for Apex path is what I am using here. First time when it goes into patrol, it is working fine. When it hit seek and then go back to patrol, the patrol behavior is not able to find the patrol points and just stuck in the middle, everything in the patrol BD is green. I know it is confusing, do you have any suggestion ? Thanks
     

    Attached Files:

    • AI.png
      AI.png
      File size:
      20.2 KB
      Views:
      885
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    It looks like you have a lot of moving parts. I don't completely follow - from the image that you posted, that looks like it is AI for Mecanim. Does AI for Mecanim have actions which are similar to the Movement Pack? Where are you using the Movement Pack tasks? I guess I'd like to see your behavior tree along with the state machine in order to figure out where the problem lies.
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just wanted to quickly mention that the next version of Behavior Designer will be coming out soon. I have gone ahead and released the next set of integrations tasks since they don't require any of the new features. On the integrations and samples page you can now download the Particle Playground, SECTR, and Vectrosity integrations.
     
    hopeful likes this.
  19. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @opsive Hi, I was wondering how to keep the Behavior editor from automatically framing the currently active task? It's pretty annoying to frame the graph just like I need and then have the view jump to a completely different part when I start the game. I'm sure there must be a setting for this but I don't know where to find it...
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    It will automatically reposition if a new tree is selected, otherwise it should keep your current position. What do you do that repositions the tree when you don't think it should? I haven't submitted 1.4.4 yet so I can still get it in the next update.
     
  21. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Well all I do is:

    1) Open the Behavior Editor
    2) Select a character in the scene which has a Behavior Tree component attached (the editor then updates to show that character's tree)
    3) Frame the tree on just a couple of tasks I'm interested in
    4) Start the game

    As soon as the game starts, the view jumps away from the framing I chose to show instead the currently active task.
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    When I follow those steps it stays in position for me. Are you using external behavior trees at all? If so, did you attach it directly to the behavior tree component or are using the behavior tree reference tasks?
     
  23. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I reattached the behavior tree (the asset file itself) by click-and-dragging it to the "External Behavior" slot on the component and now it doesn't happen anymore! I'm sorry, I must have made somehow a wrong manipulation. The editor seems to correctly stay on the selected view now. Thanks! And sorry for the false alarm... :)
     
  24. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Still, there is something I don't understand: when I select the behavior.asset file and edit it, everything updates fine in the editor. But then when I select a character in the scene which has this very same asset file set as its external tree, it shows me a different tree, without the edits I just made!

    And if I drag-and-drop the behavior asset file on the External Tree slot of the character's Behavior Tree component is still shows the wrong tree (without the edit) in the editor!

    But if I click on the round dotted icon on the character's Behavior Tree component to browse for an external tree, and then I choose the SAME behavior asset file, only THEN do I see the correct tree in the editor!

    That really threw me for a loop. Am I doing something wrong here?

    ---

    Another thing: when I edit the behavior asset file and I click on Save (in the BT editor) to save the tree I can only save it as a .prefab file. Which will NOT be accepted by the External Tree property of a character's Behavior Tree component. So I guess that means that any change I make to a behavior tree is instantly saved in the project? But in that case what is the use of saving at all?

    Thank you for your patience. As you can see I'm still more than a little confused about the system...o_O
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Are you running the latest version? I don't remember when I thought that I fixed this but I just tried these steps and it worked (granted I am running mostly 1.4.4 now but I didn't make any changes related to this in 1.4.4).

    The trees are automatically saved and the only time you need to use the save button is when you want to change the type of file the tree is saved out to. Maybe I should rename it "Export" instead of "Save"? If you are working with a tree saved on a regular behavior tree the save button will export it to an asset file. If you are editing an asset file it will allow you to move it back to a regular behavior tree, in this case saving it out to a prefab instead of saving it directly in the scene. This just allows you to convert an asset file back into the regular behavior tree component.
     
  26. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    302
    Do you have any examples of AI shooting using raycast or projectiles?
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    In the RTS sample project the units shoot a rocket at the target. In addition, the PlayMaker and UFPS sample projects have an example of this, but of course you'll need a copy of PlayMaker or UFPS to run it.

    Edit: The Dialogue System for Unity sample project also includes a projectile.
     
    Last edited: Nov 19, 2014
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Behavior Designer 1.4.4 has been sent to opsive.com purchases and is now out on the Asset Store. You can see the full release notes here. Some highlights include:

    New Shared Variable type: Shared Generic Variable
    Format.PNG
    The SharedGenericVariable was necessary for the Format String task. A SharedGenericVariable will allow you to select the Shared Variable type within the inspector.

    Update Check
    Version.png
    Integrations with:

    Particle Playground


    SECTR


    Vectrosity
     
  29. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @opsive So I updated to the latest version and the problem seems to be gone! Thanks for your explanations. "Export" might be clearer indeed. If not as a user I am under the impression that I have to click "Save" to save my work.

    By the way I like now how the graph tells you when a Sequence is active but some of its task failed with both green color AND red cross . It makes what happened even clearer. :)
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I just changed it to Export. You weren't the first person confused by the naming. Great to hear that you're enjoying the update :)
     
  31. wayneh654

    wayneh654

    Joined:
    Nov 25, 2012
    Posts:
    15
    the add-on 3rd parting you have for AI For Mecanim no longer works in Unity5. When you you expected a update for this. 7 errors saying the reference is ambiguous.
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for letting me know. It looks like in Unity 5 there is a new class called StateMachineBehaviour in the UnityEngine assembly so it was getting confused with the StateMachineBehaviour in AI For Mecanim. I've fixed the error - go ahead and try downloading the tasks again from the integration page.
     
  33. antoineguidi

    antoineguidi

    Joined:
    Sep 3, 2012
    Posts:
    9
    Hello

    Your package is great, I had doubts about the performance regarding Data Oriented Design, but I must say you have achieved great results in that area. I am a recent embracer of DOD so I am definitely not an expert.

    I have done some performance tests where I performed the same code in an OOD project, a DOD project and a BD project.
    The first was terrible, the DOD and the BD project came very close, at a 33% impact compared to the OOD.
    With the BD project almost matching my DOD project performance to the ms.

    The difference I saw was while in my DOD project the average frame rate was 30, it had constant, albeit small and short peeks to 60, the one with BD was more constant and kept it at 30, with almost no peeks.

    The executed code was exactly the same on both projects, except in my implementation I had all of the logic performed in one script in a GameObject whereas in the BD project I had the code executed in tasks within a non-external tree attached to each unit. I must say, implementing DOD manually on a big project has a huge time and training cost (when working with teams) compared to your excellent BD editor.
    Do you think using external trees, one per each big group of units could possible improve performance?


    The basic settings of the projects was as follows.

    I was using Manual Ticks (in general, not per tree) and on all of the projects the logic was executed in the FixedUpdates() (where I called the Tick function of the Behaviour Manager).


    I was working with 100 units casting mostly Animation and Physics methods. (Raycasting, Physics.Overlap, Vector operations, change state, etc.).

    Do you think using external trees will improve the performance?

    I wonder what is the best approach for using your tasks, assume I want to calculate the destination of an object and affect the Animator in consequence.
    Do you recommend affecting the Animator within the script associated to the task as I do my calculations (for example in a modified CanSeeTask) or storing the results in SharedVariables and affect the Animator with one of your Animator tasks, i.e. Set Float Parameter?


    Another question, although it should not be to difficult to implement by having a tree that links to Global Variables, and then a Synchroniser affecting that three. But, is there a chance you could add the functionality to the Variable Synchroniser so it could affect also Global Variables?

    This would be a nice little prop, or perhaps is a bad idea in your implementation, I do not know.

    Anyway, my complements on your work.

    On another subject, I am getting this error too often when I try to remove or sometimes even edit the properties or name of SharedVariables in the Tree Editor.
    Perhaps you could help.
    Thank you.


    NullReferenceException: Object reference not set to an instance of an object
    BehaviorDesigner.Editor.GraphDesigner.RemoveSharedVariableReference (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, BehaviorDesigner.Runtime.SharedVariable sharedVariable)
    BehaviorDesigner.Editor.GraphDesigner.RemoveSharedVariableReferences (BehaviorDesigner.Runtime.SharedVariable sharedVariable)
    BehaviorDesigner.Editor.BehaviorDesignerWindow.RemoveSharedVariableReferences (BehaviorDesigner.Runtime.SharedVariable sharedVariable)
    BehaviorDesigner.Editor.VariableInspector.DrawAllVariables (IVariableSource variableSource, Boolean fromGlobalVariablesWindow, System.Collections.Generic.List`1& variables, System.Collections.Generic.List`1& variablePosition, System.Int32& selectedVariableIndex, System.String& selectedVariableName, System.Int32& selectedVariableTypeIndex)
    BehaviorDesigner.Editor.VariableInspector.DrawVariables (IVariableSource variableSource, Boolean enabled, Boolean fromGlobalVariablesWindow, System.String& variableName, System.Boolean& focusNameField, System.Int32& variableTypeIndex, UnityEngine.Vector2& scrollPosition, System.Collections.Generic.List`1& variablePosition, System.Single& variableStartPosition, System.Int32& selectedVariableIndex, System.String& selectedVariableName, System.Int32& selectedVariableTypeIndex)
    BehaviorDesigner.Editor.VariableInspector.DrawVariables (IVariableSource variableSource, Boolean enabled)
    BehaviorDesigner.Editor.BehaviorDesignerWindow.DrawPropertiesBox ()
    BehaviorDesigner.Editor.BehaviorDesignerWindow.Draw ()
    BehaviorDesigner.Editor.BehaviorDesignerWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hi @antoineguidi -

    I really appreciate the complements. I am really happy with the data oriented design results as well. For smaller trees the architecture really doesn't matter but when you start to get larger trees or want to run many trees at the same time it really starts to pay off.

    No, there won't be any performance difference between running regular trees versus external trees. When the tree is enabled it sets up the data structures for the data oriented design and to do that it needs to load in the external tree data. Most of the time spent will be within the OnUpdate loop of the actual tasks rather than traversing the tree. Things like rendering and physics are going to take much more time comparatively then executing the tree.

    It depends on how verbose you want to be, but my personal preference is to combine many functions within a single task as long as it is still within the scope of the task. In the case of playing an animation while a Movement task is running, I personally would modify the task to set the Animator parameter within the OnStart and stop it within OnEnd but that's just so there aren't as many tasks within the tree. Using the SetFloatParameter task would definitely work as well and is by no means a bad option, it is just how you want to structure your tree. There really isn't one right way to do it.

    Sure, I'll make sure the synchronizer can accept global variables in the next update.

    Can you tell me how to reproduce that exception? I'd love to see what is happening.

    Thank you again for your complements, it means a lot. I am happy to hear that you are enjoying Behavior Designer.
     
  35. antoineguidi

    antoineguidi

    Joined:
    Sep 3, 2012
    Posts:
    9
    Thanks for the quick response and excellent service.


    Well the only thing that I am doing is going to the editor and clicking x (to remove the variable).
    I do not get the exception if I change the variable name.
    I have been trying to reproduce the exception but I am unable too.
    It only happens with some variables and with some trees, I have not created that much trees at this point but if I can see a pattern I will let you know.

    Which by the way, where are the non-external trees stored? In the Parent Game Object in some file that is not visible?
    I noticed when updating I did not have to copy anything but the General Variables asset and my custom scripts.
    It had me wondering where the information for non-external trees is stored. I am a complete noob regarding Unity internals but I wandered through the project folders and could not find anything, so I have too asume it is attached to each particular game object but can't seem to find any script with the actual Task and Tree information. But besides the wrapper component I can't see anything else.

    Perhaps I can send you the object with the tree if I see the error again.

    Thanks again.
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks, if you could find a way to reproduce it that would be great. When you do manage to reproduce it you can send the tree to support@opsive.com. With non-external trees the data is stored in the actual Behavior Tree component attached to the GameObject. When you send the tree you can export the scene as a Unity Package and I should be able to reproduce it right away. This scene only needs to contain the Behavior Tree component so you can remove any other objects in the scene to make it as small as possible.
     
  37. TopThreat

    TopThreat

    Joined:
    Aug 7, 2012
    Posts:
    136
    Hi there Opsive! Have you considered integrating with Realistic FPS prefab? How hard do you think it would be for me to get this to work with RFPS without some type of integration (And game dev is a hobby not my day job so I am totally newb)
    Thanks!
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hey @LeeAllen -

    I actually have had it on my list and was going to add it with the next version - good timing :)

    I haven't used Realistic FPS yet so don't know what it is capable of, but what types of functions are you looking for? This will help give me an idea of what to focus on. For reference, here are the tasks that I made for UFPS
     
  39. TopThreat

    TopThreat

    Joined:
    Aug 7, 2012
    Posts:
    136
    There is some very basic AI already with Realistic FPS that basically just targets the player if needed and then either shoots at range or comes closer and attempts to whack at the player with melee. Personally, I just need to be able to have the AI recognize that I have a player and then know they are getting hit and vice versa. I am probably the wrong person to ask since my requirements are so low lol. Right now I have these worms that run around and get stuck on everything. I would like to be able to get past that using some real AI system and then go from there as I learn how to use the system and understand the capabilities more.

    I don't know if it matters but I will also be using your tool with Dialogue System for Unity.

    Thanks for the quick reply!!

    - Lee
     
  40. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Hey, I've been tinkering with this package for around a week now, really pleased with it, only hiccups encountered are solely on the "learning behavior tree" aera, so great.

    One thing I'd like though, is the ability to create variable from code, in the editor.
    Right now I have a small class basically getting and setting/updating a handful of variables, and it would help if with like Onvalidate I could create variables in the chosen tree if they didn't exist.

    Do you think you could enable this access to your API?
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @LeeAllen -

    Thanks for letting me know your use case. I don't think the Realistic FPS integration will require any new code in the Behavior Designer package so as soon as I get it done I'll upload it to the integrations and samples page and you won't need to wait for a new Behavior Designer release. I'll make a post here when I upload it (it shouldn't take me too long once I get started on it, hoping to have it done by the end of the weekend).

    @khan-amil -

    It's great to hear that Behavior Designer has been working well for you. Can you explain what your small class does a little more? The only problem with creating variables purely through code at runtime is that they need to be assigned, and while it would be possible to loop through all of the task fields and assign that variable, there isn't a very generic way of doing it (for example, say you have task A which includes a SharedInt field, you may want to assign this field to the variable that you just created but not assign the SharedInt field of task B).

    If I understood your situation a little better I may be able to make a suggestion on how to get it to work with the current version or have a better understanding of what I need to add.
     
  42. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    Opsive I have found a bug. I'll describe in detail so you can try and replicate this issue.

    I have a base and when it is attacked it plays a sound file. Now on the behaviour tree on the enemy that's hitting the base, I had a parallel running two blocks:

    [Parallel]

    [Play One Shot] [Attack Base]

    Now when I disabled the [Play One Shot] block temporarily, I had a flood of errors constantly:

    Code (CSharp):
    1. InvalidOperationException: Operation is not valid due to the current state of the object
    2. System.Collections.Generic.Stack`1[System.Int32].Peek ()
    3. BehaviorDesigner.Runtime.BehaviorManager.BehaviorOnTriggerStay (UnityEngine.Collider other, BehaviorDesigner.Runtime.Behavior behavior)
    4. BehaviorDesigner.Runtime.Behavior.OnTriggerStay (UnityEngine.Collider other)
    As soon as I enable the [Play One Shot] block, all errors go away.

    See the attached image and you can see better what's going on.



    Again, as soon as the [Play One Shot] block is enabled, all errors go away.

    Hope this helps you and anyone else.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for the bug report @auroxi. Are you running version 1.4.4 of Behavior Designer? I think I fixed that exact error in the last release.
     
  44. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    I'm staying on 1.4.3 for the time being as it does everything I need. If you've fixed it then no need to worry but thought I'd mention it.
     
  45. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Is the Movement Pack free for new buyers only?
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @auroxi -

    Thanks for mentioning it. It's good to hear that you are still on 1.4.3 - when you do update it should be fixed. Of course, let me know if it isn't.

    @OnePxl -

    It's free for anybody who purchased Behavior Designer outside of the Madness Sale back in May. If you purchased it during the Madness Sale you already got a great deal :)
     
  47. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    @opsive :

    Yeah, adding variables at runtime would pose a lot of problem, that's not what I meant ^^
    I was talking about adding it via code in the editor via an editor class, to help set-up.

    Basically, for the variables that I need to access from outside the behavior tree, I looked for this api call to limit the risks of mispells tied to string fields. And also because I know from where I am I'll probably re-do the whole tree a couple time as I go along. So it's just for convenience really.
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @khan-amil -

    I think that I am starting to understand. To ensure a variable isn't misspelled, can't you use behaviorTree.GetVariable("string")? If it returns a variable then it isn't misspelled, otherwise it is either misspelled or not created yet. You can then use SetVariable to actually set the variable. In addition, this may or may not help, but GetAllVariables will return a list of all of the variables.
     
  49. vixus

    vixus

    Joined:
    Apr 8, 2013
    Posts:
    6
    Hello, I have some questions regarding how BD works:

    1. in Leader Follow ... if i have 2 leaders and 2 floks that follow... and i intersect their paths... will they properly avoid eachother or will they just ignore eachother and move through?
    2. Does Leader Follow alco includes Queue? To me it seems like they shoud work together... can i add both to the same object?
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    1. The Leader Follow task contains some code which keeps the objects separated for the group of objects following it, but the actual task doesn't contain any other type of avoidance. This depends more on the underlying pathfinding solution that you are using. For example, if you are using Unity's NavMesh it does not contain local avoidance but the pro version of the A* Pathfinding Project does. The Leader Follow task sets the desired destination and it is up to the underlying pathfinding solution to get there.

    2. I think that you should only need the Queue task in that case. The destination of the Queue task can change so you don't need the Leader Follow task.